cloud-fan commented on a change in pull request #33707:
URL: https://github.com/apache/spark/pull/33707#discussion_r686946525
##########
File path: sql/core/src/test/resources/sql-tests/results/date.sql.out
##########
@@ -498,20 +532,28 @@ struct<date_sub(DATE '2001-10-01', 7):date>
-- !query
-select date '2001-10-01' - '7'
+select date '2001-10-01' - date '2001-09-28'
+-- !query schema
+struct<(DATE '2001-10-01' - DATE '2001-09-28'):interval day>
+-- !query output
+3 00:00:00.000000000
+
+
+-- !query
+select date '2001-10-01' - '2001-09-28'
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
-cannot resolve 'date_sub(DATE '2001-10-01', CAST('7' AS DOUBLE))' due to data
type mismatch: argument 2 requires (int or smallint or tinyint) type, however,
'CAST('7' AS DOUBLE)' is of double type.; line 1 pos 7
+cannot resolve 'date_sub(DATE '2001-10-01', CAST('2001-09-28' AS DOUBLE))' due
to data type mismatch: argument 2 requires (int or smallint or tinyint) type,
however, 'CAST('2001-09-28' AS DOUBLE)' is of double type.; line 1 pos 7
Review comment:
It's not a breaking change to allow this in non-ansi mode, we can do
this later.
--
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]