[
https://issues.apache.org/jira/browse/HIVE-20375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16610245#comment-16610245
]
Zoltan Haindrich edited comment on HIVE-20375 at 9/11/18 8:10 AM:
------------------------------------------------------------------
I think this is serde dependent...because right now there are 2 JsonSerde
classes:
{code}
org/apache/hive/hcatalog/data/JsonSerDe.java
org/apache/hadoop/hive/serde2/JsonSerDe.java
{code}
the old is the one in hcatalog...and that should take the timestamp formats
into account
[here|https://github.com/apache/hive/blob/1105ef3974d8a324637d3d35881a739af3aeb382/serde/src/java/org/apache/hadoop/hive/serde2/json/HiveJsonStructReader.java#L356]
the new serde uses writeables during operation
was (Author: kgyrtkirk):
I think this is serde dependent...because right now there are 2 JsonSerde
classes:
{code}
org/apache/hive/hcatalog/data/JsonSerDe.java
org/apache/hadoop/hive/serde2/JsonSerDe.java
{code}
the old is the one in hcatalog...and that should take the timestamp formats
into account
the new serde uses writeables during operation
> Json SerDe ignoring the timestamp.formats property
> --------------------------------------------------
>
> Key: HIVE-20375
> URL: https://issues.apache.org/jira/browse/HIVE-20375
> Project: Hive
> Issue Type: Bug
> Affects Versions: 4.0.0
> Reporter: slim bouguerra
> Assignee: Ashutosh Chauhan
> Priority: Major
>
> JsonSerd is supposed to accept "timestamp.formats" SerDe property to allow
> different timestamp formats, after recent refactor I see that this is not
> working anymore.
> Looking at the code I can see that The serde is not using the constructed
> parser with added format
> https://github.com/apache/hive/blob/1105ef3974d8a324637d3d35881a739af3aeb382/serde/src/java/org/apache/hadoop/hive/serde2/json/HiveJsonStructReader.java#L82
> But instead it is using Converter
> https://github.com/apache/hive/blob/1105ef3974d8a324637d3d35881a739af3aeb382/serde/src/java/org/apache/hadoop/hive/serde2/json/HiveJsonStructReader.java#L324
> Then converter is using
> org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorConverter.TimestampConverter
> This converter does not have any knowledge about user formats or what so
> ever...
> It is using this static converter
> org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils#getTimestampFromString
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)