You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Ferdinand Xu (JIRA)" <ji...@apache.org> on 2014/09/02 09:10:21 UTC
[jira] [Commented] (HIVE-6930) Beeline should nicely format
timestamps when displaying results
[ https://issues.apache.org/jira/browse/HIVE-6930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117968#comment-14117968 ]
Ferdinand Xu commented on HIVE-6930:
------------------------------------
It works fine for me by using load command from the beeline side. Gwen, can you tell me the detail information about your reproducing steps? Thanks!
Data:
[root@hostname workspace]# more timedata
buy,1977-03-12 06:30:23
sell,1989-05-23 07:23:12
creating table statement:
create table mytime(id string ,t timestamp) row format delimited fields terminated by ',';
And loading data statement:
load data local inpath '/root/workspace/timedata' overwrite into table mytime;
Table structure:
describe mytime;
+-----------+------------+----------+--+
| col_name | data_type | comment |
+-----------+------------+----------+--+
| id | string | |
| t | timestamp | |
+-----------+------------+----------+--+
result of querying:
select * from mytime;
+------------+------------------------+--+
| mytime.id | mytime.t |
+------------+------------------------+--+
| buy | 1977-03-12 06:30:23.0 |
| sell | 1989-05-23 07:23:12.0 |
+------------+------------------------+--+
> Beeline should nicely format timestamps when displaying results
> ---------------------------------------------------------------
>
> Key: HIVE-6930
> URL: https://issues.apache.org/jira/browse/HIVE-6930
> Project: Hive
> Issue Type: Improvement
> Components: CLI
> Affects Versions: 0.12.0
> Reporter: Gwen Shapira
> Assignee: Ferdinand Xu
>
> When I have a timestamp column in my query, I get the results back as the bigint with number of seconds since epoch. Not very user friendly or readable.
> This means that all my queries need to include stuff like:
> select from_unixtime(cast(round(transaction_ts/1000) as bigint))...
> which is not too readable either :)
> Other SQL query tools automatically convert timestamps to some standard readable date format. They even let users specify the default formatting by setting a parameter (for example NLS_DATE_FORMAT for Oracle).
> I'd love to see something like that in beeline.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)