zhixingheyi-tian commented on code in PR #51510:
URL: https://github.com/apache/spark/pull/51510#discussion_r2215347853
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -743,10 +743,10 @@ object SupportedBinaryExpr {
object LikeSimplification extends Rule[LogicalPlan] with PredicateHelper {
// if guards below protect from escapes on trailing %.
// Cases like "something\%" are not optimized, but this does not affect
correctness.
- private val startsWith = "([^_%]+)%".r
- private val endsWith = "%([^_%]+)".r
- private val startsAndEndsWith = "([^_%]+)%([^_%]+)".r
- private val contains = "%([^_%]+)%".r
+ private val startsWith = "([^_%]+)%+".r
Review Comment:
According to automata theory, consecutive wildcard characters are equivalent
to a single wildcard character.
Have added the code comment.
--
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]