Skip to content

Conversation

@peter-toth
Copy link
Contributor

@peter-toth peter-toth commented Sep 28, 2022

What changes were proposed in this pull request?

This PR refectors constaint propagation using TreeNode.multiTransform():

  • It improves the performance of LogicalPlan.getAllValidConstraints() because constraint pruning (based on the node output set) happens during the projection in getAllValidConstraints().
  • Adds new spark.sql.constraintPropagation.projectionLimit and spark.sql.constraintPropagation.inferenceLimit configs to limit the number of constraints generated. These limits can be useful in some usecases where otherwise constraint propagation needs to be disabled entirelly (spark.sql.constraintPropagation.enabled=false) due to huge number of constraints.

Why are the changes needed?

Improvement.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing and new UTs.

@peter-toth peter-toth changed the title [WIP][SQL] Improve constraint generation [WIP][SQL] Improve constraint generation in projection nodes Sep 28, 2022
@github-actions github-actions bot added the SQL label Sep 28, 2022
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from a7452e5 to b334a74 Compare September 28, 2022 18:39
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from b334a74 to d614f80 Compare December 27, 2022 14:33
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from d614f80 to 0059d49 Compare February 13, 2023 15:09
@peter-toth peter-toth changed the title [WIP][SQL] Improve constraint generation in projection nodes [WIP][SQL] Improve constraint propagation Feb 13, 2023
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from 0059d49 to 1024af5 Compare February 13, 2023 20:21
@peter-toth peter-toth changed the title [WIP][SQL] Improve constraint propagation [WIP][SPARK-42438][SQL] Improve constraint propagation using multiTransform Feb 14, 2023
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from 1024af5 to 713c63d Compare February 14, 2023 14:59
@peter-toth
Copy link
Contributor Author

cc @cloud-fan

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the current beahaviour in this PR.

@peter-toth peter-toth changed the title [WIP][SPARK-42438][SQL] Improve constraint propagation using multiTransform [SPARK-42438][SQL] Improve constraint propagation using multiTransform Feb 15, 2023
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from 713c63d to ed2c5ec Compare February 15, 2023 13:24
@peter-toth peter-toth force-pushed the SPARK-improve-constraint-generation branch from ed2c5ec to 8d5bd57 Compare February 28, 2023 08:14
@peter-toth
Copy link
Contributor Author

peter-toth commented Feb 28, 2023

@cloud-fan, this PR refactors constraint propagation using multiTransform to improve performance and to be able to limit the number of constraints. Please let me know your thoughts.

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jun 9, 2023
@github-actions github-actions bot closed this Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant