Skip to content

Commit a80fc77

Browse files
committed
feat(min_max): rename predicate to requires_logical_row_scan
- Renamed the predicate from `is_row_wise_batch_type` to `requires_logical_row_scan` at `min_max.rs - Added a comment clarifying the strategy for handling primitive, string, and binary types using specialized kernels, while this set falls back to scalar row-by-row logical comparison. - Updated both call sites to reflect the new name at `min_max.rs`
1 parent b92aeef commit a80fc77

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • datafusion/functions-aggregate-common/src

datafusion/functions-aggregate-common/src/min_max.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,9 @@ fn dictionary_scalar_parts(value: &ScalarValue) -> (&ScalarValue, Option<&DataTy
480480
}
481481
}
482482

483-
fn is_row_wise_batch_type(data_type: &DataType) -> bool {
483+
// Primitive, string, and binary types use specialized Arrow min/max kernels.
484+
// These remaining types fall back to scalar row-by-row logical comparison.
485+
fn requires_logical_row_scan(data_type: &DataType) -> bool {
484486
matches!(
485487
data_type,
486488
DataType::Struct(_)
@@ -828,7 +830,7 @@ pub fn min_batch(values: &ArrayRef) -> Result<ScalarValue> {
828830
min_binary_view
829831
)
830832
}
831-
data_type if is_row_wise_batch_type(data_type) => {
833+
data_type if requires_logical_row_scan(data_type) => {
832834
scalar_row_extreme(values, Ordering::Greater)?
833835
}
834836
_ => min_max_batch!(values, min),
@@ -880,7 +882,7 @@ pub fn max_batch(values: &ArrayRef) -> Result<ScalarValue> {
880882
let value = value.map(|e| e.to_vec());
881883
ScalarValue::FixedSizeBinary(*size, value)
882884
}
883-
data_type if is_row_wise_batch_type(data_type) => {
885+
data_type if requires_logical_row_scan(data_type) => {
884886
scalar_row_extreme(values, Ordering::Less)?
885887
}
886888
_ => min_max_batch!(values, max),

0 commit comments

Comments
 (0)