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

Support column aliases specified by WITH statements #3717

Merged
merged 1 commit into from Oct 5, 2022

Conversation

isidentical
Copy link
Contributor

Which issue does this PR close?

Closes #3716.

Rationale for this change

Adds support for processing the column aliases already parsed by sqlparser-rs during SQL planning stage.

What changes are included in this PR?

Normally we already had some relevant logic processing these entries for relations, now it is in a separate function where both the CTE planner and the relation planner can use.

Are there any user-facing changes?

This is a fix/feture.

@github-actions github-actions bot added the sql label Oct 4, 2022
@isidentical isidentical marked this pull request as ready for review October 4, 2022 22:02
) \
SELECT * FROM numbers;";

let expected = "Projection: #numbers.a, #numbers.b, #numbers.c\
Copy link
Member

Choose a reason for hiding this comment

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

Could you merge lastest from master - we no longer prefix column names with #

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be done now, thanks for reminding!

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.

This is beautiful @isidentical -- thank you

} else {
Ok(plan)
}
}

/// Apply the given TableAlias to the top-level projection.
fn apply_table_alias(
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

) \
SELECT * FROM numbers;";

let expected = "Projection: numbers.a, numbers.b, numbers.c\
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@alamb alamb changed the title Use column aliases specified by WITH statements Support column aliases specified by WITH statements Oct 5, 2022
@alamb alamb merged commit 23682f6 into apache:master Oct 5, 2022
@ursabot
Copy link

ursabot commented Oct 5, 2022

Benchmark runs are scheduled for baseline = 64669e9 and contender = 23682f6. 23682f6 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

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.

Allow with statements to specify their columns alongside their expression names
4 participants