kumarUjjawal commented on code in PR #22361:
URL: https://github.com/apache/datafusion/pull/22361#discussion_r3271642542


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -677,6 +682,18 @@ impl ConstEvaluator {
                 }
                 true
             }
+            // Regex operators compile the right-hand pattern during
+            // evaluation. Avoid constant folding for literal patterns so
+            // planning does not pay that cost. See
+            // https://github.com/apache/datafusion/issues/22185.
+            Expr::BinaryExpr(BinaryExpr {
+                op:
+                    Operator::RegexMatch
+                    | Operator::RegexIMatch
+                    | Operator::RegexNotMatch
+                    | Operator::RegexNotIMatch,
+                ..
+            }) => false,

Review Comment:
   Adding test is better. 



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