[ 
https://issues.apache.org/jira/browse/HIVE-17230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16207557#comment-16207557
 ] 

Marta Kuczora commented on HIVE-17230:
--------------------------------------

Thanks a lot [~kgyrtkirk] for the investigation you did. You are right that the 
behavior of psql seems to be the most user friendly. However in this case we 
have to implement the same custom logic in BeeLine as in Hive CLI instead of 
just relaying on the string representation of the timestamps. This adds a bit 
more complexity and extra logic to the BeeLine code.
If we want the same timestamp format in both BeeLine and Hive CLI, we can 
either change the BeeLine behavior or the CLI behavior and I think both 
solutions have advantages and disadvantages.
Changing the behavior of the Hive CLI to display the timestamp like in BeeLine 
(with the trailing .0s) affects many q.out files.
Changing the behavior of BeeLine (remove the trailing 0s) is a smaller change 
but in return we have to maintain the same formatting logic as in Hive CLI.
[~aihuaxu], what are your thoughts about this? 

> Timestamp format different in HiveCLI and Beeline
> -------------------------------------------------
>
>                 Key: HIVE-17230
>                 URL: https://issues.apache.org/jira/browse/HIVE-17230
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline, CLI
>            Reporter: Peter Vary
>            Assignee: Marta Kuczora
>         Attachments: HIVE-17230.1.patch, HIVE-17230.2.patch, 
> HIVE-17230.3.patch
>
>
> The issue can be reproduced with the following commands:
> {code}
> create table timestamp_test(t timestamp);
> insert into table timestamp_test values('2000-01-01 01:00:00');
> select * from timestamp_test;
> {code}
> The timestamp is displayed without nanoseconds in HiveCLI:
> {code}
> 2000-01-01 01:00:00
> {code}
> When the exact same timestamp is displayed in BeeLine it displays:
> {code}
> 2000-01-01 01:00:00.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to