Skip to content

Use fully qualified names in ORDER BY clause. #1080

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

Closed
wants to merge 2 commits into from

Conversation

schauder
Copy link
Contributor

@schauder schauder commented Nov 4, 2021

Closes #968

@@ -77,7 +77,7 @@ Delegation leaveMatched(OrderByField segment) {
Delegation leaveNested(Visitable segment) {

if (segment instanceof Column) {
builder.append(NameRenderer.reference(context, (Column) segment));
builder.append(NameRenderer.fullyQualifiedReference(context, (Column) segment));
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this consider aliased column names as we want to order by a specific thing that is being selected (SELECT foo.bar as fb, baz.bar as foo.bar … ORDER BY fb)?

@mp911de mp911de added the type: enhancement A general enhancement label Nov 8, 2021
mp911de pushed a commit that referenced this pull request Nov 8, 2021
mp911de added a commit that referenced this pull request Nov 8, 2021
Use column aliases in order-by/expressions when column is aliased. Reduce method visibility in tests.

Closes #968
Original pull request: #1080.
@mp911de
Copy link
Member

mp911de commented Nov 8, 2021

That's merged and polished now.

@mp911de mp911de closed this Nov 8, 2021
@mp911de mp911de added this to the 2.3 GA (2021.1.0) milestone Nov 8, 2021
@schauder schauder deleted the issue/968-fully-qualified-order-by branch November 30, 2021 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OrderByClauseVisitor does not use fully qualified column names
2 participants