You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Alexander Pivovarov (JIRA)" <ji...@apache.org> on 2015/02/06 00:51:34 UTC

[jira] [Commented] (HIVE-9480) Build UDF TRUNC to implement FIRST_DAY as compared with LAST_DAY

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

Alexander Pivovarov commented on HIVE-9480:
-------------------------------------------

Can you also support YEAR fmt? Should be very small modification.

> Build UDF TRUNC to implement FIRST_DAY as compared with LAST_DAY
> ----------------------------------------------------------------
>
>                 Key: HIVE-9480
>                 URL: https://issues.apache.org/jira/browse/HIVE-9480
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.14.0
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>         Attachments: HIVE-9480.1.patch, HIVE-9480.3.patch, HIVE-9480.4.patch
>
>
> Hive already supports LAST_DAY UDF, in some cases, FIRST_DAY is necessary to do date/timestamp related computation. This JIRA is to track such an implementation. Choose to impl TRUNC, a more standard way to get the first day of a a month, e.g., SELECT TRUNC('2009-01-12', 'MM') FROM src LIMIT 1; will return 2009-01-01
> BTW, this TRUNC is not as feature complete as aligned with Oracle one. 'MM' is the only format supported, however, it's a base to add on other formats.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)