protected byte getPigType ( AbstractType type ) { if ( type instanceof LongType || type instanceof DateType || type instanceof TimestampType ) // DateType is bad and it should feel bad return DataType . LONG ; 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 || type instanceof UTF8Type || type instanceof DecimalType || type instanceof InetAddressType ) return DataType . CHARARRAY ; else if ( type instanceof FloatType ) return DataType . FLOAT ; else if ( type instanceof DoubleType ) return DataType . DOUBLE ; else if ( type instanceof AbstractCompositeType || type instanceof CollectionType ) return DataType . TUPLE ; return DataType . BYTEARRAY ; }
get pig type for the cassandra data type