Split count_distinct.rs into separate modules #9087
Merged
alamb merged 5 commits intoapache:mainfrom Feb 1, 2024
Merged
Conversation
alamb
commented
Jan 31, 2024
| UInt16 => Box::new(NativeDistinctCountAccumulator::<UInt16Type>::new()), | ||
| UInt32 => Box::new(NativeDistinctCountAccumulator::<UInt32Type>::new()), | ||
| UInt64 => Box::new(NativeDistinctCountAccumulator::<UInt64Type>::new()), | ||
| Int8 => Box::new(PrimitiveDistinctCountAccumulator::<Int8Type>::new()), |
| #[derive(Debug)] | ||
| struct DistinctCountAccumulator { | ||
| values: HashSet<DistinctScalarValues, RandomState>, | ||
| values: HashSet<ScalarValue, RandomState>, |
Contributor
Author
There was a problem hiding this comment.
This was typedefd to
type DistinctScalarValues = ScalarValue;Which serves no purpose that I can tell other than obscuring what this code is doing
| } | ||
|
|
||
| #[derive(Debug)] | ||
| struct NativeDistinctCountAccumulator<T> |
crepererum
approved these changes
Feb 1, 2024
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
Contributor
There was a problem hiding this comment.
here could be a module-level comment that quickly says what "native" is. "Native" I think revers to "primitive" scalars like ints and floats, right?
Contributor
Author
There was a problem hiding this comment.
Yes, that is correct. Good call
Added in 1edf4f0
Contributor
Author
|
Thanks again for the review @crepererum |
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 #5472
Rationale for this change
This is something I noticed while working on #8849
The count distinct module was getting large so splitting it into smaller modules would makes things easier to navigate
What changes are included in this PR?
NativeDistinctCountAccumulatortoPrimitiveDistinctCountAccumulatorto align withArrowPrimitiveTypeAre these changes tested?
By existing tests
Are there any user-facing changes?
No, this is internal code reorganization. None of this code is accessible outside of the crate