You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Rahul Challapalli (JIRA)" <ji...@apache.org> on 2015/06/12 20:09:00 UTC

[jira] [Commented] (DRILL-3284) Document incompatibility between drill's to_date and hive's unix_timestamp

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

Rahul Challapalli commented on DRILL-3284:
------------------------------------------

[~mehant] Can you confirm that it is not a bug?

> Document incompatibility between drill's to_date and hive's unix_timestamp
> --------------------------------------------------------------------------
>
>                 Key: DRILL-3284
>                 URL: https://issues.apache.org/jira/browse/DRILL-3284
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Documentation, Functions - Hive
>            Reporter: Rahul Challapalli
>            Assignee: Bridget Bevens
>
> The below query from drill produces wrong results because unix_timestamp (function from hive) returns the value in seconds while to_date treats its input in milliseconds.
> {code}
> select to_date(unix_timestamp('1998-05-06', 'yyyy-MM-dd')) from dummy limit 1;
> +-------------+
> |   EXPR$0    |
> +-------------+
> | 1970-01-11  |
> +-------------+
> {code} 
> In order to make this work we should use the below query
> {code}
> select to_date(unix_timestamp('1998-05-06', 'yyyy-MM-dd')*1000) from dummy limit 1;
> +-------------+
> |   EXPR$0    |
> +-------------+
> | 1998-05-06  |
> +-------------+
> {code}
> If this is not a bug on drill's side, we should atleast document this 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)