Attila Jeges has uploaded this change for review. ( http://gerrit.cloudera.org:8080/14852
Change subject: IMPALA-8706: ISO:SQL:2016 datetime patterns - Milestone 4 ...................................................................... IMPALA-8706: ISO:SQL:2016 datetime patterns - Milestone 4 This patch adds week-based date format tokens on top of what was introduced in IMPALA-8703, IMPALA-8704 and IMPALA-8705. Week-based date tokens may be used both for datetime to string and string to datetime conversion. The 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 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 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 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 week-numbering year. - IW: ISO 8601 week of year (1-52 or 1-53). Begins on the Monday closest to January 1 of the year. For string to datetime conversion, if the input week does not exist in the input year, an error will be thrown. - ID: ISO 8601 day of week (1-7). 1 means Monday and 7 means Sunday. When doing string to datetime conversion, the week-based tokens are meant to be used together and not mixed with other ISO SQL date tokens. The only exceptions are the day name tokens (DAY and Dy) which may be used instead of ID with the rest of the week-based date tokens. Change-Id: I89a8c1b98742391cb7b331840d216558dbca362b --- M be/src/exprs/date-functions-ir.cc M be/src/runtime/date-parse-util.cc M be/src/runtime/date-test.cc M be/src/runtime/date-value.cc M be/src/runtime/date-value.h M be/src/runtime/datetime-iso-sql-format-parser.cc M be/src/runtime/datetime-iso-sql-format-parser.h M be/src/runtime/datetime-iso-sql-format-tokenizer.cc M be/src/runtime/datetime-parser-common.cc M be/src/runtime/datetime-parser-common.h M be/src/runtime/timestamp-parse-util.cc M be/src/runtime/timestamp-parse-util.h M tests/query_test/test_cast_with_format.py 13 files changed, 849 insertions(+), 136 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/14852/1 -- To view, visit http://gerrit.cloudera.org:8080/14852 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I89a8c1b98742391cb7b331840d216558dbca362b Gerrit-Change-Number: 14852 Gerrit-PatchSet: 1 Gerrit-Owner: Attila Jeges <atti...@cloudera.com>