rluvaton commented on code in PR #17977:
URL: https://github.com/apache/datafusion/pull/17977#discussion_r2524128874
##########
datafusion/physical-plan/src/aggregates/group_values/multi_group_by/primitive.rs:
##########
@@ -54,6 +54,85 @@ where
nulls: MaybeNullBufferBuilder::new(),
}
}
+
+ fn vectorized_equal_to_non_nullable(
+ &self,
+ lhs_rows: &[usize],
+ array: &ArrayRef,
+ rhs_rows: &[usize],
+ equal_to_results: &mut [bool],
+ ) {
+ assert!(
+ !NULLABLE || (array.null_count() == 0 &&
!self.nulls.might_have_nulls()),
+ "called with nullable input"
+ );
+ let array_values = array.as_primitive::<T>().values();
+
+ let iter = izip!(
+ lhs_rows.iter(),
+ rhs_rows.iter(),
+ equal_to_results.iter_mut(),
+ );
+
+ for (&lhs_row, &rhs_row, equal_to_result) in iter {
+ let result = {
+ // Getting unchecked not only for bound checks but because the
bound checks are
+ // what prevents auto-vectorization
+ let left = if cfg!(debug_assertions) {
+ self.group_values[lhs_row]
+ } else {
+ // SAFETY: indices are guaranteed to be in bounds
+ unsafe { *self.group_values.get_unchecked(lhs_row) }
Review Comment:
what do you mean?
--
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]