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();
}
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;
}
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;
}
Aggregations