Skip to content

Conversation

@ahshahid
Copy link
Contributor

@ahshahid ahshahid commented Jan 26, 2026

…straint rule is run as part of post optimization batch with fixed iterations

What changes were proposed in this pull request?

Running PropagateEmptyRelation rule after PruneFilters rule, as part of the rules
operatorOptimizationRuleSet, of the Optimizer class.

Why are the changes needed?

If InferFiltersFromConstraint rule is added to be run as part of the Batch "Operator Optimization after Inferring Filters", then the idempotency is not achieved in some cases.

The need for "InferFiltersFromConstraint" to be run as FixedPoint is needed for the following PR
#53838

Ideally behaviour of every rule should be such that removal or addition of a rule should not impact achievement of idempotency. So this is not an ideal fix, but since the constraints code especially when Union node is involved is , any ideal fix will be invasive, I believe this is a safe change.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Added bug test

Was this patch authored or co-authored using generative AI tooling?

No

…straint rule is run as part of post optimzation batch with fixed ietrations
@github-actions
Copy link

JIRA Issue Information

=== Bug SPARK-55185 ===
Summary: Adding rule InferFiltersFromConstraints to the Batch "Operator Optimization after Inferring Filters" causes idempotency break
Assignee: None
Status: Open
Affected: ["4.2.0","4.1.1"]


This comment was automatically generated by GitHub Actions

@github-actions github-actions bot added the SQL label Jan 26, 2026
…straint rule is run as part of post optimzation batch with fixed ietrations
@ahshahid ahshahid changed the title [WIP][SPARK-55185][SQL]. Fix for idempotency being broken, if InferFiltersFromCon… [SPARK-55185][SQL]. Fix for idempotency being broken, if InferFiltersFromConstraint rule is run as part of post optimzation batch with fixed iterations Jan 26, 2026
@ahshahid ahshahid changed the title [SPARK-55185][SQL]. Fix for idempotency being broken, if InferFiltersFromConstraint rule is run as part of post optimzation batch with fixed iterations [SPARK-55185][SQL]. Fix for idempotency being broken, if InferFiltersFromConstraint rule is run as part of post optimization batch with fixed iterations Jan 26, 2026
@ahshahid
Copy link
Contributor Author

The combined PR for SPARK-55185 and SPARK-55072 is
PR-SPARK-55072_SPARK-55185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant