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

Gopal V commented on HIVE-21287:
--------------------------------

date_format() is a pass-through function for java's DateFormat implementation.

Can you confirm if it does the right thing for "YYYY/w"?

> date_format() for week of year issue for weeks that overlap between two years
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-21287
>                 URL: https://issues.apache.org/jira/browse/HIVE-21287
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Sukumaar Mane
>            Priority: Minor
>
> date_format() provides 'week of year' as 1 for the first week of the year as 
> well as last week of last year if it is overlapping. In an ideal situate, 
> date_format() should check whether current date string has last month if it 
> is so then it should return last week ordinal.
> example: In current hive,it returns
> {code:sql}
> hive> SELECT  date_format('2019-12-31','w') as day1  ;
> OK
> 1
> hive> SELECT  date_format('2020-01-1','w') as day1  ;
> OK
> 1
> Time taken: 0.208 seconds, Fetched: 1 row(s)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to