You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/10/12 09:35:04 UTC

[GitHub] [hudi] xiarixiaoyao commented on pull request #3391: [HUDI-83] Fix Timestamp/Date type read by Hive3

xiarixiaoyao commented on PR #3391:
URL: https://github.com/apache/hudi/pull/3391#issuecomment-1275873422

   @cdmikechen 
   thanks for your effort, 
   first of all, i agree with your modification, so i give approve for this pr.
   
   
   our product env is hive3, we solve this problem by modfiy HoodieRealtimeRecordReaderUtils.avroToArrayWritable
   ```
         case LONG:
           if (supportTimestamp
               && schema.getLogicalType() != null
               && schema.getLogicalType().getName().equals("timestamp-micros")) {
             // TODO: Here we use hive interface to transform long to timestamp with local timezone.
             // Notice that hive support UTC and local timezone, but here we only support local
             // timezone.
             Timestamp timestamp = ParquetTimestampUtils.getTimestamp((Long) value, LogicalTypeAnnotation.TimeUnit.MICROS, true);
             return new TimestampWritableV2(timestamp);
           }
           return new LongWritable((Long) value);
   ```
   
   
   


-- 
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: commits-unsubscribe@hudi.apache.org

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