maropu commented on a change in pull request #25001: [SPARK-28083][SQL] Support 
LIKE ... ESCAPE syntax
URL: https://github.com/apache/spark/pull/25001#discussion_r308053733
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
 ##########
 @@ -175,7 +175,13 @@ class ExpressionParserSuite extends AnalysisTest {
 
   test("like expressions") {
     assertEqual("a like 'pattern%'", 'a like "pattern%")
+    assertEqual("a like 'pattern%' escape '#'", 'a.like("pattern%", "#"))
+    assertEqual("a like 'pattern%' escape '\"'", 'a.like("pattern%", "\""))
+    intercept("a like 'pattern%' escape '##'", "Escape string must be empty or 
one character.")
     assertEqual("a not like 'pattern%'", !('a like "pattern%"))
+    assertEqual("a not like 'pattern%' escape '#'", !('a.like("pattern%", 
"#")))
+    assertEqual("a not like 'pattern%' escape '\"'", !('a.like("pattern%", 
"\"")))
+    intercept("a not like 'pattern%' escape '\"/'", "Escape string must be 
empty or one character.")
     assertEqual("a rlike 'pattern%'", 'a rlike "pattern%")
 
 Review comment:
   Can you move these new assertions into a new test unit?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to