cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685337963
##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/timestamp.sql.out
##########
@@ -590,6 +590,58 @@ org.apache.spark.sql.AnalysisException
cannot resolve '1 + (- INTERVAL '02' SECOND)' due to data type mismatch:
argument 1 requires (timestamp or timestamp without time zone) type, however,
'1' is of int type.; line 1 pos 7
+-- !query
+select '2011-11-11 11:11:11' - date'2011-11-11'
+-- !query schema
+struct<(2011-11-11 11:11:11 - DATE '2011-11-11'):interval day>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+select '2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+cannot resolve '('2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 11:11:10')' due
to data type mismatch: argument 1 requires (timestamp or timestamp without time
zone) type, however, ''2011-11-11 11:11:11'' is of string type.; line 1 pos 7
Review comment:
shall we fix it under ansi mode? this is inconsistent: `string_literal -
date` works but `string_literal - timestamp` does not.
--
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]