Skip to content

Conversation

@ahshahid
Copy link
Contributor

What changes were proposed in this pull request?

The order of application of 3 rules is changed from

 BooleanSimplification,
        SimplifyConditionals,
        PushFoldableIntoBranches,
        SimplifyBinaryComparison,

to

SimplifyConditionals,
        SimplifyBinaryComparison,
        BooleanSimplification,
        PushFoldableIntoBranches,

Why are the changes needed?

This would help achieve idempotency in plan optimization faster, in some cases for eg
($"a" > 1000 && $"c" =!= false)
can achieve idempotency in one pass to
$"a" > 1000 && $"c"
with the modified order, as BooleanSimplification rule becomes more efficient due to preprocessing by SimplifyBinaryComparison

Does this PR introduce any user-facing change?

No

How was this patch tested?

Added bugtest

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

No

@github-actions
Copy link

JIRA Issue Information

=== Improvement SPARK-55110 ===
Summary: Order of rules BooleanSimplification and SimplifyBinaryComparison is suboptimal in achieving idempotency
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
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