Skip to content

Commit 306ea85

Browse files
committed
Trying to fix rebase issues
1 parent 5d2b769 commit 306ea85

File tree

8 files changed

+7
-42
lines changed

8 files changed

+7
-42
lines changed

datafusion/core/tests/dataframe/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use datafusion_execution::runtime_env::RuntimeEnv;
5252
use datafusion_expr::expr::{GroupingSet, Sort};
5353
use datafusion_expr::var_provider::{VarProvider, VarType};
5454
use datafusion_expr::{
55-
array_agg, avg, cast, col, exists, expr, in_subquery, lit, max, out_ref_col,
55+
array_agg, avg, cast, col, exists, expr, in_subquery, lit, out_ref_col,
5656
placeholder, scalar_subquery, when, wildcard, Expr, ExprSchemable, WindowFrame,
5757
WindowFrameBound, WindowFrameUnits, WindowFunctionDefinition,
5858
};

datafusion/expr/src/aggregate_function.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ impl AggregateFunction {
154154
AggregateFunction::Grouping | AggregateFunction::ArrayAgg => {
155155
Signature::any(1, Volatility::Immutable)
156156
}
157-
AggregateFunction::BitAnd
158-
| AggregateFunction::BitOr
159-
| AggregateFunction::BitXor => {
160-
Signature::uniform(1, INTEGERS.to_vec(), Volatility::Immutable)
161-
}
162157
AggregateFunction::BoolAnd | AggregateFunction::BoolOr => {
163158
Signature::uniform(1, vec![DataType::Boolean], Volatility::Immutable)
164159
}

datafusion/expr/src/type_coercion/aggregates.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use std::ops::Deref;
1918

2019
use crate::{AggregateFunction, Signature, TypeSignature};
2120

@@ -203,22 +202,6 @@ pub fn check_arg_count(
203202
Ok(())
204203
}
205204

206-
fn get_min_max_result_type(input_types: &[DataType]) -> Result<Vec<DataType>> {
207-
// make sure that the input types only has one element.
208-
assert_eq!(input_types.len(), 1);
209-
// min and max support the dictionary data type
210-
// unpack the dictionary to get the value
211-
match &input_types[0] {
212-
DataType::Dictionary(_, dict_value_type) => {
213-
// TODO add checker, if the value type is complex data type
214-
Ok(vec![dict_value_type.deref().clone()])
215-
}
216-
// TODO add checker for datatype which min and max supported
217-
// For example, the `Struct` and `Map` type are not supported in the MIN and MAX function
218-
_ => Ok(input_types.to_vec()),
219-
}
220-
}
221-
222205
/// function return type of a sum
223206
pub fn sum_return_type(arg_type: &DataType) -> Result<DataType> {
224207
match arg_type {

datafusion/functions-aggregate/src/min_max.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ impl AggregateUDFImpl for Max {
572572
}
573573

574574
fn accumulator(&self, acc_args: AccumulatorArgs) -> Result<Box<dyn Accumulator>> {
575-
Ok(Box::new(MaxAccumulator::try_new(&acc_args.data_type)?))
575+
Ok(Box::new(MaxAccumulator::try_new(acc_args.data_type)?))
576576
}
577577

578578
fn aliases(&self) -> &[String] {
@@ -744,7 +744,7 @@ impl AggregateUDFImpl for Min {
744744
}
745745

746746
fn accumulator(&self, acc_args: AccumulatorArgs) -> Result<Box<dyn Accumulator>> {
747-
Ok(Box::new(MinAccumulator::try_new(&acc_args.data_type)?))
747+
Ok(Box::new(MinAccumulator::try_new(acc_args.data_type)?))
748748
}
749749

750750
fn aliases(&self) -> &[String] {

datafusion/proto/src/logical_plan/from_proto.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ impl From<protobuf::AggregateFunction> for AggregateFunction {
145145
protobuf::AggregateFunction::Correlation => Self::Correlation,
146146
protobuf::AggregateFunction::Grouping => Self::Grouping,
147147
protobuf::AggregateFunction::NthValueAgg => Self::NthValue,
148-
protobuf::AggregateFunction::StringAgg => Self::StringAgg,
149148
protobuf::AggregateFunction::UNUSED => panic!("This should never happen, we are retiring this but protobuf doesn't support enum with no 0 values"),
150149
}
151150
}

datafusion/proto/src/logical_plan/to_proto.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@ pub fn serialize_expr(
372372
AggregateFunctionDefinition::BuiltIn(fun) => {
373373
let aggr_function = match fun {
374374
AggregateFunction::ArrayAgg => protobuf::AggregateFunction::ArrayAgg,
375-
AggregateFunction::BitAnd => protobuf::AggregateFunction::BitAnd,
376-
AggregateFunction::BitOr => protobuf::AggregateFunction::BitOr,
377-
AggregateFunction::BitXor => protobuf::AggregateFunction::BitXor,
378375
AggregateFunction::BoolAnd => protobuf::AggregateFunction::BoolAnd,
379376
AggregateFunction::BoolOr => protobuf::AggregateFunction::BoolOr,
380377
AggregateFunction::Avg => protobuf::AggregateFunction::Avg,

datafusion/proto/src/physical_plan/to_proto.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ use datafusion::datasource::file_format::parquet::ParquetSink;
2323
use datafusion::physical_expr::window::{NthValueKind, SlidingAggregateWindowExpr};
2424
use datafusion::physical_expr::{PhysicalSortExpr, ScalarFunctionExpr};
2525
use datafusion::physical_plan::expressions::{
26-
ArrayAgg, Avg, BinaryExpr, BitAnd, BitOr, BitXor, BoolAnd, BoolOr, CaseExpr,
27-
CastExpr, Column, Correlation, CumeDist, DistinctArrayAgg, DistinctBitXor, Grouping,
26+
ArrayAgg, Avg, BinaryExpr, BoolAnd, BoolOr, CaseExpr,
27+
CastExpr, Column, Correlation, CumeDist, DistinctArrayAgg, Grouping,
2828
InListExpr, IsNotNullExpr, IsNullExpr, Literal, NegativeExpr, NotExpr,
2929
NthValue, NthValueAgg, Ntile, OrderSensitiveArrayAgg, Rank, RankType, RowNumber,
30-
StringAgg, TryCastExpr, WindowShift,
30+
TryCastExpr, WindowShift,
3131
};
3232
use datafusion::physical_plan::udaf::AggregateFunctionExpr;
3333
use datafusion::physical_plan::windows::{BuiltInWindowExpr, PlainAggregateWindowExpr};

datafusion/proto/tests/cases/roundtrip_logical_plan.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use datafusion_expr::expr::{
5454
};
5555
use datafusion_expr::logical_plan::{Extension, UserDefinedLogicalNodeCore};
5656
use datafusion_expr::{
57-
Accumulator, AggregateExt, AggregateFunction, ColumnarValue, ExprSchemable,
57+
Accumulator, AggregateExt, ColumnarValue, ExprSchemable,
5858
LogicalPlan, Operator, PartitionEvaluator, ScalarUDF, ScalarUDFImpl, Signature,
5959
TryCast, Volatility, WindowFrame, WindowFrameBound, WindowFrameUnits,
6060
WindowFunctionDefinition, WindowUDF, WindowUDFImpl,
@@ -2026,14 +2026,6 @@ fn roundtrip_window() {
20262026
WindowFrameBound::Following(ScalarValue::UInt64(Some(2))),
20272027
);
20282028

2029-
let test_expr4 = Expr::WindowFunction(expr::WindowFunction::new(
2030-
WindowFunctionDefinition::AggregateFunction(AggregateFunction::Max),
2031-
vec![col("col1")],
2032-
vec![col("col1")],
2033-
vec![col("col2")],
2034-
row_number_frame.clone(),
2035-
None,
2036-
));
20372029

20382030
// 5. test with AggregateUDF
20392031
#[derive(Debug)]
@@ -2168,7 +2160,6 @@ fn roundtrip_window() {
21682160
roundtrip_expr_test(test_expr1, ctx.clone());
21692161
roundtrip_expr_test(test_expr2, ctx.clone());
21702162
roundtrip_expr_test(test_expr3, ctx.clone());
2171-
roundtrip_expr_test(test_expr4, ctx.clone());
21722163
roundtrip_expr_test(test_expr5, ctx.clone());
21732164
roundtrip_expr_test(test_expr6, ctx);
21742165
}

0 commit comments

Comments
 (0)