Attila Jeges has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/9508


Change subject: IMPALA-6606: date_trunc() misinterprets MILLENNIUM/CENTURY 
precision
......................................................................

IMPALA-6606: date_trunc() misinterprets MILLENNIUM/CENTURY precision

This change fixes the following correctness bug: date_trunc() function
returns the wrong result when truncating a TIMESTAMP value to
'MILLENNIUM' precision. E.g.:

select now(), date_trunc('millennium', now());
+-------------------------------+---------------------------------+
| now()                         | date_trunc('millennium', now()) |
+-------------------------------+---------------------------------+
| 2017-12-05 14:00:30.296812000 | 2000-01-01 00:00:00             |
+-------------------------------+---------------------------------+

The first year of the current millennium should be 2001.

'CENTURY' precision has the same issue.

Change-Id: I4f4aac17875dbf17dcabff25473ffeb006fce20b
---
M be/src/exprs/expr-test.cc
M be/src/exprs/udf-builtins.cc
2 files changed, 48 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/08/9508/1
--
To view, visit http://gerrit.cloudera.org:8080/9508
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f4aac17875dbf17dcabff25473ffeb006fce20b
Gerrit-Change-Number: 9508
Gerrit-PatchSet: 1
Gerrit-Owner: Attila Jeges <atti...@cloudera.com>

Reply via email to