vboo123 commented on PR #58186:
URL: https://github.com/apache/spark/pull/58186#issuecomment-5373596169

   cc @JoshRosen — flagging one deliberate behaviour change for your judgement, 
since it edits assertions added by another correctness ticket.
   
   Two assertions in `SubquerySuite`, "SPARK-38132: Not IN subquery correctness 
checks", expected the collapsed result and are updated in this PR. With `c2 = 
{1, 2, 3, NULL, 0}`:
   
   ```sql
   SELECT * FROM t WHERE NOT((c1 NOT IN (SELECT c2 FROM t)) <=> false)
   ```
   
   For `c1 = 4`: `4 IN (...)` has no match and the set contains NULL, so it is 
NULL; `NOT NULL` is NULL; `NULL <=> false` is FALSE; and `NOT FALSE` is TRUE. 
So the row should be returned. The same holds for `c1 = NULL`. The previous 
expectation of no rows only holds if `NOT IN` yields FALSE rather than NULL, 
which is exactly the collapse this PR removes.
   
   The other six assertions in that test are unaffected: `= true`, `<=> true` 
and `!= false` all reject NULL and FALSE alike, so only the two using `NOT(... 
<=> false)` can observe the difference.
   
   Happy to revert these two expectations and scope the fix to plain `IN` only 
if you would rather not change them here.
   


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