You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Tianyi Wang (JIRA)" <ji...@apache.org> on 2017/08/03 17:01:00 UTC

[jira] [Resolved] (IMPALA-3894) unix_timestamp date conversion for 2-digit years is broken

     [ https://issues.apache.org/jira/browse/IMPALA-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tianyi Wang resolved IMPALA-3894.
---------------------------------
    Resolution: Fixed

Fixed in https://gerrit.cloudera.org/#/c/7530/

> unix_timestamp date conversion for 2-digit years is broken
> ----------------------------------------------------------
>
>                 Key: IMPALA-3894
>                 URL: https://issues.apache.org/jira/browse/IMPALA-3894
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.5.0
>            Reporter: Adriano Simone
>            Assignee: Tianyi Wang
>              Labels: ramp-up
>
> The unix_timestamp conversion where the year is in 2-digit format return values that differ from the Hive's result:
> select from_unixtime(unix_timestamp('31-AUG-94', 'dd-MMM-yy'),'yyyyMMdd'); 
> Impala Result: 20940831 
> Hive Result: 19940831 
> If the 2-digit year is equal to '99' Impala will return a NULL value.
> Logic:
> if (tok_len < 4 && dt_result->year < 99) dt_result->year += 2000;
> -timestamp-parse-util.h#L466-
> Improvement to evaluate:
> * Include the year '99' in the condition because it can lead to undesidered impala behaviour
> * The impala's unix_timestamp conversion will return the same value as Hive:
> * It can be interesting to implement a kind of parameter (i.e.: 'Century Break' as in other reality) that allow to choice arbitrarily which century to be added in such conversion (considering that in some cases the automated software logic cannot match all the users expectations).



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