You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "jchen5 (via GitHub)" <gi...@apache.org> on 2023/09/23 00:23:55 UTC

[GitHub] [spark] jchen5 opened a new pull request, #43068: [SPARK-44550][SQL] Enable correctness fixes for `null IN (empty list)` under ANSI

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

   ### What changes were proposed in this pull request?
   Enables the correctness fixes for `null IN (empty list)` expressions
   
   `null IN (empty list)` incorrectly evaluates to null, when it should evaluate to false. (The reason it should be false is because a IN (b1, b2) is defined as a = b1 OR a = b2, and an empty IN list is treated as an empty OR which is false. This is specified by ANSI SQL.)
   
   Many places in Spark execution (In, InSet, InSubquery) and optimization (OptimizeIn, NullPropagation) implemented this wrong behavior. This is a longstanding correctness issue which has existed since null support for IN expressions was first added to Spark.
   
   See previous PRs where the fixes were implemented: https://github.com/apache/spark/pull/42007 and https://github.com/apache/spark/pull/42163.
   
   The behavior is under a flag. This PR enables the new behavior by default under ANSI, while under non-ANSI the old behavior remains the default for now. Later, we should switch the new behavior to default in both cases.
   
   See [this doc](https://docs.google.com/document/d/1k8AY8oyT-GI04SnP7eXttPDnDj-Ek-c3luF2zL6DPNU/edit) for more information.
   
   ### Why are the changes needed?
   Fix wrong SQL semantics
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, fix wrong SQL semantics
   
   ### How was this patch tested?
   Unit tests
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #43068: [SPARK-44550][SQL] Enable correctness fixes for `null IN (empty list)` under ANSI

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #43068:
URL: https://github.com/apache/spark/pull/43068#issuecomment-1734699316

   thanks, merging to master!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] jchen5 commented on pull request #43068: [SPARK-44550][SQL] Enable correctness fixes for `null IN (empty list)` under ANSI

Posted by "jchen5 (via GitHub)" <gi...@apache.org>.
jchen5 commented on PR #43068:
URL: https://github.com/apache/spark/pull/43068#issuecomment-1733817301

   @cloud-fan @srielau


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #43068: [SPARK-44550][SQL] Enable correctness fixes for `null IN (empty list)` under ANSI

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #43068: [SPARK-44550][SQL] Enable correctness fixes for `null IN (empty list)` under ANSI
URL: https://github.com/apache/spark/pull/43068


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] jchen5 commented on pull request #43068: [SPARK-44550][SQL] Enable correctness fixes for `null IN (empty list)` under ANSI

Posted by "jchen5 (via GitHub)" <gi...@apache.org>.
jchen5 commented on PR #43068:
URL: https://github.com/apache/spark/pull/43068#issuecomment-1734221286

   Tests were flaky, now passing after re-running.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org