refactor: use ExprBuilder to consume substrait expr and use macro to generate error#8515
Merged
waynexia merged 2 commits intoapache:mainfrom Dec 14, 2023
Merged
Conversation
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
comphead
reviewed
Dec 12, 2023
| make_error!(exec_err, exec_datafusion_err, Execution); | ||
|
|
||
| // Exposes a macro to create `DataFusionError::Substrait` | ||
| make_error!(substrait_err, substrait_datafusion_err, Substrait); |
comphead
reviewed
Dec 12, 2023
|
|
||
| impl BuiltinExprBuilder { | ||
| pub fn try_from_name(name: &str) -> Option<Self> { | ||
| match name { |
Contributor
There was a problem hiding this comment.
should we that be case insensitive?
Contributor
There was a problem hiding this comment.
Looks like the existing code is also case sensitive. Not that we shouldn't fix it if it should be ignoring case, but I dont' think this PR makes it any better or worse
Member
Author
There was a problem hiding this comment.
Thanks for reminding me 👍 I added an item to #8149, I would take other implementations as a reference on how they handle case sensitivity.
8 tasks
alamb
approved these changes
Dec 12, 2023
|
|
||
| impl BuiltinExprBuilder { | ||
| pub fn try_from_name(name: &str) -> Option<Self> { | ||
| match name { |
Contributor
There was a problem hiding this comment.
Looks like the existing code is also case sensitive. Not that we shouldn't fix it if it should be ignoring case, but I dont' think this PR makes it any better or worse
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?
Related to #8149
Rationale for this change
This PR does two reactors:
Exprbranches inScalarFunctionTypeinto one. And move the dispatch logic intoBuiltinExprBuilder.substrait_err!/substrait_datafusion_err!to generate errors.I'm going to implement other
Exprtypes in substrait. This refactoring makes it easier to extend the match ofExprsWhat changes are included in this PR?
As described above. This PR doesn't contains logical change
Are these changes tested?
By existing cases
Are there any user-facing changes?
No