david-mollitor-db commented on code in PR #58484:
URL: https://github.com/apache/spark/pull/58484#discussion_r3970607997


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -881,7 +923,10 @@ object LikeSimplification extends Rule[LogicalPlan] with 
PredicateHelper {
         // If pattern is null, return null value directly, since "col like 
null" == null.
         Literal(null, BooleanType)
       } else {
-        simplifyLike(input, pattern.toString, escapeChar).getOrElse(l)
+        val patternStr = pattern.toString
+        simplifyLike(input, patternStr, escapeChar)
+          .orElse(derivePrefixStartsWith(input, patternStr, escapeChar, l))

Review Comment:
   @stevomitric Updated. I have also identified another code path that lacked 
this gate: #58663



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