cloud-fan commented on a change in pull request #33640:
URL: https://github.com/apache/spark/pull/33640#discussion_r683179571
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -0,0 +1,104 @@
+-- timestamp literals, functions and operations
+
+select timestamp '2019-01-01\t';
+select timestamp '2019-01-01中文';
+
+-- timestamp with year outside [0000-9999]
+select timestamp'-1969-12-31 16:00:00', timestamp'0015-03-18 16:00:00',
timestamp'-000001', timestamp'99999-03-18T12:03:17';
+-- invalid: year too large
+select timestamp'4294967297';
+-- invalid: minute field can have at most 2 digits
+select timestamp'2021-01-01T12:30:4294967297.123456';
+
+select current_timestamp = current_timestamp;
+-- under ANSI mode, `current_timestamp` can't be a function name.
+select current_timestamp() = current_timestamp();
+
+select localtimestamp() = localtimestamp();
+
+-- timestamp numeric fields constructor
+SELECT make_timestamp(2021, 07, 11, 6, 30, 45.678);
+SELECT make_timestamp(2021, 07, 11, 6, 30, 45.678, 'CET');
+SELECT make_timestamp(2021, 07, 11, 6, 30, 60.007);
+
+-- [SPARK-22333]: timeFunctionCall has conflicts with columnReference
+create temporary view ttf1 as select * from values
+ (1, 2),
+ (2, 3)
+ as ttf1(`current_date`, `current_timestamp`);
Review comment:
I quoted the column name here so that this test can run with ANSI mode.
--
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]