Skip to content

Commit 7d73ab7

Browse files
huaxingaoandygrove
andcommitted
chore: bump DataFusion to rev f4e519f (apache#783)
* chore: bump DataFusion to rev c6f0d3c * fix style * Trigger Build * Update native/Cargo.toml --------- Co-authored-by: Andy Grove <[email protected]>
1 parent 3fde3e5 commit 7d73ab7

File tree

3 files changed

+52
-26
lines changed

3 files changed

+52
-26
lines changed

native/Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

native/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ arrow-buffer = { version = "52.2.0" }
3939
arrow-data = { version = "52.2.0" }
4040
arrow-schema = { version = "52.2.0" }
4141
parquet = { version = "52.2.0", default-features = false, features = ["experimental"] }
42-
datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "35c2e7e" }
43-
datafusion = { default-features = false, git = "https://github.com/apache/datafusion.git", rev = "35c2e7e", features = ["unicode_expressions", "crypto_expressions"] }
44-
datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "35c2e7e", features = ["crypto_expressions"] }
45-
datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "35c2e7e", default-features = false }
46-
datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "35c2e7e", default-features = false }
47-
datafusion-physical-expr-common = { git = "https://github.com/apache/datafusion.git", rev = "35c2e7e", default-features = false }
48-
datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "35c2e7e", default-features = false }
42+
datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "f4e519f" }
43+
datafusion = { default-features = false, git = "https://github.com/apache/datafusion.git", rev = "f4e519f", features = ["unicode_expressions", "crypto_expressions"] }
44+
datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "f4e519f", features = ["crypto_expressions"] }
45+
datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "f4e519f", default-features = false }
46+
datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "f4e519f", default-features = false }
47+
datafusion-physical-expr-common = { git = "https://github.com/apache/datafusion.git", rev = "f4e519f", default-features = false }
48+
datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "f4e519f", default-features = false }
4949
datafusion-comet-spark-expr = { path = "spark-expr", version = "0.2.0-apple-SNAPSHOT" }
5050
datafusion-comet-proto = { path = "proto", version = "0.2.0-apple-SNAPSHOT" }
5151
chrono = { version = "0.4", default-features = false, features = ["clock"] }

native/core/src/execution/datafusion/planner.rs

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ use crate::{
5050
};
5151
use arrow_schema::{DataType, Field, Schema, TimeUnit, DECIMAL128_MAX_PRECISION};
5252
use datafusion::functions_aggregate::bit_and_or_xor::{bit_and_udaf, bit_or_udaf, bit_xor_udaf};
53+
use datafusion::functions_aggregate::min_max::max_udaf;
54+
use datafusion::functions_aggregate::min_max::min_udaf;
5355
use datafusion::functions_aggregate::sum::sum_udaf;
5456
use datafusion::physical_plan::windows::BoundedWindowAggExec;
5557
use datafusion::physical_plan::InputOrderMode;
@@ -63,7 +65,7 @@ use datafusion::{
6365
execution_props::ExecutionProps,
6466
expressions::{
6567
in_list, BinaryExpr, CaseExpr, CastExpr, Column, IsNotNullExpr, IsNullExpr,
66-
Literal as DataFusionLiteral, Max, Min, NotExpr,
68+
Literal as DataFusionLiteral, NotExpr,
6769
},
6870
AggregateExpr, PhysicalExpr, PhysicalSortExpr, ScalarFunctionExpr,
6971
},
@@ -1274,14 +1276,38 @@ impl PhysicalPlanner {
12741276
.map_err(|e| ExecutionError::DataFusionError(e.to_string()))
12751277
}
12761278
AggExprStruct::Min(expr) => {
1277-
let child = self.create_expr(expr.child.as_ref().unwrap(), schema)?;
1279+
let child = self.create_expr(expr.child.as_ref().unwrap(), schema.clone())?;
12781280
let datatype = to_arrow_datatype(expr.datatype.as_ref().unwrap());
1279-
Ok(Arc::new(Min::new(child, "min", datatype)))
1281+
let child = Arc::new(CastExpr::new(child, datatype.clone(), None));
1282+
create_aggregate_expr(
1283+
&min_udaf(),
1284+
&[child],
1285+
&[],
1286+
&[],
1287+
&[],
1288+
schema.as_ref(),
1289+
"min",
1290+
false,
1291+
false,
1292+
)
1293+
.map_err(|e| ExecutionError::DataFusionError(e.to_string()))
12801294
}
12811295
AggExprStruct::Max(expr) => {
1282-
let child = self.create_expr(expr.child.as_ref().unwrap(), schema)?;
1296+
let child = self.create_expr(expr.child.as_ref().unwrap(), schema.clone())?;
12831297
let datatype = to_arrow_datatype(expr.datatype.as_ref().unwrap());
1284-
Ok(Arc::new(Max::new(child, "max", datatype)))
1298+
let child = Arc::new(CastExpr::new(child, datatype.clone(), None));
1299+
create_aggregate_expr(
1300+
&max_udaf(),
1301+
&[child],
1302+
&[],
1303+
&[],
1304+
&[],
1305+
schema.as_ref(),
1306+
"max",
1307+
false,
1308+
false,
1309+
)
1310+
.map_err(|e| ExecutionError::DataFusionError(e.to_string()))
12851311
}
12861312
AggExprStruct::Sum(expr) => {
12871313
let child = self.create_expr(expr.child.as_ref().unwrap(), schema.clone())?;

0 commit comments

Comments
 (0)