MaxGekk commented on code in PR #56375:
URL: https://github.com/apache/spark/pull/56375#discussion_r3411635461


##########
sql/core/src/test/resources/sql-tests/inputs/timestamp-ntz-nanos.sql:
##########
@@ -65,3 +65,21 @@ SELECT extract(SECOND FROM NULL :: timestamp_ntz(9));
 
 -- Pre-epoch nanosecond values exercise the negative-epoch path.
 SELECT extract(SECOND FROM TIMESTAMP_NTZ '1960-01-01 13:24:35.123456789');
+
+-- DATE <-> TIMESTAMP_NTZ(p) casts (SPARK-57323): midnight UTC / date 
extraction (zone-independent).

Review Comment:
   Added in d5bd383. Since NTZ uses a fixed UTC grid (zone-independent), the 
resulting date only depends on the session zone for LTZ, so I added the query 
to `timestamp-ltz-nanos.sql`:
   
   ```sql
   SELECT TIMESTAMP_LTZ '2020-01-01 04:00:00.123456789 UTC'::date;
   ```
   
   Under the suite's `America/Los_Angeles` session zone this returns 
`2019-12-31` (the UTC calendar date would be `2020-01-01`), so the golden files 
now demonstrate the zone shift, not just the Scala suite.



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