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

   ### What changes were proposed in this pull request?
   
   Extends `timestampdiff` to nanosecond-precision timestamps 
(`TIMESTAMP_NTZ/LTZ(p)`  p in [7, 9]). When either operand is a nanosecond 
carrier, the difference is computed at full nanosecond resolution so each 
operand's sub-microsecond fraction participates in the truncated unit count — 
for every unit, not only `NANOSECOND`. The `NANOSECOND` unit is added to the 
shared unit map, so `timestampdiff(NANOSECOND, …)` now works for both 
nanosecond and microsecond operands (microsecond operands carry a zero 
fraction).
   
   
   ### Why are the changes needed?
   Part of SPARK-57833, nanosecond-precision timestamp support 
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. `timestampdiff` now accepts nanosecond-precision timestamp
   
   ### How was this patch tested?
   New UT + sql golden file tests.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Co-Authored-by: Claude Opus 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