oc7o commented on code in PR #23188:
URL: https://github.com/apache/datafusion/pull/23188#discussion_r3500312165


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -1099,6 +1099,20 @@ pub fn binary(
     Ok(Arc::new(BinaryExpr::new(lhs, op, rhs)))
 }
 
+fn sql_similar_to_regex(pattern: &str) -> String {
+    let mut result = String::with_capacity(pattern.len() + 6);
+    result.push_str("^(?:");
+    for ch in pattern.chars() {
+        match ch {
+            '%' => result.push_str(".*"),
+            '_' => result.push('.'),
+            c => result.push(c),

Review Comment:
   Actually I looked up and at least Postgres is passing some regex but not 
all: 
https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTOREGEXP
   
   I'll adapt it to this
   



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