On 11/03/2015 12:35 AM, Manisha Sethi wrote:
Hi
I am trying to write timestamp using int64 (TIMESTAMP_MILLIS) via ParquetWriter
using jar hive-exec 1.2.1... But getting unsopprted exception...
Issue is : when call reaches "add binary"
break;
case BINARY:
byte[] vBinary = ((BinaryObjectInspector)
inspector).getPrimitiveJavaObject(value);
recordConsumer.addBinary(Binary.fromByteArray(vBinary));
break;
case TIMESTAMP:
Timestamp ts = ((TimestampObjectInspector)
inspector).getPrimitiveJavaObject(value);
recordConsumer.addBinary(NanoTimeUtils.getNanoTime(ts,
false).toBinary());
break;
case DECIMAL:
HiveDecimal vDecimal =
((HiveDecimal)inspector.getPrimitiveJavaObject(value));
DecimalTypeInfo decTypeInfo = (DecimalTypeInfo)inspector.getTypeInfo();
recordConsumer.addBinary(decimalToBinary(vDecimal, decTypeInfo));
break;
Then in Columnwriter it fails at updatestatistics, since call is made using
longstatistic(corrs to its int64 data type but value is binary which is not
defined)
this.repetitionLevelColumn.writeInteger(repetitionLevel);
/* 203 */ this.definitionLevelColumn.writeInteger(definitionLevel);
/* 204 */ this.dataColumn.writeBytes(value);
/* 205 */ updateStatistics(value);
this.statistics.updateStats(value);====>>>> Method is not defined for
LongStatistics, hence throws unsupported exception
________________________________
Manisha,
Thanks for taking the time to e-mail about this. How are you writing
this timestamp? Are you using Hive, or are you trying to use Hive's
object model in your own code?
Could you also send the stack trace that you're seeing? I'm confused
about why the method would be undefined, since it should be defined for
the types correctly.
Thanks,
rb
--
Ryan Blue
Software Engineer
Cloudera, Inc.