GitHub user setjet opened a pull request:

    https://github.com/apache/spark/pull/18080

    [Spark-20771][SQL] Make weekofyear more intuitive

    ## What changes were proposed in this pull request?
    The current implementation of weekofyear implements ISO8601, which results 
in the following unintuitive behaviour: 
    
    weekofyear("2017-01-01") returns 52 
    
    In MySQL, this would return 1 
(https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_weekofyear),
 although it could return 52 if specified specifically 
(https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_week).
    
    I therefore think instead of only changing the behavior as specified in the 
JIRA, it would be better to support both. Hence  I've added an additional 
function.
    
    ## How was this patch tested?
    Added some unit tests
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/setjet/spark SPARK-20771

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18080.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18080
    
----
commit 7235f4a731f83a3a81fd65846179efaf38354bfa
Author: setjet <rubenljans...@gmail.com>
Date:   2017-05-24T00:20:30Z

    added additional weekofyear function

commit 057ede5b68cc7980987ae181156f376f84c41809
Author: setjet <rubenljans...@gmail.com>
Date:   2017-05-24T00:22:54Z

    updated desc

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to