Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion native/core/src/execution/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,9 @@ impl PhysicalPlanner {

let builder = match datatype {
DataType::Decimal128(_, _) => {
let func = AggregateUDF::new_from_impl(SumDecimal::try_new(datatype)?);
let eval_mode = from_protobuf_eval_mode(expr.eval_mode)?;
let func =
AggregateUDF::new_from_impl(SumDecimal::try_new(datatype, eval_mode)?);
AggregateExprBuilder::new(Arc::new(func), vec![child])
}
_ => {
Expand Down
2 changes: 1 addition & 1 deletion native/proto/src/proto/expr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ message Count {
message Sum {
Expr child = 1;
DataType datatype = 2;
bool fail_on_error = 3;
EvalMode eval_mode = 3;
}

message Min {
Expand Down
4 changes: 2 additions & 2 deletions native/spark-expr/benches/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use datafusion::physical_expr::expressions::Column;
use datafusion::physical_expr::PhysicalExpr;
use datafusion::physical_plan::aggregates::{AggregateExec, AggregateMode, PhysicalGroupBy};
use datafusion::physical_plan::ExecutionPlan;
use datafusion_comet_spark_expr::AvgDecimal;
use datafusion_comet_spark_expr::SumDecimal;
use datafusion_comet_spark_expr::{AvgDecimal, EvalMode};
use futures::StreamExt;
use std::hint::black_box;
use std::sync::Arc;
Expand Down Expand Up @@ -97,7 +97,7 @@ fn criterion_benchmark(c: &mut Criterion) {

group.bench_function("sum_decimal_comet", |b| {
let comet_sum_decimal = Arc::new(AggregateUDF::new_from_impl(
SumDecimal::try_new(DataType::Decimal128(38, 10)).unwrap(),
SumDecimal::try_new(DataType::Decimal128(38, 10), EvalMode::Legacy).unwrap(),
));
b.to_async(&rt).iter(|| {
black_box(agg_test(
Expand Down
Loading
Loading