hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-9358) Create LAST_DAY UDF
Date Thu, 15 Jan 2015 05:04:35 GMT

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

Alexander Pivovarov commented on HIVE-9358:
-------------------------------------------

formula correction
{code}
select date_sub(concat(substr(date_add(concat(substr('2014-01-30',1,7), '-01'), 32),1,7),
'-01'), 1)
2014-01-31
{code}

> Create LAST_DAY UDF
> -------------------
>
>                 Key: HIVE-9358
>                 URL: https://issues.apache.org/jira/browse/HIVE-9358
>             Project: Hive
>          Issue Type: Improvement
>          Components: UDF
>            Reporter: Alexander Pivovarov
>            Assignee: Alexander Pivovarov
>         Attachments: HIVE-9358.1.patch
>
>
> LAST_DAY returns the date of the last day of the month that contains date:
> last_day('2015-01-14') = '2015-01-31'
> last_day('2016-02-01') = '2016-02-29'
> last_day function went from oracle  http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions072.htm



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

Mime
View raw message