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
Conversation
datafusion/sql/src/planner.rs
Outdated
) \ | ||
SELECT * FROM numbers;"; | ||
|
||
let expected = "Projection: #numbers.a, #numbers.b, #numbers.c\ |
There was a problem hiding this comment.
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 #
There was a problem hiding this comment.
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!
There was a problem hiding this 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( |
There was a problem hiding this comment.
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\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
WITH
statementsWITH
statements
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. |
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.