case DataType.BIGDECIMAL:
return new NullableBigDecimalWritable((BigDecimal)o);
case DataType.DATETIME:
return new NullableDateTimeWritable((DateTime)o);
case DataType.TUPLE:
return new NullableTuple((Tuple)o);
case DataType.MAP: {
int errCode = 1068;
String msg = "Using Map as key not supported.";
throw new ExecException(msg, errCode, PigException.INPUT);
}
case DataType.NULL:
switch (keyType) {
case DataType.BAG:
NullableBag nbag = new NullableBag();
nbag.setNull(true);
return nbag;
case DataType.BOOLEAN:
NullableBooleanWritable nboolWrit = new NullableBooleanWritable();
nboolWrit.setNull(true);
return nboolWrit;
case DataType.BYTEARRAY:
NullableBytesWritable nBytesWrit = new NullableBytesWritable();
nBytesWrit.setNull(true);
return nBytesWrit;
case DataType.CHARARRAY:
NullableText nStringWrit = new NullableText();
nStringWrit.setNull(true);
return nStringWrit;
case DataType.DOUBLE:
NullableDoubleWritable nDoubleWrit = new NullableDoubleWritable();
nDoubleWrit.setNull(true);
return nDoubleWrit;
case DataType.FLOAT:
NullableFloatWritable nFloatWrit = new NullableFloatWritable();
nFloatWrit.setNull(true);
return nFloatWrit;
case DataType.INTEGER:
NullableIntWritable nIntWrit = new NullableIntWritable();
nIntWrit.setNull(true);
return nIntWrit;
case DataType.BIGINTEGER:
NullableBigIntegerWritable nBigIntWrit = new NullableBigIntegerWritable();
nBigIntWrit.setNull(true);
return nBigIntWrit;
case DataType.BIGDECIMAL:
NullableBigDecimalWritable nBigDecWrit = new NullableBigDecimalWritable();
nBigDecWrit.setNull(true);
return nBigDecWrit;
case DataType.LONG:
NullableLongWritable nLongWrit = new NullableLongWritable();
nLongWrit.setNull(true);
return nLongWrit;
case DataType.DATETIME:
NullableDateTimeWritable nDateTimeWrit = new NullableDateTimeWritable();
nDateTimeWrit.setNull(true);
return nDateTimeWrit;
case DataType.TUPLE:
NullableTuple ntuple = new NullableTuple();
ntuple.setNull(true);
return ntuple;