cloud-fan commented on a change in pull request #33707:
URL: https://github.com/apache/spark/pull/33707#discussion_r686944682



##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/timestamp.sql.out
##########
@@ -533,136 +533,145 @@ struct<to_timestamp(2019 10:10:10, yyyy 
hh:mm:ss):timestamp>
 
 
 -- !query
-select timestamp'2011-11-11 11:11:11' + interval '2' day
+select timestamp'2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
 -- !query schema
-struct<TIMESTAMP '2011-11-11 11:11:11' + INTERVAL '2' DAY:timestamp>
+struct<(TIMESTAMP '2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 
11:11:10'):interval day to second>
 -- !query output
-2011-11-13 11:11:11
+0 00:00:01.000000000
 
 
 -- !query
-select timestamp'2011-11-11 11:11:11' - interval '2' day
+select date'2020-01-01' - timestamp'2019-10-06 10:11:12.345678'
 -- !query schema
-struct<TIMESTAMP '2011-11-11 11:11:11' - INTERVAL '2' DAY:timestamp>
+struct<(DATE '2020-01-01' - TIMESTAMP '2019-10-06 10:11:12.345678'):interval 
day to second>
 -- !query output
-2011-11-09 11:11:11
+86 13:48:47.654322000
 
 
 -- !query
-select timestamp'2011-11-11 11:11:11' + interval '2' second
+select timestamp'2019-10-06 10:11:12.345678' - date'2020-01-01'
 -- !query schema
-struct<TIMESTAMP '2011-11-11 11:11:11' + INTERVAL '02' SECOND:timestamp>
+struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - DATE '2020-01-01'):interval 
day to second>
 -- !query output
-2011-11-11 11:11:13
+-86 13:48:47.654322000
 
 
 -- !query
-select timestamp'2011-11-11 11:11:11' - interval '2' second
+select timestamp'2011-11-11 11:11:11' - '2011-11-11 11:11:10'
 -- !query schema
-struct<TIMESTAMP '2011-11-11 11:11:11' - INTERVAL '02' SECOND:timestamp>
+struct<>
 -- !query output
-2011-11-11 11:11:09
+org.apache.spark.sql.AnalysisException
+cannot resolve '(TIMESTAMP '2011-11-11 11:11:11' - '2011-11-11 11:11:10')' due 
to data type mismatch: argument 2 requires (timestamp or timestamp without time 
zone) type, however, ''2011-11-11 11:11:10'' is of string type.; line 1 pos 7

Review comment:
       This is a bug, cc @gengliangwang 




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

Reply via email to