Skip to content

Commit a197fd4

Browse files
committed
wip_sum_tests
1 parent bcc2caf commit a197fd4

File tree

6 files changed

+261
-277
lines changed

6 files changed

+261
-277
lines changed

native/.DS_Store

6 KB
Binary file not shown.

native/core/src/execution/planner.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use datafusion::{
6464
use datafusion_comet_spark_expr::{
6565
create_comet_physical_fun, create_comet_physical_fun_with_eval_mode, create_modulo_expr,
6666
create_negate_expr, BinaryOutputStyle, BloomFilterAgg, BloomFilterMightContain, EvalMode,
67-
SparkHour, SparkMinute, SparkSecond,
67+
SparkHour, SparkMinute, SparkSecond, SumInteger,
6868
};
6969

7070
use crate::execution::operators::ExecutionError::GeneralError;
@@ -1875,6 +1875,17 @@ impl PhysicalPlanner {
18751875
let func = AggregateUDF::new_from_impl(SumDecimal::try_new(datatype)?);
18761876
AggregateExprBuilder::new(Arc::new(func), vec![child])
18771877
}
1878+
DataType::Int8 | DataType::Int16 | DataType::Int32 | DataType::Int64 => {
1879+
// let eval_mode = let eval_mode = from_protobuf_eval_mode(expr.eval_mode)?;
1880+
let eval_mode = if expr.fail_on_error {
1881+
EvalMode::Ansi
1882+
} else {
1883+
EvalMode::Legacy
1884+
};
1885+
let func =
1886+
AggregateUDF::new_from_impl(SumInteger::try_new(datatype, eval_mode)?);
1887+
AggregateExprBuilder::new(Arc::new(func), vec![child])
1888+
}
18781889
_ => {
18791890
// cast to the result data type of SUM if necessary, we should not expect
18801891
// a cast failure since it should have already been checked at Spark side

native/spark-expr/src/agg_funcs/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ pub use correlation::Correlation;
3030
pub use covariance::Covariance;
3131
pub use stddev::Stddev;
3232
pub use sum_decimal::SumDecimal;
33+
pub use sum_int::SumInteger;
3334
pub use variance::Variance;

0 commit comments

Comments
 (0)