You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/10 23:46:57 UTC

[GitHub] [spark] venkata91 commented on a change in pull request #24583: [SPARK-27679][SQL] Improve LIKE optimization

venkata91 commented on a change in pull request #24583: [SPARK-27679][SQL] Improve LIKE optimization
URL: https://github.com/apache/spark/pull/24583#discussion_r283070528
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
 ##########
 @@ -479,12 +479,15 @@ object LikeSimplification extends Rule[LogicalPlan] {
   private val startsAndEndsWith = "([^_%]+)%([^_%]+)".r
   private val contains = "%([^_%]+)%".r
   private val equalTo = "([^_%]*)".r
+  private val endsWithUnderscore = "([^_%]+)_".r
+  private val startsWithUnderscore = "_([^_%]+)".r
+  private val containsSingleUnderscore = "([^_%]+)_([^_%]+)".r
 
   def apply(plan: LogicalPlan): LogicalPlan = plan transformAllExpressions {
     case Like(input, Literal(pattern, StringType)) =>
       if (pattern == null) {
         // If pattern is null, return null value directly, since "col like null" == null.
 
 Review comment:
   Need to fix this comment? Why null is not a valid pattern?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org