You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2022/01/28 04:18:48 UTC

[GitHub] [drill] cdmikechen commented on a change in pull request #2431: DRILL-8109: Hive storage plugin support reading parquet timestamp type with int64 logical type

cdmikechen commented on a change in pull request #2431:
URL: https://github.com/apache/drill/pull/2431#discussion_r794191769



##########
File path: contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/writers/primitive/HiveTimestampWriter.java
##########
@@ -33,10 +34,14 @@ public HiveTimestampWriter(PrimitiveObjectInspector inspector, TimeStampWriter w
 
   @Override
   public void write(Object value) {
-    String timestampString = PrimitiveObjectInspectorUtils.getString(value, inspector);
-    long timestampMillis = new DateTime(Timestamp.valueOf(timestampString).getTime())
-        .withZoneRetainFields(DateTimeZone.UTC).getMillis();
-    writer.writeTimeStamp(timestampMillis);
+    if (value instanceof LongWritable) {
+      writer.writeTimeStamp(((LongWritable) value).get() / 1000);

Review comment:
       @vdiravka 
   Thank you for your suggestion ~




-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org