-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Minor: Use ScalarValue::from
impl for strings
#8429
Conversation
ScalarValue::from
impl for strings
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
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.
* Minor: Use ScalarValue::from impl for strings * fix typo
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?