Search in sources :

Example 16 with TimestampLocalTZTypeInfo

use of org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo in project hive by apache.

the class WritableTimestampLocalTZObjectInspector method getPrimitiveJavaObject.

@Override
public TimestampTZ getPrimitiveJavaObject(Object o) {
    if (o == null) {
        return null;
    }
    TimestampLocalTZWritable t = (TimestampLocalTZWritable) o;
    TimestampLocalTZTypeInfo timestampTZTypeInfo = (TimestampLocalTZTypeInfo) typeInfo;
    if (!t.getTimestampTZ().getZonedDateTime().getZone().equals(timestampTZTypeInfo.timeZone())) {
        t.setTimeZone(timestampTZTypeInfo.timeZone());
    }
    return t.getTimestampTZ();
}
Also used : TimestampLocalTZWritable(org.apache.hadoop.hive.serde2.io.TimestampLocalTZWritable) TimestampLocalTZTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo)

Example 17 with TimestampLocalTZTypeInfo

use of org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo in project hive by apache.

the class WritableTimestampLocalTZObjectInspector method getPrimitiveWritableObject.

@Override
public TimestampLocalTZWritable getPrimitiveWritableObject(Object o) {
    if (o == null) {
        return null;
    }
    TimestampLocalTZWritable t = (TimestampLocalTZWritable) o;
    TimestampLocalTZTypeInfo timestampTZTypeInfo = (TimestampLocalTZTypeInfo) typeInfo;
    if (!t.getTimestampTZ().getZonedDateTime().getZone().equals(timestampTZTypeInfo.timeZone())) {
        t.setTimeZone(timestampTZTypeInfo.timeZone());
    }
    return t;
}
Also used : TimestampLocalTZWritable(org.apache.hadoop.hive.serde2.io.TimestampLocalTZWritable) TimestampLocalTZTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo)

Example 18 with TimestampLocalTZTypeInfo

use of org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo in project hive by apache.

the class LazyTimestampLocalTZObjectInspector method getPrimitiveJavaObject.

@Override
public TimestampTZ getPrimitiveJavaObject(Object o) {
    if (o == null) {
        return null;
    }
    TimestampTZ t = ((LazyTimestampLocalTZ) o).getWritableObject().getTimestampTZ();
    TimestampLocalTZTypeInfo timestampTZTypeInfo = (TimestampLocalTZTypeInfo) typeInfo;
    if (!t.getZonedDateTime().getZone().equals(timestampTZTypeInfo.timeZone())) {
        t.setZonedDateTime(t.getZonedDateTime().withZoneSameInstant(timestampTZTypeInfo.timeZone()));
    }
    return t;
}
Also used : TimestampTZ(org.apache.hadoop.hive.common.type.TimestampTZ) TimestampLocalTZTypeInfo(org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo)

Aggregations

TimestampLocalTZTypeInfo (org.apache.hadoop.hive.serde2.typeinfo.TimestampLocalTZTypeInfo)16 TimestampLocalTZWritable (org.apache.hadoop.hive.serde2.io.TimestampLocalTZWritable)8 TimestampTZ (org.apache.hadoop.hive.common.type.TimestampTZ)6 SerDeException (org.apache.hadoop.hive.serde2.SerDeException)5 PrimitiveTypeInfo (org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo)4 HiveChar (org.apache.hadoop.hive.common.type.HiveChar)3 HiveVarchar (org.apache.hadoop.hive.common.type.HiveVarchar)3 ByteWritable (org.apache.hadoop.hive.serde2.io.ByteWritable)3 DoubleWritable (org.apache.hadoop.hive.serde2.io.DoubleWritable)3 HiveCharWritable (org.apache.hadoop.hive.serde2.io.HiveCharWritable)3 HiveDecimalWritable (org.apache.hadoop.hive.serde2.io.HiveDecimalWritable)3 HiveVarcharWritable (org.apache.hadoop.hive.serde2.io.HiveVarcharWritable)3 ShortWritable (org.apache.hadoop.hive.serde2.io.ShortWritable)3 DecimalTypeInfo (org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo)3 BooleanWritable (org.apache.hadoop.io.BooleanWritable)3 FloatWritable (org.apache.hadoop.io.FloatWritable)3 IntWritable (org.apache.hadoop.io.IntWritable)3 LongWritable (org.apache.hadoop.io.LongWritable)3 Text (org.apache.hadoop.io.Text)3 ArrayList (java.util.ArrayList)2