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

Mani M commented on HIVE-21117:
-------------------------------

HI 

My view is to write these ISO related methods in the different classes 
seperately in ISO package.

If we're planning to adapt the ISO standard, then it's to revisit all the UDF 
date related classes which is available in this package

[https://github.com/apache/hive/tree/master/ql/src/java/org/apache/hadoop/hive/ql/udf]

 

> A day may belong to a different year than the week it is a part of
> ------------------------------------------------------------------
>
>                 Key: HIVE-21117
>                 URL: https://issues.apache.org/jira/browse/HIVE-21117
>             Project: Hive
>          Issue Type: New Feature
>    Affects Versions: 2.3.4
>            Reporter: Zoltan Ivanfi
>            Priority: Major
>
> When using the year() and weekofyear() functions in a query, their result is 
> 2018 and 1 (respectively) for the day '2018-12-31'.
> The year() function returns 2018 for the input '2018-12-31', because that day 
> belongs to the year 2018.
> The weekofyear() functions returns 1 for the input '2018-12-31', because that 
> day belongs to the first week of 2019.
> Both functions provide sensible results on their own, but when combined, the 
> result is wrong, because '2018-12-31' does not belong to week 1 of 2018.
> I suggest adding a new function yearofweek() that would return 2019 for the 
> input '2018-12-31' and adding a warning to the documentation of the 
> weekofyear() function about this problem.



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

Reply via email to