You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Alex Rodoni (JIRA)" <ji...@apache.org> on 2018/05/01 21:24:00 UTC

[jira] [Updated] (IMPALA-2732) Can't parse custom date formats with non-zero-padded values

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

Alex Rodoni updated IMPALA-2732:
--------------------------------
    Docs Text:   (was: We should evaluate whether we want to update the documentation to reflect this change in behavior. Given the original bug report we could also assume that the fix actually restores the expected behavior.)

> Can't parse custom date formats with non-zero-padded values
> -----------------------------------------------------------
>
>                 Key: IMPALA-2732
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2732
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.2.1, Impala 2.3.0
>         Environment: CDH 5.4.7
>            Reporter: Egmont Koblinger
>            Assignee: Lars Volker
>            Priority: Critical
>              Labels: correctness, ramp-up
>             Fix For: Impala 2.5.0, Impala 2.3.4
>
>
> In the spirit of IMPALA-114 I'd expect parsing custom date formats with non-zero-padded values (such as "12/2/2015" for today) to be a piece of cake.
> However, it's not the case.
> select unix_timestamp('12/2/2015', 'MM/d/yyyy') => okay
> select unix_timestamp('12/2/2015', 'MM/dd/yyyy') => NULL
> select unix_timestamp('12/31/2015', 'MM/d/yyyy') => NULL
> select unix_timestamp('12/31/2015', 'MM/dd/yyyy') => okay
> That is, parsing a non-zero-padded value requires that in format string you specify exactly whether the number happens to consist of 1 or 2 digits.
> This makes this feature unusable for non-zero-padded values.
> Please make the single-letter "M" or "d" accept both 1-digit and 2-digit values.
> (Changing the two-letter "MM" or "dd" to behave this way could be a bad idea, as it might break existing behavior when there's no separator between the fields, e.g. yyyyMMdd. However you can't have varying width without separator, so extending the behavior of the single-letter "M" and "d" should be harmless.)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org