Omega359 commented on code in PR #26467:
URL: https://github.com/apache/datafusion/pull/26467#discussion_r4340963789


##########
datafusion/sql/src/expr/mod.rs:
##########
@@ -1155,6 +1164,37 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
         )))
     }
 
+    /// Plans `expr [NOT] RLIKE pattern` and `expr [NOT] REGEXP pattern` as a 
call
+    /// to the `regexp_like` function, resolved through the function registry.
+    fn sql_rlike_to_expr(

Review Comment:
   There are already three sites in `datafusion/sql` that lower SQL syntax to a
   registry-resolved function, and they all share the smae shape. This PR adds 
a fourth
   that diverges on two axes:
   
   | Site | Lookup | Runs `plan_scalar` hooks? | Error on missing fn |
   |---|---|---|---|
   | `sql_fn_name_to_expr` (`expr/function.rs:972`) | 
`get_function_meta(fn_name)` | no | `internal_datafusion_err!("Unable to find 
expected '{fn_name}' function")` |
   | `sql_trim_to_expr` (`expr/mod.rs:1224`) | same | no | same message |
   | `build_binary_expr`, `^` → `power` (`expr/binary_op.rs:78`) | same | no | 
same message |
   | **`sql_rlike_to_expr`** | same | **yes** | `plan_datafusion_err!("RLIKE 
and REGEXP require …")` |
   
   
   The lookup half follows precedent exactly. The plan_scalar and the error on 
missing differ.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to