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 2022/08/29 16:03:40 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #37672: [SPARK-40228][SQL] Do not simplify multiLike if child is complex expression

cloud-fan commented on code in PR #37672:
URL: https://github.com/apache/spark/pull/37672#discussion_r957525963


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -771,6 +771,9 @@ object LikeSimplification extends Rule[LogicalPlan] {
     }
   }
 
+  private def isSimplifyMultiLike(child: Expression): Boolean =
+    child.isInstanceOf[Attribute] || child.foldable

Review Comment:
   OK, so multiple simple string operations is faster than a multi-like operation? Then I agree it's better to only optimize if input is a cheap expression. Can we reuse `CollapseProject.isCheap`?



-- 
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: reviews-unsubscribe@spark.apache.org

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


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