Pig: support for Int32Type.

Patch by brandonwilliams, reviewed by xedin for CASSANDRA-4459
This commit is contained in:
Brandon Williams 2012-07-25 12:06:49 -05:00
parent 9a63394765
commit 6f384c54de
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ column_metadata =
[
{column_name: name, validation_class: UTF8Type, index_type: KEYS},
{column_name: vote_type, validation_class: UTF8Type},
{column_name: rating, validation_class: IntegerType},
{column_name: rating, validation_class: Int32Type},
{column_name: score, validation_class: LongType},
{column_name: percent, validation_class: FloatType},
{column_name: atomic_weight, validation_class: DoubleType},
@ -23,7 +23,7 @@ column_metadata =
[
{column_name: name, validation_class: UTF8Type, index_type: KEYS},
{column_name: vote_type, validation_class: UTF8Type},
{column_name: rating, validation_class: IntegerType},
{column_name: rating, validation_class: Int32Type},
{column_name: score, validation_class: LongType},
{column_name: percent, validation_class: FloatType},
{column_name: atomic_weight, validation_class: DoubleType},

View File

@ -670,7 +670,7 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface, Lo
{
if (type instanceof LongType || type instanceof DateType) // DateType is bad and it should feel bad
return DataType.LONG;
else if (type instanceof IntegerType)
else if (type instanceof IntegerType || type instanceof Int32Type) // IntegerType will overflow at 2**31, but is kept for compatibility until pig has a BigInteger
return DataType.INTEGER;
else if (type instanceof AsciiType)
return DataType.CHARARRAY;