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

   
   ### What changes were proposed in this pull request?
   Add non-ANSI type-coercion arms so that a string compared against a 
nanosecond-precision timestamp column (`TIMESTAMP_NTZ(p)`/`TIMESTAMP_LTZ(p)`, p 
in [7, 9]) is cast to that nanos type, mirroring the existing microsecond 
`TimestampType` handling (`StringPromotionTypeCoercion` equality arms + 
`TypeCoercion.findCommonTypeForBinaryComparison`). 
   
   
   ### Why are the changes needed?
   Without a nanos arm, a string compared to a nanos column loses 
sub-microsecond precision under legacy 
`spark.sql.legacy.typeCoercion.datetimeToString.enabled=true` instead of 
parsing at full precision like the microsecond types. ANSI mode is unchanged.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. String vs nanosecond-timestamp comparisons now coerce the string to the 
nanos type with full precision (preview 
`spark.sql.timestampNanosTypes.enabled`).
   
   
   ### How was this patch tested?
   Extended existing suits and added golden file tests.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Generated-by: Claude Code
   


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