You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Wilson Lu (JIRA)" <ji...@apache.org> on 2019/01/02 20:24:00 UTC

[jira] [Updated] (HIVE-21081) DATE_FORMAT incorrectly returns results on the last week of the calendar year

     [ https://issues.apache.org/jira/browse/HIVE-21081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wilson Lu updated HIVE-21081:
-----------------------------
    Description: 
The Hive DATE_FORMAT does not perform the correct operation on the last week of the calendar year. The following statements incorrectly formats the data:

select DATE_FORMAT('2017-12-31', 'YYYYMM')
select DATE_FORMAT('2018-12-30', 'YYYYMM')
 select DATE_FORMAT('2018-12-31', 'YYYYMM')
select DATE_FORMAT('2019-12-29', 'YYYYMM')
 select DATE_FORMAT('2019-12-30', 'YYYYMM')
 select DATE_FORMAT('2019-12-31', 'YYYYMM')

select DATE_FORMAT( '2019-12-29', 'YYYYMMdd') 

 

  was:
The hive DATE_FORMAT does not perform the correct operation on the last week of the calendar year. The following statements incorrectly formats the data:

select DATE_FORMAT('2017-12-31', 'YYYYMM')

select DATE_FORMAT('2018-12-30', 'YYYYMM')
select DATE_FORMAT('2018-12-31', 'YYYYMM')

select DATE_FORMAT('2019-12-29', 'YYYYMM')
select DATE_FORMAT('2019-12-30', 'YYYYMM')
select DATE_FORMAT('2019-12-31', 'YYYYMM')

 

 


> DATE_FORMAT incorrectly returns results on the last week of the calendar year
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-21081
>                 URL: https://issues.apache.org/jira/browse/HIVE-21081
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 2.1.1, 2.3.2, 2.3.3
>            Reporter: Wilson Lu
>            Priority: Minor
>
> The Hive DATE_FORMAT does not perform the correct operation on the last week of the calendar year. The following statements incorrectly formats the data:
> select DATE_FORMAT('2017-12-31', 'YYYYMM')
> select DATE_FORMAT('2018-12-30', 'YYYYMM')
>  select DATE_FORMAT('2018-12-31', 'YYYYMM')
> select DATE_FORMAT('2019-12-29', 'YYYYMM')
>  select DATE_FORMAT('2019-12-30', 'YYYYMM')
>  select DATE_FORMAT('2019-12-31', 'YYYYMM')
> select DATE_FORMAT( '2019-12-29', 'YYYYMMdd') 
>  



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