jorgecarleitao commented on a change in pull request #7967:
URL: https://github.com/apache/arrow/pull/7967#discussion_r483428265
##########
File path: rust/datafusion/src/physical_plan/planner.rs
##########
@@ -368,32 +368,22 @@ impl DefaultPhysicalPlanner {
.collect::<Result<Vec<_>>>()?;
functions::create_physical_expr(fun, &physical_args,
input_schema)
}
- Expr::ScalarUDF {
- name,
- args,
- return_type,
- } => match ctx_state.scalar_functions.get(name) {
- Some(f) => {
- let mut physical_args = vec![];
- for e in args {
- physical_args.push(self.create_physical_expr(
- e,
- input_schema,
- ctx_state,
- )?);
- }
- Ok(Arc::new(ScalarFunctionExpr::new(
- name,
- f.fun.clone(),
- physical_args,
- return_type,
- )))
+ Expr::ScalarUDF { fun, args } => {
+ let mut physical_args = vec![];
+ for e in args {
+ physical_args.push(self.create_physical_expr(
+ e,
+ input_schema,
+ ctx_state,
+ )?);
}
- _ => Err(ExecutionError::General(format!(
- "Invalid scalar function '{:?}'",
- name
- ))),
- },
+
+ udf::create_physical_expr(
Review comment:
This is where casting would happen for UDFs under this PR, during
physical planning.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]