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

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

last_day is popular function in BI reporting. to get end of period for example
People often ask about this function
http://stackoverflow.com/questions/17548584/find-last-day-of-a-month-in-hive

http://stackoverflow.com/questions/16277504/what-is-the-equivalent-of-oracles-last-day-function-in-sql-server-2008

technucally it's possible to do last_day formula in hive now but better to have 
last_day function
{code}
select date_sub(concat(substr(date_add('2014-01-14', 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)

Reply via email to