gengliangwang commented on a change in pull request #33729:
URL: https://github.com/apache/spark/pull/33729#discussion_r688289970
##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/interval.sql.out
##########
@@ -117,6 +117,75 @@ struct<(INTERVAL '02' SECOND * NULL):interval day to
second>
NULL
+-- !query
+select interval '2 year' / 0
+-- !query schema
+struct<>
+-- !query output
+java.lang.ArithmeticException
+/ by zero
+
+
+-- !query
+select interval '2 year' / null
+-- !query schema
+struct<(INTERVAL '2' YEAR / NULL):interval year to month>
Review comment:
It's to have a wider data type as the division result. Just like the
following
```
scala> spark.sql("select 1 /null")
res0: org.apache.spark.sql.DataFrame = [(1 / NULL): double]
```
--
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]