Dandandan commented on code in PR #21037:
URL: https://github.com/apache/datafusion/pull/21037#discussion_r2955391319
##########
datafusion/functions-aggregate/src/approx_distinct.rs:
##########
@@ -213,23 +202,18 @@ where
let array: &GenericBinaryArray<T> =
downcast_value!(values[0], GenericBinaryArray, T);
// flatten because we would skip nulls
- self.hll
- .extend(array.into_iter().flatten().map(|v| v.to_vec()));
+ self.hll.extend(array.into_iter().flatten());
Ok(())
}
default_accumulator_impl!();
}
-impl<T> Accumulator for StringViewHLLAccumulator<T>
-where
- T: OffsetSizeTrait,
-{
+impl Accumulator for StringViewHLLAccumulator {
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> {
let array: &StringViewArray = downcast_value!(values[0],
StringViewArray);
// flatten because we would skip nulls
- self.hll
- .extend(array.iter().flatten().map(|s| s.to_string()));
+ self.hll.extend(array.iter().flatten());
Review Comment:
(Which would make it more close to primitive for small strings)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]