TJX2014 opened a new pull request #28926:
URL: https://github.com/apache/spark/pull/28926


   ### What changes were proposed in this pull request?
   Add a unit test.
   Bug fix in 
`org.apache.spark.sql.catalyst.expressions.Sequence.TemporalSequenceImpl`
   Add `sequence step must be a day interval if start and end values are dates` 
constraint.
   Follow: [https://github.com/apache/spark/pull/28856](url)
   
   ### Why are the changes needed?
   Spark sequence doesn't handle date increments that cross DST
   
   ### Does this PR introduce _any_ user-facing change?
   Before the PR, people will not get a correct result:
   `set spark.sql.session.timeZone` to `Asia/Shanghai, America/Chicago, GMT`, 
   Before execute 
   `sql("select sequence(cast('2011-03-01' as date), cast('2011-05-01' as 
date), interval 1 month)").show(false)`, People will get `[2011-03-01, 
2011-04-01, 2011-05-01]`, **`[2011-03-01, 2011-03-28, 2011-04-28]`**, 
`[2011-03-01, 2011-04-01, 2011-05-01]`.
   
   After the PR, sequence date conversion is corrected:
   We will get `[2011-03-01, 2011-04-01, 2011-05-01]` from the former three 
conditions.
   
   ### How was this patch tested?
   Unit test.


----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to