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-27561][SQL][FOLLOWUP] Move the two rules for Later column alias into one file #39054

Closed
wants to merge 1 commit into from

Conversation

gengliangwang
Copy link
Member

What changes were proposed in this pull request?

Move the two rules WrapLateralColumnAliasReference and ResolveLateralColumnAliasReference into one file ResolveLateralColumnAlias.scala, instead of one rule in Analyzer.scala and the other one in another file.
Also update the code comments.

Why are the changes needed?

Found this issue during reviewing #39040
This refactor should make the code easier to read and review.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing UT

@github-actions github-actions bot added the SQL label Dec 13, 2022
@gengliangwang
Copy link
Member Author

cc @anchovYu @cloud-fan

import org.apache.spark.sql.internal.SQLConf

/**
* This rule is the second phase to resolve lateral column alias.
* The first phase to resolve lateral column alias.
Copy link
Member Author

Choose a reason for hiding this comment

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

It is more clear to put the comment in the first phase rule

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

If this is a follow-up for SPARK-27561, the original PR (#39040) is not merged yet. Could you make a PR to him in order to commit as a single patch, @gengliangwang ?

@gengliangwang
Copy link
Member Author

@dongjoon-hyun This one is follow-up of #38776. It doesn't contains the code changes of #39040

@dongjoon-hyun
Copy link
Member

Then, let me revise the title of #39040 .

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Merged to master.
Thank you for clarification, @gengliangwang .

@anchovYu
Copy link
Contributor

This PR changes to use the resolver from the SimpleAnalyzer, which is always case sensitive one instead of the one that is determined by conf. This will cause lca unable to resolve case insensitive alias. I fix this issue in the new pr 136a930 by refactoring the code.

@dongjoon-hyun
Copy link
Member

Could you make a PR, @anchovYu ?

beliefer pushed a commit to beliefer/spark that referenced this pull request Dec 18, 2022
…s into one file

### What changes were proposed in this pull request?

Move the two rules `WrapLateralColumnAliasReference` and `ResolveLateralColumnAliasReference` into one file `ResolveLateralColumnAlias.scala`, instead of one rule in `Analyzer.scala` and the other one in another file.
Also update the code comments.

### Why are the changes needed?

Found this issue during reviewing apache#39040
This refactor should make the code easier to read and review.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Existing UT

Closes apache#39054 from gengliangwang/refactorLCA.

Authored-by: Gengliang Wang <gengliang@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@cloud-fan
Copy link
Contributor

Since this PR introduced a regression (case insensitive problem) and it's actually not necessary after my refactor #38888 , I'm reverting it.

@cloud-fan
Copy link
Contributor

Reverted at 52082d3

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.

4 participants