-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-41017][SQL][FOLLOWUP] Push Filter with both deterministic and nondeterministic predicates #38746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
viirya
reviewed
Nov 21, 2022
| Seq("parquet", "").foreach { useV1SourceList => | ||
| withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> useV1SourceList) { | ||
| val scan = spark.read.parquet(pathStr) | ||
| val df = scan.where($"id" > 5 && rand() > 0.5) |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think from description the case should be WHERE rand() > 0.5 AND id = 5?
viirya
approved these changes
Nov 21, 2022
cloud-fan
commented
Nov 21, 2022
sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala
Outdated
Show resolved
Hide resolved
wangyum
approved these changes
Nov 22, 2022
Contributor
Author
|
thanks for review, merging to master! |
SandishKumarHN
pushed a commit
to SandishKumarHN/spark
that referenced
this pull request
Dec 12, 2022
…nondeterministic predicates ### What changes were proposed in this pull request? This PR fixes a regression caused by apache#38511 . For `FROM t WHERE rand() > 0.5 AND col = 1`, we can still push down `col = 1` because we don't guarantee the predicates evaluation order within a `Filter`. This PR updates `ScanOperation` to consider this case and bring back the previous pushdown behavior. ### Why are the changes needed? fix perf regression ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? new tests Closes apache#38746 from cloud-fan/filter. Lead-authored-by: Wenchen Fan <[email protected]> Co-authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
beliefer
pushed a commit
to beliefer/spark
that referenced
this pull request
Dec 15, 2022
…nondeterministic predicates ### What changes were proposed in this pull request? This PR fixes a regression caused by apache#38511 . For `FROM t WHERE rand() > 0.5 AND col = 1`, we can still push down `col = 1` because we don't guarantee the predicates evaluation order within a `Filter`. This PR updates `ScanOperation` to consider this case and bring back the previous pushdown behavior. ### Why are the changes needed? fix perf regression ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? new tests Closes apache#38746 from cloud-fan/filter. Lead-authored-by: Wenchen Fan <[email protected]> Co-authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
beliefer
pushed a commit
to beliefer/spark
that referenced
this pull request
Dec 18, 2022
…nondeterministic predicates ### What changes were proposed in this pull request? This PR fixes a regression caused by apache#38511 . For `FROM t WHERE rand() > 0.5 AND col = 1`, we can still push down `col = 1` because we don't guarantee the predicates evaluation order within a `Filter`. This PR updates `ScanOperation` to consider this case and bring back the previous pushdown behavior. ### Why are the changes needed? fix perf regression ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? new tests Closes apache#38746 from cloud-fan/filter. Lead-authored-by: Wenchen Fan <[email protected]> Co-authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR fixes a regression caused by #38511 . For
FROM t WHERE rand() > 0.5 AND col = 1, we can still push downcol = 1because we don't guarantee the predicates evaluation order within aFilter.This PR updates
ScanOperationto consider this case and bring back the previous pushdown behavior.Why are the changes needed?
fix perf regression
Does this PR introduce any user-facing change?
no
How was this patch tested?
new tests