[ 
https://issues.apache.org/jira/browse/HIVE-22224?focusedWorklogId=362841&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-362841
 ]

ASF GitHub Bot logged work on HIVE-22224:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Dec/19 01:44
            Start Date: 24/Dec/19 01:44
    Worklog Time Spent: 10m 
      Work Description: cdmikechen commented on pull request #871: HIVE-22224: 
Support Parquet-Avro Timestamp Type in Hive2
URL: https://github.com/apache/hive/pull/871
 
 
   Parquet-avro 1.8.2 use Avro 1.8 which support avro logical_type, but hive 
use avro 1.7. So that hive just use primitive types to read avro. In avro 1.8, 
decimal can be transformed to fix, and date can transformed to int 
(logical_type= date), hive can read these two type with primitive types fix and 
int. But timestamp will be transformed to long (logical_type=timestamp-micros).
   If user create a table with column timestamp, hive will report error that 
long can not cast to timestamp. So I create a PR to let hive can read long as 
timestamp.
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 362841)
    Remaining Estimate: 0h
            Time Spent: 10m

> Support Parquet-Avro Timestamp Type
> -----------------------------------
>
>                 Key: HIVE-22224
>                 URL: https://issues.apache.org/jira/browse/HIVE-22224
>             Project: Hive
>          Issue Type: Bug
>          Components: Database/Schema
>    Affects Versions: 2.3.5, 2.3.6
>            Reporter: cdmikechen
>            Assignee: cdmikechen
>            Priority: Major
>              Labels: parquet, pull-request-available
>             Fix For: 2.3.7
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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();
> }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to