You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "sandeep akinapelli (JIRA)" <ji...@apache.org> on 2017/09/07 05:38:00 UTC

[jira] [Resolved] (IMPALA-5317) add DATE_TRUNC() function

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

sandeep akinapelli resolved IMPALA-5317.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.11.0


IMPALA-5317: add DATE_TRUNC() function

Added a UDF builtin function date_trunc.
Reuse many of the Trunc functions implemented already for trunc() including
truncate unit and except strToTruncUnit
Added checks to ensure that truncation results that fall outside of
posix timestamp range are returned as NULL.
Added ctest for the date_trunc function.

Change-Id: I953ba006cbb166dcc78e8c0c12dfbf70f093b584
Reviewed-on: http://gerrit.cloudera.org:8080/7313
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins

> add DATE_TRUNC() function
> -------------------------
>
>                 Key: IMPALA-5317
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5317
>             Project: IMPALA
>          Issue Type: New Feature
>          Components: Frontend
>            Reporter: Greg Rahn
>            Assignee: sandeep akinapelli
>              Labels: built-in-function, newbie, sql-language
>             Fix For: Impala 2.11.0
>
>
> date_trunc('field', timestamp)	timestamp 
> Valid values for field are:
> * nanoseconds
> * microseconds
> * milliseconds
> * second
> * minute
> * hour
> * day
> * week
> * month
> * quarter
> * year
> * decade
> * century
> * millennium
> References:
> * https://my.vertica.com/docs/8.1.x/HTML/index.htm#Authoring/SQLReferenceManual/Functions/Date-Time/DATE_TRUNC.htm
> * https://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC



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