You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Zoltan Ivanfi (JIRA)" <ji...@apache.org> on 2019/01/11 15:02:00 UTC

[jira] [Updated] (IMPALA-8068) A day may belong to a different year than the week it is a part of

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

Zoltan Ivanfi updated IMPALA-8068:
----------------------------------
    Description: 
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.

  was:
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() and adding a warning to the documentation of the weekofyear() function about this problem.


> A day may belong to a different year than the week it is a part of
> ------------------------------------------------------------------
>
>                 Key: IMPALA-8068
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8068
>             Project: IMPALA
>          Issue Type: New Feature
>    Affects Versions: Impala 3.1.0
>            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)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org