Repository navigation
fix: preserve expression names when replacing placeholders - #12126
Merged
Merged
Conversation
jonahgao
commented
Aug 23, 2024
|
|
||
| // Test issue: https://github.com/apache/datafusion/issues/12065 | ||
| #[tokio::test] | ||
| async fn filtered_aggr_with_param_values() -> Result<()> { |
Member
Author
There was a problem hiding this comment.
This test on the main branch gave the following error
Error: Context("type_coercion", SchemaError(FieldNotFound { field:
Column { relation: None, name: "count(table1.c2) FILTER (WHERE table1.c3 > $1)" },
valid_fields: [
Column { relation: None, name: "count(table1.c2) FILTER (WHERE table1.c3 > UInt64(10))" }
] }, Some("")))
alamb
approved these changes
Aug 24, 2024
| use log::{debug, trace}; | ||
|
|
||
| /// Re-export of `NamesPreserver` for backwards compatibility, | ||
| /// as it was initially placed here and then moved elsewhere. |
| expr.alias_if_changed(original_name) | ||
| } | ||
|
|
||
| /// Handles ensuring the name of rewritten expressions is not changed. |
Contributor
There was a problem hiding this comment.
FYI @findepi here is an example of using Expr::Alias as described in #1468 (comment)
Contributor
|
Thanks again @jonahgao |
berkaysynnada
pushed a commit
to synnada-ai/datafusion-upstream
that referenced
this pull request
Aug 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #12065.
Rationale for this change
When replacing placeholders with literal values, the names of the expressions might change, but there are references to the old names in the parent plan.
What changes are included in this PR?
NamePreservertodatafusion-exprpackage because it is needed there.Are these changes tested?
Yes
Are there any user-facing changes?
After replacing the parameters, the logical plan might differ from before because aliases have been added.