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

feat: support target table alias in update statement #8080

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

jonahgao
Copy link
Member

@jonahgao jonahgao commented Nov 7, 2023

Which issue does this PR close?

N/A.

Support statements like UPDATE foo AS f .

Rationale for this change

When an alias is provided, it completely hides the actual name of the table. For example, given UPDATE foo AS f, the remainder of the UPDATE statement must refer to this table as f not foo.

Ref: PostgreSQL UPDATE SQL Commands

What changes are included in this PR?

If there is an alias for the target table, use it to properly qualify the column names from the target table.

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Nov 7, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me @jonahgao -- thank you for the contribution (again). These improvements are really appreciated.

You might be interested in #8008 which is also related to qualified names.

@alamb alamb merged commit a564af5 into apache:main Nov 9, 2023
22 checks passed
@jonahgao
Copy link
Member Author

Looks good to me @jonahgao -- thank you for the contribution (again). These improvements are really appreciated.

You might be interested in #8008 which is also related to qualified names.

Thank you for your review @alamb .
I will pay attention to this issue and hope to be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants