uros-b commented on code in PR #56562:
URL: https://github.com/apache/spark/pull/56562#discussion_r3431752085


##########
sql/core/src/test/resources/sql-tests/inputs/timestamp-ntz-nanos.sql:
##########
@@ -139,3 +139,8 @@ SELECT array(DATE '2020-01-01') :: array<timestamp_ntz(9)>;
 SELECT map('k', TIMESTAMP_NTZ '2020-01-01 12:30:15.123456789') :: map<string, 
date>;
 SELECT map(DATE '2020-01-01', 'v') :: map<timestamp_ntz(9), string>;
 SELECT named_struct('f', DATE '2020-01-01') :: struct<f: timestamp_ntz(9)>;
+
+-- SPARK-57501: TIMESTAMP_NTZ(p) +/- ANSI day-time interval preserves nanos 
remainder.
+SELECT TIMESTAMP_NTZ '2020-01-02 03:04:05.123456789' + INTERVAL '2 
00:03:00.000456' DAY TO SECOND;
+SELECT TIMESTAMP_NTZ '2020-01-02 03:04:05.123456789' - INTERVAL '1 
00:04:00.000321' DAY TO SECOND;
+SELECT TIMESTAMP_NTZ '1960-01-02 03:04:05.123456789' + INTERVAL '0 
00:00:00.000001' DAY TO SECOND;

Review Comment:
   Calendar-interval rejection is only tested in Catalyst. Should we add a 
small SQL negative test, something like `SELECT TIMESTAMP_NTZ '2020-01-02 
03:04:05.123456789' + INTERVAL '1' MONTH;`



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