raminqaf commented on code in PR #27898:
URL: https://github.com/apache/flink/pull/27898#discussion_r3043959721


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/ScalarFunctionsTest.scala:
##########
@@ -429,6 +446,13 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
 
   @Test
   def testLikeWithEscape(): Unit = {
+    // empty ESCAPE string: no escape character, _ and % retain wildcard 
semantics
+    testAllApis("abc".like("abc", ""), "'abc' LIKE 'abc' ESCAPE ''", "TRUE")
+    testAllApis("abd".like("abc", ""), "'abd' LIKE 'abc' ESCAPE ''", "FALSE")
+    testAllApis("abcdef".like("abc%", ""), "'abcdef' LIKE 'abc%' ESCAPE ''", 
"TRUE")
+    testAllApis("abcdef".like("%def", ""), "'abcdef' LIKE '%def' ESCAPE ''", 
"TRUE")
+    testAllApis("abcdef".like("%cd%", ""), "'abcdef' LIKE '%cd%' ESCAPE ''", 
"TRUE")

Review Comment:
   Can we add a test for this case please
   ```sql
   'abc_def' LIKE 'abc_def' ESCAPE ''
   ```



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

Reply via email to