alamb commented on code in PR #8222:
URL: https://github.com/apache/arrow-datafusion/pull/8222#discussion_r1394801212


##########
datafusion/expr/src/expr_fn.rs:
##########
@@ -993,7 +993,27 @@ pub fn create_udwf(
 pub fn call_fn(name: impl AsRef<str>, args: Vec<Expr>) -> Result<Expr> {
     match name.as_ref().parse::<BuiltinScalarFunction>() {
         Ok(fun) => Ok(Expr::ScalarFunction(ScalarFunction::new(fun, args))),
-        Err(e) => Err(e),
+        Err(_) => {
+            // Constructing a `ScalarUDF` with only name and stub 
impl/return_type...
+            // This unresolved UDF will be resolved during analyzing using 
registered functions

Review Comment:
   If you can make this work, it seems like a good idea to me. 
   
   However, it is not clear to me how the subsequent passes will know they have 
to resolve this particular scalar UDF though 🤔  so I am not sure this approach 
is viable
   
   Specifically, how would the code look that the analysis pass used to test if 
a `ScalarUDF`  was unresolved or not?



##########
datafusion/expr/src/expr_fn.rs:
##########
@@ -993,7 +993,27 @@ pub fn create_udwf(
 pub fn call_fn(name: impl AsRef<str>, args: Vec<Expr>) -> Result<Expr> {
     match name.as_ref().parse::<BuiltinScalarFunction>() {
         Ok(fun) => Ok(Expr::ScalarFunction(ScalarFunction::new(fun, args))),
-        Err(e) => Err(e),
+        Err(_) => {
+            // Constructing a `ScalarUDF` with only name and stub 
impl/return_type...
+            // This unresolved UDF will be resolved during analyzing using 
registered functions

Review Comment:
   If you can make this work, it seems like a good idea to me. 
   
   However, it is not clear to me how the subsequent passes will know they have 
to resolve this particular scalar UDF though 🤔  so I am not sure this approach 
is viable
   
   Specifically, how would the code look that the analysis pass used to test if 
a `ScalarUDF`  was unresolved or not?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to