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

ASF subversion and git services commented on IMPALA-8705:
---------------------------------------------------------

Commit 590da59a3ce3337395487de8d91dceba1786e11b in impala's branch 
refs/heads/master from Attila Jeges
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=590da59 ]

IMPALA-8706: ISO:SQL:2016 datetime patterns - Milestone 4

This patch adds ISO 8601 week-based date format tokens on top
of what was introduced in IMPALA-8703, IMPALA-8704 and
IMPALA-8705.

The ISO 8601 week-based date tokens may be used for both datetime
to string and string to datetime conversion.

The ISO 8601 week-based date tokens are as follows:
  - IYYY: 4-digit ISO 8601 week-numbering year.
          Week-numbering year is the year relating to the ISO
          8601 week number (IW), which is the full week (Monday
          to Sunday) which contains January 4 of the Gregorian
          year.
          Behaves similarly to YYYY in that for datetime to
          string conversion, prefix digits for 1, 2, and 3-digit
          inputs are obtained from current ISO 8601
          week-numbering year.

  - IYY:  Last 3 digits of ISO 8601 week-numbering year.
          Behaves similarly to YYY in that for datetime to string
          conversion, prefix digit is obtained from current ISO
          8601 week-numbering year and can accept 1 or 2-digit
          input.

  - IY:   Last 2 digits of ISO 8601 week-numbering year.
          Behaves similarly to YY in that for datetime to string
          conversion, prefix digits are obtained from current ISO
          8601 week-numbering year and can accept 1-digit input.

  - I:    Last digit of ISO 8601 week-numbering year.
          Behaves similarly to Y in that for datetime to string
          conversion, prefix digits are obtained from current ISO
          8601 week-numbering year.

  - IW:   ISO 8601 week of year (1-53).
          Begins on the Monday closest to January 1 of the year.
          For string to datetime conversion, if the input ISO
          8601 week does not exist in the input year, an error
          will be thrown.

          Note that IW is different from the other week-related
          tokens WW and W (implemented in IMPALA-8705). With WW
          and W weeks start with the first day of the
          year/month. ISO 8601 weeks on the other hand always
          start with Monday.

  - ID:   ISO 8601 day of week (1-7). 1 means Monday and 7 means
          Sunday.

When doing string to datetime conversion, the ISO 8601 week-based
tokens are meant to be used together and not mixed with other ISO
SQL date tokens. E.g. 'YYYY-IW-ID' is an invalid format string.

The only exceptions are the day name tokens (DAY and DY) which
may be used instead of ID with the rest of the ISO 8601
week-based date tokens. E.g. 'IYYY-IW-DAY' is a valid format
string.

Change-Id: I89a8c1b98742391cb7b331840d216558dbca362b
Reviewed-on: http://gerrit.cloudera.org:8080/14852
Reviewed-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Gabor Kaszab <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> SQL:2016 datetime patterns - Milestone 3
> ----------------------------------------
>
>                 Key: IMPALA-8705
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8705
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Backend
>    Affects Versions: Impala 2.2.4
>            Reporter: Gabor Kaszab
>            Assignee: Gabor Kaszab
>            Priority: Major
>              Labels: ramp-up
>             Fix For: Impala 3.4.0
>
>
> Design doc for SQL:2016 datetime patterns:
> https://docs.google.com/document/d/1V7k6-lrPGW7_uhqM-FhKl3QsxwCRy69v2KIxPsGjc1k/
> Milestone 3 content:
> - Tokens for month name (MONTH, MON, Month etc.)
> - Day of week token (D)
> - Tokens for day name (DAY, DY, Day etc.)
> - Quarter of year token (Q)
> - Week of year token (WW)
> - Week of month token (W)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to