@@ -19,26 +19,6 @@ use datafusion_functions_aggregate::min_max::max;
1919use datafusion_functions_aggregate:: min_max:: min;
2020use datafusion_functions_aggregate:: sum:: sum;
2121
22- /// Helper function to convert serde_json::Value to DataFusion ScalarValue
23- fn json_to_scalar ( value : & serde_json:: Value ) -> datafusion:: scalar:: ScalarValue {
24- use datafusion:: scalar:: ScalarValue ;
25- match value {
26- serde_json:: Value :: Null => ScalarValue :: Null ,
27- serde_json:: Value :: Bool ( b) => ScalarValue :: Boolean ( Some ( * b) ) ,
28- serde_json:: Value :: Number ( n) => {
29- if let Some ( i) = n. as_i64 ( ) {
30- ScalarValue :: Int64 ( Some ( i) )
31- } else if let Some ( f) = n. as_f64 ( ) {
32- ScalarValue :: Float64 ( Some ( f) )
33- } else {
34- ScalarValue :: Null
35- }
36- }
37- serde_json:: Value :: String ( s) => ScalarValue :: Utf8 ( Some ( s. clone ( ) ) ) ,
38- serde_json:: Value :: Array ( _) | serde_json:: Value :: Object ( _) => ScalarValue :: Null , // Complex types not supported yet
39- }
40- }
41-
4222/// Helper function to create LIKE expressions with consistent settings
4323fn create_like_expr ( expression : & ValueExpression , pattern : & str , case_insensitive : bool ) -> Expr {
4424 Expr :: Like ( datafusion:: logical_expr:: Like {
@@ -78,7 +58,7 @@ pub(crate) fn to_df_boolean_expr(expr: &BooleanExpression) -> Expr {
7858 BE :: In { expression, list } => {
7959 use datafusion:: logical_expr:: expr:: InList as DFInList ;
8060 let expr = to_df_value_expr ( expression) ;
81- let list_exprs = list. iter ( ) . map ( |e| to_df_value_expr ( e ) ) . collect :: < Vec < _ > > ( ) ;
61+ let list_exprs = list. iter ( ) . map ( to_df_value_expr) . collect :: < Vec < _ > > ( ) ;
8262 Expr :: InList ( DFInList :: new ( Box :: new ( expr) , list_exprs, false ) )
8363 }
8464 BE :: And ( l, r) => Expr :: BinaryExpr ( BinaryExpr {
0 commit comments