Repository navigation
Deprecate ScalarValue::and, ScalarValue::or (#6842) - #6844
Merged
Merged
Conversation
crepererum
reviewed
Jul 4, 2023
Comment on lines
225
to
229
| /// new bool_and accumulator | ||
| pub fn try_new(data_type: &DataType) -> Result<Self> { | ||
| Ok(Self { | ||
| bool_and: ScalarValue::try_from(data_type)?, | ||
| }) | ||
| assert_eq!(data_type, &DataType::Boolean); | ||
| Ok(Self { acc: None }) | ||
| } |
Contributor
There was a problem hiding this comment.
If you just assert the DataType to be one constant value, then you can also just remove the parameter and return Self.
alamb
approved these changes
Jul 5, 2023
alamb
left a comment
Contributor
There was a problem hiding this comment.
Seems fine to me -- thank you @tustvold
@Dandandan and I have but plans for those aggregates anyways (though we won't get rid of the need for a ScalarValue based version)
jackwener
approved these changes
Jul 6, 2023
alamb
pushed a commit
to alamb/datafusion
that referenced
this pull request
Jul 6, 2023
* Deprecate ScalarValue::and, ScalarValue::or (apache#6842) * Review feedback
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?
Part of #6842
Rationale for this change
Using ScalarValue to store a boolean is just inefficient and wasteful
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?