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 2020/12/07 05:20:03 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #30625: [SPARK-33677][SQL] Skip LikeSimplification rule if escape is a wildcard character

cloud-fan commented on a change in pull request #30625:
URL: https://github.com/apache/spark/pull/30625#discussion_r537237966



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -3718,6 +3718,14 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
       }
     }
   }
+
+  test("SPARK-33677: LikeSimplification should be skipped if escape is a wildcard character") {
+    val e = intercept[AnalysisException] {
+      sql("SELECT string(rand()) LIKE 'm%aca' ESCAPE '%'").collect()

Review comment:
       so the problem is, we should only apply like simplification if the pattern is valid?




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



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