[SPARK-48925] Add interface which prevents DataSourceV2Strategy to do planning for scan nodes#47443
Closed
urosstan-db wants to merge 1 commit intoapache:masterfrom
Conversation
urosstan-db
commented
Jul 22, 2024
| } | ||
|
|
||
| override def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match { | ||
| case PhysicalOperation(_, _, DataSourceV2ScanRelation( |
Contributor
Author
There was a problem hiding this comment.
This problem would be solveable with plan costs, but AFAIK, first physical plan is always used for execution.
Contributor
There was a problem hiding this comment.
Lets protect code with SQLConf
Member
|
Mind filing a Jira and linking it to the PR title? |
Contributor
Author
Sorry for not linking it, I already created ticket. |
Contributor
Author
|
@cloud-fan Per agreement made with Wenchen, we will close this PR for now |
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
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?
Add new interface (
ExternallyPlannedV1Scan) forV1Scanwhich will preventDataSourceV2Strategyto do planning of optimized scan node.Why are the changes needed?
Sometimes, we want to extend Spark with new strategies (it can be done by adding strategy to
extraStrategiesproperty ofSparkSession), and we want that strategy to planDataSourceV2ScanRelationnode. Even extra strategies are applied before other strategies (and have extra priority), often those strategies tries to do some push downs (or optimization) withFilterandProjectlogical plans. If that push down fails, thenDataSourceV2Strategywill do planning, because it can handle Filter/Project for every expression.Does this PR introduce any user-facing change?
No
How was this patch tested?
No tests made, existing tests covers we did not make regression for current planning logic.
Was this patch authored or co-authored using generative AI tooling?
No