Apache DataFusion SQL Query Engine
Rename aggregation modules, GroupColumn (#12619)
Andrew Lamb26c8004dc4cf
diff --git a/datafusion/physical-plan/src/aggregates/group_values/column_wise.rs b/datafusion/physical-plan/src/aggregates/group_values/column.rssimilarity index 98%rename from datafusion/physical-plan/src/aggregates/group_values/column_wise.rsrename to datafusion/physical-plan/src/aggregates/group_values/column.rsindex b35d58701b..311f48ba98 100644--- a/datafusion/physical-plan/src/aggregates/group_values/column_wise.rs+++ b/datafusion/physical-plan/src/aggregates/group_values/column.rs@@ -15,8 +15,8 @@// specific language governing permissions and limitations// under the License.-use crate::aggregates::group_values::group_value_row::{- ArrayRowEq, ByteGroupValueBuilder, PrimitiveGroupValueBuilder,+use crate::aggregates::group_values::group_column::{+ ByteGroupValueBuilder, GroupColumn, PrimitiveGroupValueBuilder,};use crate::aggregates::group_values::GroupValues;use ahash::RandomState;@@ -57,7 +57,7 @@ pub struct GroupValuesColumn {/// The actual group by values, stored column-wise. Compare from/// the left to right, each column is stored as `ArrayRowEq`./// This is shown faster than the row format- group_values: Vec<Box<dyn ArrayRowEq>>,+ group_values: Vec<Box<dyn GroupColumn>>,/// reused buffer to store hasheshashes_buffer: Vec<u64>,@@ -180,7 +180,7 @@ impl GroupValues for GroupValuesColumn {}fn check_row_equal(- array_row: &dyn ArrayRowEq,+ array_row: &dyn GroupColumn,lhs_row: usize,array: &ArrayRef,rhs_row: usize,diff --git a/datafusion/physical-plan/src/aggregates/group_values/group_value_row.rs b/datafusion/physical-plan/src/aggregates/group_values/group_column.rssimilarity index 98%rename from datafusion/physical-plan/src/aggregates/group_values/group_value_row.rsrename to datafusion/physical-plan/src/aggregates/group_values/group_column.rsindex ad8da37e7c..a82e6d856c 100644--- a/datafusion/physical-plan/src/aggregates/group_values/group_value_row.rs+++ b/datafusion/physical-plan/src/aggregates/group_values/group_column.rs@@ -43,7 +43,7 @@ use datafusion_physical_expr_common::binary_map::{OutputType, INITIAL_BUFFER_CAP/// (similar to various builders in Arrow-rs) that allow for quick comparison to/// incoming rows.///-pub trait ArrayRowEq: Send + Sync {+pub trait GroupColumn: Send + Sync {/// Returns equal if the row stored in this builder at `lhs_row` is equal to/// the row in `array` at `rhs_row`fn equal_to(&self, lhs_row: usize, array: &ArrayRef, rhs_row: usize) -> bool;@@ -51,7 +51,7 @@ pub trait ArrayRowEq: Send + Sync {fn append_val(&mut self, array: &ArrayRef, row: usize);/// Returns the number of rows stored in this builderfn len(&self) -> usize;- /// Returns the number of bytes used by this [`ArrayRowEq`]+ /// Returns the number of bytes used by this [`GroupColumn`]fn size(&self) -> usize;/// Builds a new array from all of the stored rowsfn build(self: Box<Self>) -> ArrayRef;@@ -82,7 +82,7 @@ where}}-impl<T: ArrowPrimitiveType> ArrayRowEq for PrimitiveGroupValueBuilder<T> {+impl<T: ArrowPrimitiveType> GroupColumn for PrimitiveGroupValueBuilder<T> {fn equal_to(&self, lhs_row: usize, array: &ArrayRef, rhs_row: usize) -> bool {// non-null fast path// both non-null@@ -225,7 +225,7 @@ where}}-impl<O> ArrayRowEq for ByteGroupValueBuilder<O>+impl<O> GroupColumn for ByteGroupValueBuilder<O>whereO: OffsetSizeTrait,{@@ -407,7 +407,7 @@ mod tests {use arrow_array::{ArrayRef, StringArray};use datafusion_physical_expr::binary_map::OutputType;- use super::{ArrayRowEq, ByteGroupValueBuilder};+ use super::{ByteGroupValueBuilder, GroupColumn};#[test]fn test_take_n() {diff --git a/datafusion/physical-plan/src/aggregates/group_values/mod.rs b/datafusion/physical-plan/src/aggregates/group_values/mod.rsindex 275cc7fcbf..3e0474d4c2 100644--- a/datafusion/physical-plan/src/aggregates/group_values/mod.rs+++ b/datafusion/physical-plan/src/aggregates/group_values/mod.rs@@ -25,9 +25,9 @@ pub(crate) mod primitive;use datafusion_expr::EmitTo;use primitive::GroupValuesPrimitive;-mod column_wise;+mod column;mod row;-use column_wise::GroupValuesColumn;+use column::GroupValuesColumn;use row::GroupValuesRows;mod bytes;@@ -35,7 +35,7 @@ mod bytes_view;use bytes::GroupValuesByes;use datafusion_physical_expr::binary_map::OutputType;-mod group_value_row;+mod group_column;/// An interning store for group keyspub trait GroupValues: Send {