From 20c67dfa37c27b68b76c7b7000cf34bd76462b5f Mon Sep 17 00:00:00 2001 From: Xianjin YE Date: Sun, 10 Mar 2024 15:49:18 +0800 Subject: [PATCH] fix: Try to convert a static list into set in rust --- core/src/execution/datafusion/planner.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/core/src/execution/datafusion/planner.rs b/core/src/execution/datafusion/planner.rs index 33cf636a2..7ba891918 100644 --- a/core/src/execution/datafusion/planner.rs +++ b/core/src/execution/datafusion/planner.rs @@ -25,9 +25,14 @@ use datafusion::{ common::DataFusionError, logical_expr::{BuiltinScalarFunction, Operator as DataFusionOperator}, physical_expr::{ - expressions::{BinaryExpr, Column, IsNotNullExpr, Literal as DataFusionLiteral}, + execution_props::ExecutionProps, + expressions::{ + in_list, BinaryExpr, CaseExpr, CastExpr, Column, Count, FirstValue, IsNotNullExpr, + IsNullExpr, LastValue, Literal as DataFusionLiteral, Max, Min, NegativeExpr, NotExpr, + Sum, UnKnownColumn, + }, functions::create_physical_expr, - PhysicalExpr, PhysicalSortExpr, + AggregateExpr, PhysicalExpr, PhysicalSortExpr, ScalarFunctionExpr, }, physical_plan::{ aggregates::{AggregateMode as DFAggregateMode, PhysicalGroupBy}, @@ -39,14 +44,6 @@ use datafusion::{ }, }; use datafusion_common::ScalarValue; -use datafusion_physical_expr::{ - execution_props::ExecutionProps, - expressions::{ - CaseExpr, CastExpr, Count, FirstValue, InListExpr, IsNullExpr, LastValue, Max, Min, - NegativeExpr, NotExpr, Sum, UnKnownColumn, - }, - AggregateExpr, ScalarFunctionExpr, -}; use itertools::Itertools; use jni::objects::GlobalRef; use num::{BigInt, ToPrimitive}; @@ -496,7 +493,7 @@ impl PhysicalPlanner { .iter() .map(|x| self.create_expr(x, input_schema.clone()).unwrap()) .collect::>(); - Ok(Arc::new(InListExpr::new(value, list, expr.negated, None))) + in_list(value, list, &expr.negated, input_schema.as_ref()).map_err(|e| e.into()) } ExprStruct::If(expr) => { let if_expr =