You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/14 18:30:42 UTC

[GitHub] [spark] MaxGekk opened a new pull request #25153: [SPARK-28389][SQL] Use Java 8 API in add_months

MaxGekk opened a new pull request #25153: [SPARK-28389][SQL] Use Java 8 API in add_months
URL: https://github.com/apache/spark/pull/25153
 
 
   ## What changes were proposed in this pull request?
   
   In the PR, I propose to use the `plusMonths()` method of `LocalDate` to add months to a date. This method adds the specified amount to the months field of `LocalDate` in three steps:
   1. Add the input months to the month-of-year field
   2. Check if the resulting date would be invalid
   3. Adjust the day-of-month to the last valid day if necessary
   
   The difference between current behavior and propose one is in handling the last day of month in the original date. For example, adding 1 month to `2019-02-28` will produce `2019-03-28` comparing to the current implementation where the result is `2019-03-31`.
   
   The proposed behavior is implemented in MySQL and PostgreSQL.
   
   ## How was this patch tested?
   
   By existing test suites `DateExpressionsSuite`, `DateFunctionsSuite` and `DateTimeUtilsSuite`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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