Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
planga82 committed Jun 8, 2024
1 parent a72db13 commit 809052d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions core/src/execution/datafusion/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ use datafusion::{
arrow::{compute::SortOptions, datatypes::SchemaRef},
common::DataFusionError,
execution::FunctionRegistry,
logical_expr::{
BuiltinScalarFunction, Operator as DataFusionOperator, ScalarFunctionDefinition,
},
logical_expr::Operator as DataFusionOperator,
physical_expr::{
execution_props::ExecutionProps,
expressions::{
Expand All @@ -51,8 +49,8 @@ use datafusion_common::{
tree_node::{Transformed, TransformedResult, TreeNode, TreeNodeRecursion, TreeNodeRewriter},
JoinType as DFJoinType, ScalarValue,
};
use datafusion_expr::ScalarUDF;
use datafusion_physical_expr_common::aggregate::create_aggregate_expr;
use datafusion_physical_expr::udf::ScalarUDF;
use itertools::Itertools;
use jni::objects::GlobalRef;
use num::{BigInt, ToPrimitive};
Expand Down Expand Up @@ -359,7 +357,7 @@ impl PhysicalPlanner {
let child = self.create_expr(expr.child.as_ref().unwrap(), input_schema)?;
let datatype = to_arrow_datatype(expr.datatype.as_ref().unwrap());
let timezone = expr.timezone.clone();
let eval_mode = EvalMode::try_from(expr.eval_mode)?;
let eval_mode = expr.eval_mode.try_into()?;

Ok(Arc::new(Cast::new(child, datatype, eval_mode, timezone)))
}
Expand Down Expand Up @@ -498,11 +496,11 @@ impl PhysicalPlanner {
let child = self.create_expr(expr.child.as_ref().unwrap(), input_schema.clone())?;
let return_type = child.data_type(&input_schema)?;
let args = vec![child];
let eval_mode = EvalMode::try_from(expr.eval_mode)?;
let comet_abs = ScalarUDF::new_from_impl(CometAbsFunc::new(
let eval_mode = expr.eval_mode.try_into()?;
let comet_abs = Arc::new(ScalarUDF::new_from_impl(CometAbsFunc::new(
eval_mode,
return_type.to_string(),
)?);
)?));
let expr = ScalarFunctionExpr::new("abs", comet_abs, args, return_type);
Ok(Arc::new(expr))
}
Expand Down Expand Up @@ -1793,4 +1791,4 @@ mod tests {
}));
op
}
}
}

0 comments on commit 809052d

Please sign in to comment.