Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22224

Support Parquet-Avro Timestamp Type

    XMLWordPrintableJSON

    Details

      Description

      When user create an external table and import a parquet-avro data with 1.8.2 version which supported logical_type in Hive2.3 or before version, Hive can not read timestamp type column data correctly.

      Hive will read it as LongWritable which it actually stores as long(logical_type=timestamp-millis).So we may add some codes in org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableTimestampObjectInspector.java to let Hive cast long type to timestamp type.

      Some code like below:

       

      public Timestamp getPrimitiveJavaObject(Object o) {
        if (o instanceof LongWritable) 

      {     return new Timestamp(((LongWritable) o).get());   }

        return o == null ? null : ((TimestampWritable) o).getTimestamp();
      }

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chenxiang cdmikechen
                Reporter:
                chenxiang cdmikechen
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h