Skip to content
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

[SPARK-50319] Reorder ResolveIdentifierClause and BindParameter rules #48849

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

srielau
Copy link
Contributor

@srielau srielau commented Nov 14, 2024

What changes were proposed in this pull request?

The current relative order of rules is:

  1. ResolveRelations
  2. ResolveIdentifierClause
  3. BindParameters

These rules interact in exactly the opposite way as they are listed:

  • BindParameters always operates on leafs
  • ResolveIdentifierClause turns constant expressions (typically parameters) into UnresolvedRelations
  • ResolveRelations is needed to progress resolved identifier clauses
     
    We propose to move BindParameters and ResolveIdentifierClause up.

Why are the changes needed?

This has two effects:

  1. The rule batch will converge faster, saving premature passes over the tree.
  2. "Sloppily" written rule extensions which come last have a lesser chance of not seeing UnresolvedRelation

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests suffice

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

No

@github-actions github-actions bot added the SQL label Nov 14, 2024
@srielau srielau force-pushed the SPARK-50319-Reorder-ResolveIdentifiertClause branch from 8256d25 to ead1fc9 Compare November 14, 2024 23:05
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