Skip to content

Commit bb33fe6

Browse files
committed
Revert "fix CI issues"
This reverts commit e640a65.
1 parent e640a65 commit bb33fe6

File tree

2 files changed

+183
-142
lines changed

2 files changed

+183
-142
lines changed

datafusion/physical-plan/src/aggregates/group_values/mod.rs

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
//! [`GroupValues`] trait for storing and interning group keys
1919
2020
use arrow::array::types::{
21-
Date32Type, Date64Type, Decimal128Type, Int8Type, Int16Type, Int32Type, Int64Type,
22-
Time32MillisecondType, Time32SecondType, Time64MicrosecondType, Time64NanosecondType,
23-
TimestampMicrosecondType, TimestampMillisecondType, TimestampNanosecondType,
24-
TimestampSecondType, UInt8Type, UInt16Type, UInt32Type, UInt64Type,
21+
Date32Type, Date64Type, Decimal128Type, Time32MillisecondType, Time32SecondType,
22+
Time64MicrosecondType, Time64NanosecondType, TimestampMicrosecondType,
23+
TimestampMillisecondType, TimestampNanosecondType, TimestampSecondType,
2524
};
2625
use arrow::array::{ArrayRef, downcast_primitive};
2726
use arrow::datatypes::{DataType, SchemaRef, TimeUnit};
@@ -52,11 +51,6 @@ mod metrics;
5251
mod null_builder;
5352

5453
pub(crate) use metrics::GroupByMetrics;
55-
macro_rules! make_dict {
56-
($t:ty, $value_type:expr) => {
57-
Ok(Box::new(GroupValuesDictionary::<$t>::new($value_type)))
58-
};
59-
}
6054

6155
/// Stores the group values during hash aggregation.
6256
///
@@ -206,16 +200,49 @@ pub fn new_group_values(
206200
DataType::Dictionary(key_type, value_type) => {
207201
if supported_single_dictionary_value(value_type) {
208202
return match key_type.as_ref() {
209-
DataType::Int8 => make_dict!(Int8Type, value_type),
210-
DataType::Int16 => make_dict!(Int16Type, value_type),
211-
DataType::Int32 => make_dict!(Int32Type, value_type),
212-
DataType::Int64 => make_dict!(Int64Type, value_type),
213-
DataType::UInt8 => make_dict!(UInt8Type, value_type),
214-
DataType::UInt16 => make_dict!(UInt16Type, value_type),
215-
DataType::UInt32 => make_dict!(UInt32Type, value_type),
216-
DataType::UInt64 => make_dict!(UInt64Type, value_type),
203+
// TODO: turn this into a macro
204+
DataType::Int8 => {
205+
Ok(Box::new(GroupValuesDictionary::<
206+
arrow::datatypes::Int8Type,
207+
>::new(value_type)))
208+
}
209+
DataType::Int16 => {
210+
Ok(Box::new(GroupValuesDictionary::<
211+
arrow::datatypes::Int16Type,
212+
>::new(value_type)))
213+
}
214+
DataType::Int32 => {
215+
Ok(Box::new(GroupValuesDictionary::<
216+
arrow::datatypes::Int32Type,
217+
>::new(value_type)))
218+
}
219+
DataType::Int64 => {
220+
Ok(Box::new(GroupValuesDictionary::<
221+
arrow::datatypes::Int64Type,
222+
>::new(value_type)))
223+
}
224+
DataType::UInt8 => {
225+
Ok(Box::new(GroupValuesDictionary::<
226+
arrow::datatypes::UInt8Type,
227+
>::new(value_type)))
228+
}
229+
DataType::UInt16 => {
230+
Ok(Box::new(GroupValuesDictionary::<
231+
arrow::datatypes::UInt16Type,
232+
>::new(value_type)))
233+
}
234+
DataType::UInt32 => {
235+
Ok(Box::new(GroupValuesDictionary::<
236+
arrow::datatypes::UInt32Type,
237+
>::new(value_type)))
238+
}
239+
DataType::UInt64 => {
240+
Ok(Box::new(GroupValuesDictionary::<
241+
arrow::datatypes::UInt64Type,
242+
>::new(value_type)))
243+
}
217244
_ => Err(datafusion_common::DataFusionError::NotImplemented(
218-
format!("Unsupported dictionary key type: {key_type:?}"),
245+
format!("Unsupported dictionary key type: {key_type:?}",),
219246
)),
220247
};
221248
}

0 commit comments

Comments
 (0)