vvysotskyi commented on a change in pull request #2038: DRILL-6604: Upgrade Drill Hive client to Hive3.1 version URL: https://github.com/apache/drill/pull/2038#discussion_r399163018
########## File path: contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/writers/primitive/HiveDateWriter.java ########## @@ -18,21 +18,23 @@ package org.apache.drill.exec.store.hive.writers.primitive; import org.apache.drill.exec.vector.complex.writer.DateWriter; -import org.apache.hadoop.hive.serde2.objectinspector.primitive.DateObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; -public class HiveDateWriter extends AbstractSingleValueWriter<DateObjectInspector, DateWriter> { +public class HiveDateWriter extends AbstractSingleValueWriter<PrimitiveObjectInspector, DateWriter> { - public HiveDateWriter(DateObjectInspector inspector, DateWriter writer) { + public HiveDateWriter(PrimitiveObjectInspector inspector, DateWriter writer) { super(inspector, writer); } @Override public void write(Object value) { - final java.sql.Date dateValue = inspector.getPrimitiveJavaObject(value); - final DateTime date = new DateTime(dateValue.getTime()).withZoneRetainFields(DateTimeZone.UTC); - writer.writeDate(date.getMillis()); + String dateString = PrimitiveObjectInspectorUtils.getString(value, inspector); + long time = new DateTime(java.sql.Date.valueOf(dateString).getTime()) Review comment: Thanks, fixed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services