You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/05/17 19:36:05 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6369: feat: add pattern for simplifying exprs like `str ~ '^foo$'`

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


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -2453,6 +2474,19 @@ mod tests {
                 .and(not_like(col("c1"), "%bar%"))
                 .and(not_like(col("c1"), "%baz%")),
         );
+        // both anchored expressions (translated to equality) and unanchored
+        assert_change(
+            regex_match(col("c1"), lit("foo|^x$|baz")),

Review Comment:
   this is a pretty neat rewrite



-- 
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-unsubscribe@arrow.apache.org

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