-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Minor: Use ScalarValue::from
impl for strings
#8429
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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
ScalarValue::from
impl for strings
alamb
commented
Dec 5, 2023
wrap_partition_value_in_dict(ScalarValue::Utf8(Some( | ||
"26".to_owned(), | ||
))), | ||
wrap_partition_value_in_dict(ScalarValue::from("2021")), |
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 looks better and more concise to me. Hopefully by updating the code we'll also make the codebase easier to work with over time too
7 tasks
viirya
reviewed
Dec 5, 2023
Comment on lines
+479
to
+480
max_value: Precision::Exact(ScalarValue::from("x")), | ||
min_value: Precision::Exact(ScalarValue::from("a")), |
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.
Oh, this is one case looking much concise.
viirya
approved these changes
Dec 5, 2023
universalmind303
approved these changes
Dec 5, 2023
Dandandan
approved these changes
Dec 6, 2023
appletreeisyellow
pushed a commit
to appletreeisyellow/datafusion
that referenced
this pull request
Dec 15, 2023
* Minor: Use ScalarValue::from impl for strings * fix typo
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
core
Core DataFusion crate
logical-expr
Logical plan and expressions
optimizer
Optimizer rules
physical-expr
Changes to the physical-expr crates
sql
SQL Planner
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?
Follow on to #8411
Rationale for this change
Inspired by the commentary on #8411 from @viirya and @Dandandan #8411 (comment) I took a walk through the code and found quite a few places where we could clean up the construction of
ScalarValue::Utf8
What changes are included in this PR?
Use
ScalarValue::from
impl to createScalarValue::Utf8
-- this both takes less code and may avoid some copies.Are these changes tested?
Covered by existing tests
Are there any user-facing changes?