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

   
   ### What changes were proposed in this pull request?
   
   Adds end-to-end test coverage for scalar subquery, EXISTS / NOT EXISTS, and 
NOT IN (SELECT) over nanosecond-precision `TIMESTAMP_NTZ(p)` values, which were 
previously exercised only for `IN (SELECT)`.
   
   Golden cases in `timestamp-ntz-nanos.sql` (after the existing `IN (SELECT)` 
case):
   - scalar subquery in projection returns the nanos value and carries 
`timestamp_ntz(9)` (value and NULL variants, via `typeof`);
   - scalar subquery in a `WHERE` comparison, decided by the sub-microsecond 
digit;
   - correlated `EXISTS` / `NOT EXISTS` on a nanos equality;
   - `NOT IN (SELECT ...)` anti-semi-join, including a mixed-precision (p=7 vs 
p=9) probe and the three-valued-logic case where the subquery set contains NULL.
   
   Also adds a matching DataFrame-level test in 
`TimestampNanosWideningSuiteBase` (runs under ANSI on and off).
   
   ### Why are the changes needed?
   
   These operators ride on generic nanos equality / type widening that is 
already proven for joins, GROUP BY, and `IN (SELECT)`, but the scalar-subquery 
/ EXISTS / NOT IN patterns had no explicit nanos coverage. The tests 
regression-lock sub-microsecond correctness so a future change to subquery 
result typing or semi-join comparison cannot silently truncate nanos to micros.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Test-only.
   
   ### How was this patch tested?
   
   `SQLQueryTestSuite -z nanos` (golden regeneration, all pass) and 
`TimestampNanosWideningAnsiOnSuite` / `TimestampNanosWideningAnsiOffSuite` 
(14/14 pass).
   
   ### 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