MaxGekk opened a new pull request #32016:
URL: https://github.com/apache/spark/pull/32016


   ### What changes were proposed in this pull request?
   Modify the `SubtractTimestamps` expression to return values of 
`DayTimeIntervalType` when `spark.sql.legacy.interval.enabled` is set to 
`false` (which is the default).
   
   ### Why are the changes needed?
   To conform to the ANSI SQL standard which requires ANSI intervals as the 
result of timestamps subtraction, see
   <img width="656" alt="Screenshot 2021-03-29 at 19 09 34" 
src="https://user-images.githubusercontent.com/1580697/112866455-7e2f0d00-90c2-11eb-96e6-3feb7eea7e09.png";>
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes.
   
   ### How was this patch tested?
   By running new tests:
   ```
   $ build/sbt "test:testOnly *DateTimeUtilsSuite"
   $ build/sbt "test:testOnly *DateExpressionsSuite"
   $ build/sbt "test:testOnly *ColumnExpressionSuite"
   ```
   and some tests from `SQLQueryTestSuite`:
   ```
   $ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z timestamp.sql"
   $ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z datetime.sql"
   $ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z interval.sql"
   ```


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

Reply via email to