Jefffrey commented on code in PR #16456:
URL: https://github.com/apache/datafusion/pull/16456#discussion_r2281371737


##########
datafusion/sql/src/expr/substring.rs:
##########
@@ -77,8 +78,16 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
             }
         }
 
-        not_impl_err!(
-            "Substring not supported by UserDefinedExtensionPlanners: 
{substring_args:?}"
-        )
+        let fun = self
+            .context_provider
+            .get_function_meta("substr")
+            .ok_or_else(|| {
+                internal_datafusion_err!("Unable to find expected 'substr' 
function")
+            })?;
+
+        Ok(Expr::ScalarFunction(ScalarFunction::new_udf(
+            fun,
+            substring_args,
+        )))

Review Comment:
   I think this is fine, `trim` is handled a similar way:
   
   
https://github.com/apache/datafusion/blob/a5c242c21443e4881e6843f754493ab02238b655/datafusion/sql/src/expr/mod.rs#L908-L921



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to