-
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
Split count_distinct.rs into separate modules #9087
Conversation
UInt16 => Box::new(NativeDistinctCountAccumulator::<UInt16Type>::new()), | ||
UInt32 => Box::new(NativeDistinctCountAccumulator::<UInt32Type>::new()), | ||
UInt64 => Box::new(NativeDistinctCountAccumulator::<UInt64Type>::new()), | ||
Int8 => Box::new(PrimitiveDistinctCountAccumulator::<Int8Type>::new()), |
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.
Renamed
#[derive(Debug)] | ||
struct DistinctCountAccumulator { | ||
values: HashSet<DistinctScalarValues, RandomState>, | ||
values: HashSet<ScalarValue, RandomState>, |
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 was typedefd to
type DistinctScalarValues = ScalarValue;
Which serves no purpose that I can tell other than obscuring what this code is doing
@@ -260,182 +261,6 @@ impl Accumulator for DistinctCountAccumulator { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] | |||
struct NativeDistinctCountAccumulator<T> |
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.
Moved to native.rs
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
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.
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?
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.
Yes, that is correct. Good call
Added in 1edf4f0
Thanks again for the review @crepererum |
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?
NativeDistinctCountAccumulator
toPrimitiveDistinctCountAccumulator
to align withArrowPrimitiveType
Are 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