jduo commented on code in PR #3730:
URL: https://github.com/apache/calcite/pull/3730#discussion_r1529337605
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -3759,6 +3764,31 @@ static void checkRlikeFails(SqlOperatorFixture f) {
f1.checkBoolean("'ab\ncd\nef' ilike '%cde%'", false);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6309">[CALCITE-6309]
+ * Add REGEXP_LIKE function (enabled in MySQL, Oracle, PostgreSQL and Spark
libraries)</a>. */
+ @Test void testRegexpLike3() {
+ final SqlOperatorFixture f = fixture();
+ f.setFor(SqlLibraryOperators.REGEXP_LIKE, VmName.EXPAND);
+
+ final Consumer<SqlOperatorFixture> consumer = f1 -> {
+ f1.checkBoolean("REGEXP_LIKE('teststr', 'TEST', 'i')", true);
+ f1.checkBoolean("REGEXP_LIKE('ateststr', 'TEST', 'c')", false);
+ f1.checkBoolean("REGEXP_LIKE('atest\nstr', 'test.str', '')", false);
+ f1.checkBoolean("REGEXP_LIKE('atest\nstr', 'test.str', 'n')", true);
+ f1.checkBoolean("REGEXP_LIKE('atest\nstr', 'TEST.str', 'in')", true);
+ f1.checkBoolean("REGEXP_LIKE('ateststring', 'teststr', '')", true);
+ f1.checkBoolean("REGEXP_LIKE('ateststring', 'TESTstr', 'ic')", false);
+ f1.checkBoolean("REGEXP_LIKE('ateststring', 'TESTstr', 'ci')", true);
+ f1.checkBoolean("REGEXP_LIKE('atest\nstr', 'test.str', 's')", false);
+ f1.checkBoolean("REGEXP_LIKE('atest\nstr', 'test.str', 'ns')", false);
+ f1.checkBoolean("REGEXP_LIKE('atest\nstr', 'test.str', 'sn')", true);
Review Comment:
Done.
--
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]