beliefer opened a new pull request #33439:
URL: https://github.com/apache/spark/pull/33439


   ### What changes were proposed in this pull request?
   The current implement of `Sequence` expression not support step by days for 
dates.
   ```
   spark-sql> select sequence(date'2021-07-01', date'2021-07-10', interval '3' 
day);
   Error in query: cannot resolve 'sequence(DATE '2021-07-01', DATE 
'2021-07-10', INTERVAL '3' DAY)' due to data type mismatch:
   sequence uses the wrong parameter type. The parameter type must conform to:
   1. The start and stop expressions must resolve to the same type.
   2. If start and stop expressions resolve to the 'date' or 'timestamp' type
   then the step expression must resolve to the 'interval' or
   'interval year to month' or 'interval day to second' type,
   otherwise to the same type as the start and stop expressions.
            ; line 1 pos 7;
   'Project [unresolvedalias(sequence(2021-07-01, 2021-07-10, Some(INTERVAL '3' 
DAY), Some(Europe/Moscow)), None)]
   +- OneRowRelation
   ```
   
   
   ### Why are the changes needed?
   `DayTimeInterval` has day granularity should as step for dates.
   
   
   ### Does this PR introduce _any_ user-facing change?
   'Yes'.
   Sequence expression will supports step by `DayTimeInterval` has day 
granularity for dates.
   
   
   ### How was this patch tested?
   New tests.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to