-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support aliases in ConstEvaluator #14734
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
Merged
Merged
Conversation
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
b0f8922
to
f97c3f4
Compare
356deb7
to
f8fd349
Compare
Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions.
f8fd349
to
3564042
Compare
jayzhan211
approved these changes
Feb 18, 2025
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.
👍🏻
Dandandan
approved these changes
Feb 18, 2025
Thanks @joroKr21 @Dandandan |
joroKr21
added a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Feb 19, 2025
Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions.
joroKr21
added a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Feb 19, 2025
Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions.
joroKr21
added a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Feb 19, 2025
Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions.
joroKr21
added a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Feb 20, 2025
Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions.
joroKr21
added a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Feb 20, 2025
* Support aliases in ConstEvaluator (apache#14734) Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions. * Format Cargo.toml
avantgardnerio
pushed a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Sep 22, 2025
* Support aliases in ConstEvaluator (apache#14734) Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions. * Format Cargo.toml
avantgardnerio
pushed a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Oct 1, 2025
* Support aliases in ConstEvaluator (apache#14734) Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions. * Format Cargo.toml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Not sure why they are not supported. It seems that if we're not careful, some transformations can introduce aliases nested inside other expressions.
Which issue does this PR close?
Didn't create an issue, because it's more of an internal change and mostly relevant when using DataFusion as a library.
Rationale for this change
Having
Expr::Alias
as part of the expression AST is a trade-off. It makes the AST uniform and simpler but it allows representing trees that are not really valid SQL such as having aliases nested in function arguments and generally makes them legal in any position of the AST. Therefore I think it would be a desirable property if all transformations can handle aliases wherever they appear.What changes are included in this PR?
Simply changing the
can_evaluate
predicate is enough, alias expressions can already be evaluated.Are these changes tested?
Yes, added a unit test and a couple explain tests had to be updated (I think the output makes more sense now).
Are there any user-facing changes?
No breaking changes or end-user visible changes. For users that use DataFusion as a library, more expressions can be constant-folded.