stevomitric opened a new pull request, #58576:
URL: https://github.com/apache/spark/pull/58576

   
   
   ### What changes were proposed in this pull request?
   Extend from_utc_timestamp / to_utc_timestamp (the shared UTCTimestamp trait) 
to accept nanosecond-precision timestamps (TIMESTAMP_LTZ(p) / TIMESTAMP_NTZ(p), 
p in [7, 9]) alongside microsecond TimestampType. The result keeps the source's 
exact nanosecond type/family; a zone conversion shifts only epochMicros 
(offsets are whole seconds), so the sub-microsecond nanosWithinMicro remainder 
is preserved. Micros path unchanged. Follows date_trunc (SPARK-57821) and 
convert_timezone (SPARK-57818). Part of SPARK-56822.
   
   ### Why are the changes needed?
   These functions typed their argument as TimestampType only, narrowing a 
nanosecond input to microseconds and dropping the sub-microsecond digits. 
Nanosecond support is a P1 expression item.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, behind the preview flag spark.sql.timestampNanosTypes.enabled 
(unreleased feature; no released version affected). The functions now return 
the same nanosecond type with the remainder preserved.
   
   ### How was this patch tested?
   New DateExpressionsSuite case (both functions x NTZ/LTZ x p in {7,8,9}; 
interpreted + both codegen branches
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Co-authored-by: Claude Code 4.8
   


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