-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-55978][SQL][FOLLOWUP] Don't block V2 join pushdown when pushed Sample has fraction=1 #56031
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,11 +151,14 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] with PredicateHelper { | |
| rightProjections.forall(_.isInstanceOf[AttributeReference]) && | ||
| // Cross joins are not supported because they increase the amount of data. | ||
| condition.isDefined && | ||
| // Do not push down join if either side has a pushed sample, because | ||
| // the merged scan builder would silently discard it. | ||
| // Do not push down join if either side has a pushed sample with | ||
| // fraction < 1, because the merged scan builder would silently | ||
| // discard it and change the result. At fraction = 1 the sample is | ||
| // a no-op on the result set, so dropping it is safe. | ||
| // TODO(SPARK-56504): Extend SupportsPushDownJoin to accept pushed | ||
| // samples so sources supporting both can handle the composition. | ||
| leftHolder.pushedSample.isEmpty && rightHolder.pushedSample.isEmpty && | ||
| leftHolder.pushedSample.forall(s => s.upperBound - s.lowerBound >= 1.0) && | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggest tightening the guard, e.g.: !s.withReplacement && s.upperBound - s.lowerBound >= 1.0(optionally also |
||
| rightHolder.pushedSample.forall(s => s.upperBound - s.lowerBound >= 1.0) && | ||
| lBuilder.isOtherSideCompatibleForJoin(rBuilder) => | ||
| // Process left and right columns in original order | ||
| val (leftSideRequiredColumnsWithAliases, rightSideRequiredColumnsWithAliases) = | ||
|
|
||
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.
looks like this is @stanyao 's todo JIRA, can we make this pr target that and remove the TODO?
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.
oh i see, this is separate ?