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

Sukumaar Mane commented on HIVE-21287:
--------------------------------------

like this?

{code:sql}
hive> SELECT  date_format('2020-01-1','YYYY/w') as day1;
OK
2020/1
{code}


> 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