iRakson opened a new pull request, #56946: URL: https://github.com/apache/spark/pull/56946
### What changes were proposed in this pull request? Add nanosecond arms so the ORDER BY-cast optimization applies to NTZ nanos and correctly excludes LTZ nanos, matching the microsecond behavior. ### Why are the changes needed? collect.scala isCastEqualityPreserving (~L750-762) marks TimestampNTZType as cast-equality-preserving and TimestampType (LTZ, DST) as unsafe, but has no arm for TimestampNTZNanosType / TimestampLTZNanosType, so both fall to case _ => false. NTZ nanos should be treated like NTZ micro (safe); LTZ nanos like LTZ micro. ### Does this PR introduce _any_ user-facing change? Yes, nanosecond precision timestamps behaviour would be same as microsecond timestamp behaviour now. ### How was this patch tested? Added UT. ### Was this patch authored or co-authored using generative AI tooling? Claude for writing UT. -- 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]
