in src/org/apache/pig/data/BinInterSedes.java [334:435]
public Object readDatum(DataInput in, byte type) throws IOException, ExecException {
switch (type) {
case TUPLE_0:
case TUPLE_1:
case TUPLE_2:
case TUPLE_3:
case TUPLE_4:
case TUPLE_5:
case TUPLE_6:
case TUPLE_7:
case TUPLE_8:
case TUPLE_9:
case TUPLE:
case TINYTUPLE:
case SMALLTUPLE:
return SedesHelper.readGenericTuple(in, type);
case BAG:
case TINYBAG:
case SMALLBAG:
return readBag(in, type);
case MAP:
case TINYMAP:
case SMALLMAP:
return readMap(in, type);
case INTERNALMAP:
return readInternalMap(in);
case INTEGER_0:
return Integer.valueOf(0);
case INTEGER_1:
return Integer.valueOf(1);
case INTEGER_INBYTE:
return Integer.valueOf(in.readByte());
case INTEGER_INSHORT:
return Integer.valueOf(in.readShort());
case INTEGER:
return Integer.valueOf(in.readInt());
case LONG_0:
return Long.valueOf(0);
case LONG_1:
return Long.valueOf(1);
case LONG_INBYTE:
return Long.valueOf(in.readByte());
case LONG_INSHORT:
return Long.valueOf(in.readShort());
case LONG_ININT:
return Long.valueOf(in.readInt());
case LONG:
return Long.valueOf(in.readLong());
case DATETIME:
return new DateTime(in.readLong(), DateTimeZone.forOffsetMillis(in.readShort() * ONE_MINUTE));
case FLOAT:
return Float.valueOf(in.readFloat());
case DOUBLE:
return Double.valueOf(in.readDouble());
case BIGINTEGER:
return readBigInteger(in);
case BIGDECIMAL:
return readBigDecimal(in);
case BOOLEAN_TRUE:
return Boolean.valueOf(true);
case BOOLEAN_FALSE:
return Boolean.valueOf(false);
case BYTE:
return Byte.valueOf(in.readByte());
case TINYBYTEARRAY:
case SMALLBYTEARRAY:
case BYTEARRAY:
return new DataByteArray(SedesHelper.readBytes(in, type));
case CHARARRAY:
case SMALLCHARARRAY:
return SedesHelper.readChararray(in, type);
case GENERIC_WRITABLECOMPARABLE:
return readWritable(in);
case SCHEMA_TUPLE_BYTE_INDEX:
case SCHEMA_TUPLE_SHORT_INDEX:
case SCHEMA_TUPLE:
return readSchemaTuple(in, type);
case NULL:
return null;
default:
throw new RuntimeException("Unexpected data type " + type + " found in stream.");
}
}