Skip to content

Commit 7461211

Browse files
committed
remove the old grouping related codes.
1 parent 632ee3e commit 7461211

File tree

9 files changed

+4
-126
lines changed

9 files changed

+4
-126
lines changed

datafusion/expr/src/aggregate_function.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ pub enum AggregateFunction {
4141
ArrayAgg,
4242
/// N'th value in a group according to some ordering
4343
NthValue,
44-
/// Grouping
45-
Grouping,
4644
}
4745

4846
impl AggregateFunction {
@@ -53,7 +51,6 @@ impl AggregateFunction {
5351
Max => "MAX",
5452
ArrayAgg => "ARRAY_AGG",
5553
NthValue => "NTH_VALUE",
56-
Grouping => "GROUPING",
5754
}
5855
}
5956
}
@@ -73,8 +70,6 @@ impl FromStr for AggregateFunction {
7370
"min" => AggregateFunction::Min,
7471
"array_agg" => AggregateFunction::ArrayAgg,
7572
"nth_value" => AggregateFunction::NthValue,
76-
// other
77-
"grouping" => AggregateFunction::Grouping,
7873
_ => {
7974
return plan_err!("There is no built-in function named {name}");
8075
}
@@ -119,7 +114,6 @@ impl AggregateFunction {
119114
coerced_data_types[0].clone(),
120115
input_expr_nullable[0],
121116
)))),
122-
AggregateFunction::Grouping => Ok(DataType::Int32),
123117
AggregateFunction::NthValue => Ok(coerced_data_types[0].clone()),
124118
}
125119
}
@@ -141,9 +135,7 @@ impl AggregateFunction {
141135
pub fn signature(&self) -> Signature {
142136
// note: the physical expression must accept the type returned by this function or the execution panics.
143137
match self {
144-
AggregateFunction::Grouping | AggregateFunction::ArrayAgg => {
145-
Signature::any(1, Volatility::Immutable)
146-
}
138+
AggregateFunction::ArrayAgg => Signature::any(1, Volatility::Immutable),
147139
AggregateFunction::Min | AggregateFunction::Max => {
148140
let valid = STRINGS
149141
.iter()

datafusion/expr/src/type_coercion/aggregates.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ pub fn coerce_types(
102102
get_min_max_result_type(input_types)
103103
}
104104
AggregateFunction::NthValue => Ok(input_types.to_vec()),
105-
AggregateFunction::Grouping => Ok(vec![input_types[0].clone()]),
106105
}
107106
}
108107

datafusion/physical-expr/src/aggregate/build_in.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ pub fn create_aggregate_expr(
6060
.collect::<Result<Vec<_>>>()?;
6161
let input_phy_exprs = input_phy_exprs.to_vec();
6262
Ok(match (fun, distinct) {
63-
(AggregateFunction::Grouping, _) => Arc::new(expressions::Grouping::new(
64-
input_phy_exprs[0].clone(),
65-
name,
66-
data_type,
67-
)),
6863
(AggregateFunction::ArrayAgg, false) => {
6964
let expr = input_phy_exprs[0].clone();
7065
let nullable = expr.nullable(input_schema)?;

datafusion/physical-expr/src/aggregate/grouping.rs

Lines changed: 0 additions & 103 deletions
This file was deleted.

datafusion/physical-expr/src/aggregate/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub use datafusion_physical_expr_common::aggregate::AggregateExpr;
2020
pub(crate) mod array_agg;
2121
pub(crate) mod array_agg_distinct;
2222
pub(crate) mod array_agg_ordered;
23-
pub(crate) mod grouping;
2423
pub(crate) mod nth_value;
2524
#[macro_use]
2625
pub(crate) mod min_max;

datafusion/physical-expr/src/expressions/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub use crate::aggregate::array_agg::ArrayAgg;
3838
pub use crate::aggregate::array_agg_distinct::DistinctArrayAgg;
3939
pub use crate::aggregate::array_agg_ordered::OrderSensitiveArrayAgg;
4040
pub use crate::aggregate::build_in::create_aggregate_expr;
41-
pub use crate::aggregate::grouping::Grouping;
4241
pub use crate::aggregate::min_max::{Max, MaxAccumulator, Min, MinAccumulator};
4342
pub use crate::aggregate::nth_value::NthValueAgg;
4443
pub use crate::aggregate::stats::StatsType;

datafusion/proto/src/logical_plan/from_proto.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ impl From<protobuf::AggregateFunction> for AggregateFunction {
140140
protobuf::AggregateFunction::Min => Self::Min,
141141
protobuf::AggregateFunction::Max => Self::Max,
142142
protobuf::AggregateFunction::ArrayAgg => Self::ArrayAgg,
143-
protobuf::AggregateFunction::Grouping => Self::Grouping,
144143
protobuf::AggregateFunction::NthValueAgg => Self::NthValue,
145144
}
146145
}

datafusion/proto/src/logical_plan/to_proto.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ impl From<&AggregateFunction> for protobuf::AggregateFunction {
111111
AggregateFunction::Min => Self::Min,
112112
AggregateFunction::Max => Self::Max,
113113
AggregateFunction::ArrayAgg => Self::ArrayAgg,
114-
AggregateFunction::Grouping => Self::Grouping,
115114
AggregateFunction::NthValue => Self::NthValueAgg,
116115
}
117116
}
@@ -372,7 +371,6 @@ pub fn serialize_expr(
372371
AggregateFunction::ArrayAgg => protobuf::AggregateFunction::ArrayAgg,
373372
AggregateFunction::Min => protobuf::AggregateFunction::Min,
374373
AggregateFunction::Max => protobuf::AggregateFunction::Max,
375-
AggregateFunction::Grouping => protobuf::AggregateFunction::Grouping,
376374
AggregateFunction::NthValue => {
377375
protobuf::AggregateFunction::NthValueAgg
378376
}

datafusion/proto/src/physical_plan/to_proto.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ use datafusion::physical_expr::window::{NthValueKind, SlidingAggregateWindowExpr
2424
use datafusion::physical_expr::{PhysicalSortExpr, ScalarFunctionExpr};
2525
use datafusion::physical_plan::expressions::{
2626
ArrayAgg, BinaryExpr, CaseExpr, CastExpr, Column, CumeDist, DistinctArrayAgg,
27-
Grouping, InListExpr, IsNotNullExpr, IsNullExpr, Literal, Max, Min, NegativeExpr,
28-
NotExpr, NthValue, NthValueAgg, Ntile, OrderSensitiveArrayAgg, Rank, RankType,
29-
RowNumber, TryCastExpr, WindowShift,
27+
InListExpr, IsNotNullExpr, IsNullExpr, Literal, Max, Min, NegativeExpr, NotExpr,
28+
NthValue, NthValueAgg, Ntile, OrderSensitiveArrayAgg, Rank, RankType, RowNumber,
29+
TryCastExpr, WindowShift,
3030
};
3131
use datafusion::physical_plan::udaf::AggregateFunctionExpr;
3232
use datafusion::physical_plan::windows::{BuiltInWindowExpr, PlainAggregateWindowExpr};

0 commit comments

Comments
 (0)