Skip to content

Commit

Permalink
define ByteGroupValueViewBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint authored and alamb committed Oct 13, 2024
1 parent abce0e9 commit af00bcb
Show file tree
Hide file tree
Showing 3 changed files with 697 additions and 6 deletions.
18 changes: 15 additions & 3 deletions datafusion/physical-plan/src/aggregates/group_values/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
// under the License.

use crate::aggregates::group_values::group_column::{
ByteGroupValueBuilder, GroupColumn, PrimitiveGroupValueBuilder,
ByteGroupValueBuilder, ByteViewGroupValueBuilder, GroupColumn,
PrimitiveGroupValueBuilder,
};
use crate::aggregates::group_values::GroupValues;
use ahash::RandomState;
use arrow::compute::cast;
use arrow::datatypes::{
Date32Type, Date64Type, Float32Type, Float64Type, Int16Type, Int32Type, Int64Type,
Int8Type, UInt16Type, UInt32Type, UInt64Type, UInt8Type,
BinaryViewType, Date32Type, Date64Type, Float32Type, Float64Type, Int16Type,
Int32Type, Int64Type, Int8Type, StringViewType, UInt16Type, UInt32Type, UInt64Type,
UInt8Type,
};
use arrow::record_batch::RecordBatch;
use arrow_array::{Array, ArrayRef};
Expand Down Expand Up @@ -119,6 +121,8 @@ impl GroupValuesColumn {
| DataType::LargeBinary
| DataType::Date32
| DataType::Date64
| DataType::Utf8View
| DataType::BinaryView
)
}
}
Expand Down Expand Up @@ -184,6 +188,14 @@ impl GroupValues for GroupValuesColumn {
let b = ByteGroupValueBuilder::<i64>::new(OutputType::Binary);
v.push(Box::new(b) as _)
}
&DataType::Utf8View => {
let b = ByteViewGroupValueBuilder::<StringViewType>::new();
v.push(Box::new(b) as _)
}
&DataType::BinaryView => {
let b = ByteViewGroupValueBuilder::<BinaryViewType>::new();
v.push(Box::new(b) as _)
}
dt => {
return not_impl_err!("{dt} not supported in GroupValuesColumn")
}
Expand Down
Loading

0 comments on commit af00bcb

Please sign in to comment.