MaxGekk opened a new pull request #31855: URL: https://github.com/apache/spark/pull/31855
### What changes were proposed in this pull request? Support `timestamp +/- day-time interval`. In the PR, I propose to introduce new binary expression `TimestampAddDTInterval` similarly to `DateAddYMInterval`/`TimestampAddYMInterval`. It invokes `Math.addExact()` by passing a timestamp as an offset in microseconds since the epoch and a duration of a day-time interval in microseconds. The result represents new timestamp as a microsecond offset from the epoch. ### Why are the changes needed? To conform the ANSI SQL standard which requires to support such operation over timestamps and intervals: <img width="811" alt="Screenshot 2021-03-12 at 11 36 14" src="https://user-images.githubusercontent.com/1580697/111081674-865d4900-8515-11eb-86c8-3538ecaf4804.png"> ### Does this PR introduce _any_ user-facing change? Should not since new intervals have not been released yet. ### How was this patch tested? By running new tests: ``` $ build/sbt "test:testOnly *DateExpressionsSuite" $ build/sbt "test:testOnly *ColumnExpressionSuite" ``` ---------------------------------------------------------------- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
