Skip to content

Commit 111c13a

Browse files
committed
chore(cubestore): Use fourth input parameter for Sum::new
1 parent ff89d65 commit 111c13a

File tree

1 file changed

+3
-2
lines changed
  • rust/cubestore/cubestore/src/metastore

1 file changed

+3
-2
lines changed

rust/cubestore/cubestore/src/metastore/table.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use byteorder::{BigEndian, WriteBytesExt};
1111
use chrono::DateTime;
1212
use chrono::Utc;
1313
use datafusion::arrow::datatypes::Schema as ArrowSchema;
14-
use datafusion::physical_plan::expressions::{Column as FusionColumn, Max, Min, Sum};
14+
use datafusion::physical_plan::expressions::{sum_return_type, Column as FusionColumn, Max, Min, Sum};
1515
use datafusion::physical_plan::{udaf, AggregateExpr, PhysicalExpr};
1616
use itertools::Itertools;
1717

@@ -76,7 +76,8 @@ impl AggregateColumn {
7676
)?);
7777
let res: Arc<dyn AggregateExpr> = match self.function {
7878
AggregateFunction::SUM => {
79-
Arc::new(Sum::new(col.clone(), col.name(), col.data_type(schema)?))
79+
let input_data_type = col.data_type(schema)?;
80+
Arc::new(Sum::new(col.clone(), col.name(), sum_return_type(&input_data_type)?, &input_data_type))
8081
}
8182
AggregateFunction::MAX => {
8283
Arc::new(Max::new(col.clone(), col.name(), col.data_type(schema)?))

0 commit comments

Comments
 (0)