use of org.apache.parquet.io.api.PrimitiveConverter in project hive by apache.
the class TestETypeConverter method testTimestampInt96ConverterChicago.
@Test
public void testTimestampInt96ConverterChicago() {
PrimitiveConverter converter;
parent.metadata.put(ParquetTableUtils.PARQUET_INT96_WRITE_ZONE_PROPERTY, "America/Chicago");
converter = getETypeConverter(parent, PrimitiveTypeName.INT96, TypeInfoFactory.timestampTypeInfo);
converter.addBinary(NanoTimeUtils.getNanoTime(ts, Calendar.getInstance(TimeZone.getTimeZone("America/Chicago"))).toBinary());
parent.assertWritableValue(new TimestampWritable(ts));
}
use of org.apache.parquet.io.api.PrimitiveConverter in project hive by apache.
the class TestETypeConverter method testTimestampInt96ConverterEtc.
@Test
public void testTimestampInt96ConverterEtc() {
PrimitiveConverter converter;
parent.metadata.put(ParquetTableUtils.PARQUET_INT96_WRITE_ZONE_PROPERTY, "Etc/GMT-12");
converter = getETypeConverter(parent, PrimitiveTypeName.INT96, TypeInfoFactory.timestampTypeInfo);
converter.addBinary(NanoTimeUtils.getNanoTime(ts, Calendar.getInstance(TimeZone.getTimeZone("Etc/GMT-12"))).toBinary());
parent.assertWritableValue(new TimestampWritable(ts));
}
use of org.apache.parquet.io.api.PrimitiveConverter in project hive by apache.
the class TestETypeConverter method testTimestampInt96ConverterGMT.
@Test
public void testTimestampInt96ConverterGMT() {
PrimitiveConverter converter;
parent.metadata.put(ParquetTableUtils.PARQUET_INT96_WRITE_ZONE_PROPERTY, "GMT");
converter = getETypeConverter(parent, PrimitiveTypeName.INT96, TypeInfoFactory.timestampTypeInfo);
converter.addBinary(NanoTimeUtils.getNanoTime(ts, Calendar.getInstance(TimeZone.getTimeZone("GMT"))).toBinary());
parent.assertWritableValue(new TimestampWritable(ts));
}
use of org.apache.parquet.io.api.PrimitiveConverter in project hive by apache.
the class TestETypeConverter method testTimestampInt96ConverterLocal.
@Test
public void testTimestampInt96ConverterLocal() {
PrimitiveConverter converter;
// Default timezone should be Localtime
converter = getETypeConverter(parent, PrimitiveTypeName.INT96, TypeInfoFactory.timestampTypeInfo);
converter.addBinary(NanoTimeUtils.getNanoTime(ts, Calendar.getInstance()).toBinary());
parent.assertWritableValue(new TimestampWritable(ts));
}
Aggregations