You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2021/09/16 14:15:46 UTC

[ignite] branch sql-calcite updated: IGNITE-14991 Support posix regex operators - Fixes #9413.

This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a commit to branch sql-calcite
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/sql-calcite by this push:
     new ab45f93  IGNITE-14991 Support posix regex operators - Fixes #9413.
ab45f93 is described below

commit ab45f93178677aaf0030bf7fc8c18d90a072bcc3
Author: Aleksey Plekhanov <pl...@gmail.com>
AuthorDate: Thu Sep 16 17:13:25 2021 +0300

    IGNITE-14991 Support posix regex operators - Fixes #9413.
    
    Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
 modules/calcite/src/main/codegen/config.fmpp       |   2 +-
 .../src/main/codegen/includes/parserImpls.ftl      |   6 +
 .../query/calcite/exec/exp/RexImpTable.java        |  45 ++++--
 .../processors/query/calcite/FunctionsTest.java    |  56 +++++--
 .../sql/function/string/regex_filter_pushdown.test |  31 ++++
 .../string/regex_filter_pushdown.test_ignore       |  32 ----
 .../src/test/sql/function/string/regex_search.test | 142 ++++++++++++++++++
 .../sql/function/string/regex_search.test_ignore   | 167 ---------------------
 .../test/sql/function/string/test_similar_to.test  |  30 ++++
 .../function/string/test_similar_to.test_ignore    | 138 -----------------
 10 files changed, 290 insertions(+), 359 deletions(-)

diff --git a/modules/calcite/src/main/codegen/config.fmpp b/modules/calcite/src/main/codegen/config.fmpp
index 0ea6f78..302025b 100644
--- a/modules/calcite/src/main/codegen/config.fmpp
+++ b/modules/calcite/src/main/codegen/config.fmpp
@@ -650,7 +650,7 @@ data: {
       "parserImpls.ftl"
     ]
 
-    includePosixOperators: false
+    includePosixOperators: true
     includeCompoundIdentifier: true
     includeBraces: true
     includeAdditionalDeclarations: false
diff --git a/modules/calcite/src/main/codegen/includes/parserImpls.ftl b/modules/calcite/src/main/codegen/includes/parserImpls.ftl
index 512245b..d5e284c 100644
--- a/modules/calcite/src/main/codegen/includes/parserImpls.ftl
+++ b/modules/calcite/src/main/codegen/includes/parserImpls.ftl
@@ -391,3 +391,9 @@ SqlDrop SqlDropUser(Span s, boolean replace) :
         return new IgniteSqlDropUser(s.end(this), user);
     }
 }
+
+<DEFAULT, DQID, BTID> TOKEN :
+{
+    < NEGATE: "!" >
+|   < TILDE: "~" >
+}
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java
index 145503c..4c3f42c 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java
@@ -418,17 +418,18 @@ public class RexImpTable {
         map.put(NOT_SIMILAR_TO, NotImplementor.of(similarImplementor));
 
         // POSIX REGEX
-        final MethodImplementor posixRegexImplementor =
-            new MethodImplementor(BuiltInMethod.POSIX_REGEX.method,
-                NullPolicy.STRICT, false);
+        final MethodImplementor posixRegexImplementorCaseSensitive =
+            new PosixRegexMethodImplementor(true);
+        final MethodImplementor posixRegexImplementorCaseInsensitive =
+            new PosixRegexMethodImplementor(false);
         map.put(SqlStdOperatorTable.POSIX_REGEX_CASE_INSENSITIVE,
-            posixRegexImplementor);
+            posixRegexImplementorCaseInsensitive);
         map.put(SqlStdOperatorTable.POSIX_REGEX_CASE_SENSITIVE,
-            posixRegexImplementor);
+            posixRegexImplementorCaseSensitive);
         map.put(SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_INSENSITIVE,
-            NotImplementor.of(posixRegexImplementor));
+            NotImplementor.of(posixRegexImplementorCaseInsensitive));
         map.put(SqlStdOperatorTable.NEGATED_POSIX_REGEX_CASE_SENSITIVE,
-            NotImplementor.of(posixRegexImplementor));
+            NotImplementor.of(posixRegexImplementorCaseSensitive));
         map.put(REGEXP_REPLACE, new RegexpReplaceImplementor());
 
         // Multisets & arrays
@@ -1002,6 +1003,30 @@ public class RexImpTable {
     }
 
     /**
+     * Implementor for {@link org.apache.calcite.sql.fun.SqlPosixRegexOperator}s.
+     */
+    private static class PosixRegexMethodImplementor extends MethodImplementor {
+        /** */
+        protected final boolean caseSensitive;
+
+        /** Constructor. */
+        PosixRegexMethodImplementor(boolean caseSensitive) {
+            super(BuiltInMethod.POSIX_REGEX.method, NullPolicy.STRICT, false);
+            this.caseSensitive = caseSensitive;
+        }
+
+        /** {@inheritDoc} */
+        @Override Expression implementSafe(RexToLixTranslator translator,
+            RexCall call, List<Expression> argValueList) {
+            assert argValueList.size() == 2;
+            // Add extra parameter (caseSensitive boolean flag), required by SqlFunctions#posixRegex.
+            final List<Expression> newOperands = new ArrayList<>(argValueList);
+            newOperands.add(Expressions.constant(caseSensitive));
+            return super.implementSafe(translator, call, newOperands);
+        }
+    }
+
+    /**
      * Implementor for JSON_VALUE function, convert to solid format "JSON_VALUE(json_doc, path, empty_behavior,
      * empty_default, error_behavior, error default)" in order to simplify the runtime implementation.
      *
@@ -1714,14 +1739,14 @@ public class RexImpTable {
         private AbstractRexCallImplementor implementor;
 
         /** */
-        private NotImplementor(AbstractRexCallImplementor implementor) {
-            super(null, false);
+        private NotImplementor(NullPolicy nullPolicy, AbstractRexCallImplementor implementor) {
+            super(nullPolicy, false);
             this.implementor = implementor;
         }
 
         /** */
         static AbstractRexCallImplementor of(AbstractRexCallImplementor implementor) {
-            return new NotImplementor(implementor);
+            return new NotImplementor(implementor.nullPolicy, implementor);
         }
 
         /** {@inheritDoc} */
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/FunctionsTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/FunctionsTest.java
index 2c7d3a9..5bd22df 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/FunctionsTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/FunctionsTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.query.IgniteSQLException;
 import org.apache.ignite.internal.processors.query.QueryEngine;
 import org.apache.ignite.internal.processors.query.calcite.util.Commons;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -41,6 +42,9 @@ public class FunctionsTest extends GridCommonAbstractTest {
     /** */
     private static QueryEngine qryEngine;
 
+    /** */
+    private static final Object[] NULL_RESULT = new Object[] { null };
+
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
         Ignite grid = startGridsMultiThreaded(3);
@@ -52,7 +56,7 @@ public class FunctionsTest extends GridCommonAbstractTest {
     @Test
     public void testLength() {
         checkQuery("SELECT LENGTH('TEST')").returns(4).check();
-        checkQuery("SELECT LENGTH(NULL)").returns(new Object[] { null }).check();
+        checkQuery("SELECT LENGTH(NULL)").returns(NULL_RESULT).check();
     }
 
     /** */
@@ -100,9 +104,9 @@ public class FunctionsTest extends GridCommonAbstractTest {
     @Test
     public void testReplace() {
         checkQuery("SELECT REPLACE('12341234', '1', '55')").returns("5523455234").check();
-        checkQuery("SELECT REPLACE(NULL, '1', '5')").returns(new Object[] { null }).check();
-        checkQuery("SELECT REPLACE('1', NULL, '5')").returns(new Object[] { null }).check();
-        checkQuery("SELECT REPLACE('11', '1', NULL)").returns(new Object[] { null }).check();
+        checkQuery("SELECT REPLACE(NULL, '1', '5')").returns(NULL_RESULT).check();
+        checkQuery("SELECT REPLACE('1', NULL, '5')").returns(NULL_RESULT).check();
+        checkQuery("SELECT REPLACE('11', '1', NULL)").returns(NULL_RESULT).check();
         checkQuery("SELECT REPLACE('11', '1', '')").returns("").check();
     }
 
@@ -204,22 +208,22 @@ public class FunctionsTest extends GridCommonAbstractTest {
     public void testPercentRemainder() {
         checkQuery("SELECT 3 % 2").returns(1).check();
         checkQuery("SELECT 4 % 2").returns(0).check();
-        checkQuery("SELECT NULL % 2").returns(new Object[] { null }).check();
-        checkQuery("SELECT 3 % NULL::int").returns(new Object[] { null }).check();
-        checkQuery("SELECT 3 % NULL").returns(new Object[] { null }).check();
+        checkQuery("SELECT NULL % 2").returns(NULL_RESULT).check();
+        checkQuery("SELECT 3 % NULL::int").returns(NULL_RESULT).check();
+        checkQuery("SELECT 3 % NULL").returns(NULL_RESULT).check();
     }
 
     /** */
     @Test
     public void testNullFunctionArguments() {
         // Don't infer result data type from arguments (result is always INTEGER_NULLABLE).
-        checkQuery("SELECT ASCII(NULL)").returns(new Object[] { null }).check();
+        checkQuery("SELECT ASCII(NULL)").returns(NULL_RESULT).check();
         // Inferring result data type from first STRING argument.
-        checkQuery("SELECT REPLACE(NULL, '1', '2')").returns(new Object[] { null }).check();
+        checkQuery("SELECT REPLACE(NULL, '1', '2')").returns(NULL_RESULT).check();
         // Inferring result data type from both arguments.
-        checkQuery("SELECT MOD(1, null)").returns(new Object[] { null }).check();
+        checkQuery("SELECT MOD(1, null)").returns(NULL_RESULT).check();
         // Inferring result data type from first NUMERIC argument.
-        checkQuery("SELECT TRUNCATE(NULL, 0)").returns(new Object[] { null }).check();
+        checkQuery("SELECT TRUNCATE(NULL, 0)").returns(NULL_RESULT).check();
         // Inferring arguments data types and then inferring result data type from all arguments.
         checkQuery("SELECT FALSE AND NULL").returns(false).check();
     }
@@ -246,6 +250,36 @@ public class FunctionsTest extends GridCommonAbstractTest {
     }
 
     /** */
+    @Test
+    public void testRegex() {
+        checkQuery("SELECT 'abcd' ~ 'ab[cd]'").returns(true).check();
+        checkQuery("SELECT 'abcd' ~ 'ab[cd]$'").returns(false).check();
+        checkQuery("SELECT 'abcd' ~ 'ab[CD]'").returns(false).check();
+        checkQuery("SELECT 'abcd' ~* 'ab[cd]'").returns(true).check();
+        checkQuery("SELECT 'abcd' ~* 'ab[cd]$'").returns(false).check();
+        checkQuery("SELECT 'abcd' ~* 'ab[CD]'").returns(true).check();
+        checkQuery("SELECT 'abcd' !~ 'ab[cd]'").returns(false).check();
+        checkQuery("SELECT 'abcd' !~ 'ab[cd]$'").returns(true).check();
+        checkQuery("SELECT 'abcd' !~ 'ab[CD]'").returns(true).check();
+        checkQuery("SELECT 'abcd' !~* 'ab[cd]'").returns(false).check();
+        checkQuery("SELECT 'abcd' !~* 'ab[cd]$'").returns(true).check();
+        checkQuery("SELECT 'abcd' !~* 'ab[CD]'").returns(false).check();
+        checkQuery("SELECT null ~ 'ab[cd]'").returns(NULL_RESULT).check();
+        checkQuery("SELECT 'abcd' ~ null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null ~ null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null ~* 'ab[cd]'").returns(NULL_RESULT).check();
+        checkQuery("SELECT 'abcd' ~* null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null ~* null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null !~ 'ab[cd]'").returns(NULL_RESULT).check();
+        checkQuery("SELECT 'abcd' !~ null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null !~ null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null !~* 'ab[cd]'").returns(NULL_RESULT).check();
+        checkQuery("SELECT 'abcd' !~* null").returns(NULL_RESULT).check();
+        checkQuery("SELECT null !~* null").returns(NULL_RESULT).check();
+        assertThrows("SELECT 'abcd' ~ '\\X'", IgniteSQLException.class, null);
+    }
+
+    /** */
     private void assertThrows(String qry, Class<? extends Throwable> cls, String msg) {
         GridTestUtils.assertThrowsAnyCause(
             log,
diff --git a/modules/calcite/src/test/sql/function/string/regex_filter_pushdown.test b/modules/calcite/src/test/sql/function/string/regex_filter_pushdown.test
new file mode 100644
index 0000000..7f4fd45
--- /dev/null
+++ b/modules/calcite/src/test/sql/function/string/regex_filter_pushdown.test
@@ -0,0 +1,31 @@
+# name: test/sql/function/string/regex_filter_pushdown.test
+# description: regex filter push test
+# group: [string]
+
+statement ok
+CREATE TABLE regex(s VARCHAR)
+
+statement ok
+INSERT INTO regex VALUES ('asdf'), ('xxxx'), ('aaaa')
+
+query T
+SELECT s FROM regex WHERE s ~ 'as(c|d|e)f'
+----
+asdf
+
+query T
+SELECT s FROM regex WHERE s !~ 'as(c|d|e)f' ORDER BY 1
+----
+aaaa
+xxxx
+
+query T
+SELECT s FROM regex WHERE s ~ 'as(c|d|e)f' AND s = 'asdf'
+----
+asdf
+
+query T
+SELECT s FROM regex WHERE s ~ 'as(c|d|e)f' AND s ~ 'as[a-z]f'
+----
+asdf
+
diff --git a/modules/calcite/src/test/sql/function/string/regex_filter_pushdown.test_ignore b/modules/calcite/src/test/sql/function/string/regex_filter_pushdown.test_ignore
deleted file mode 100644
index 7806268..0000000
--- a/modules/calcite/src/test/sql/function/string/regex_filter_pushdown.test_ignore
+++ /dev/null
@@ -1,32 +0,0 @@
-# name: test/sql/function/string/regex_filter_pushdown.test
-# description: regex filter push test
-# group: [string]
-# Ignored: https://issues.apache.org/jira/browse/IGNITE-14991
-
-statement ok
-CREATE TABLE regex(s VARCHAR)
-
-statement ok
-INSERT INTO regex VALUES ('asdf'), ('xxxx'), ('aaaa')
-
-query T
-SELECT s FROM regex WHERE REGEXP_MATCHES(s, 'as(c|d|e)f')
-----
-asdf
-
-query T
-SELECT s FROM regex WHERE NOT REGEXP_MATCHES(s, 'as(c|d|e)f')
-----
-xxxx
-aaaa
-
-query T
-SELECT s FROM regex WHERE REGEXP_MATCHES(s, 'as(c|d|e)f') AND s = 'asdf'
-----
-asdf
-
-query T
-SELECT s FROM regex WHERE REGEXP_MATCHES(s, 'as(c|d|e)f') AND REGEXP_MATCHES(s, 'as[a-z]f')
-----
-asdf
-
diff --git a/modules/calcite/src/test/sql/function/string/regex_search.test b/modules/calcite/src/test/sql/function/string/regex_search.test
new file mode 100644
index 0000000..3796867
--- /dev/null
+++ b/modules/calcite/src/test/sql/function/string/regex_search.test
@@ -0,0 +1,142 @@
+# name: test/sql/function/string/regex_search.test
+# description: regex search test
+# group: [string]
+
+# constant strings
+query T
+SELECT 'asdf' ~ '.*sd.*'
+----
+true
+
+query T
+SELECT 'asdf' ~ '.*yu.*'
+----
+false
+
+query T
+SELECT 'asdf' ~ ''
+----
+true
+
+# partial matches okay
+query T
+SELECT 'asdf' ~ 'sd'
+----
+true
+
+query T
+SELECT 'asdf' ~ '^sd$'
+----
+false
+
+query T
+SELECT 'asdf' ~ '^.sd.$'
+----
+true
+
+query T
+SELECT 'asdf' ~ '^sdf$'
+----
+false
+
+# empty strings
+query T
+SELECT '' ~ '.*yu.*'
+----
+false
+
+query T
+SELECT '' ~ '.*'
+----
+true
+
+# NULLs
+query T
+SELECT 'asdf' ~ CAST(NULL AS VARCHAR)
+----
+NULL
+
+query T
+SELECT CAST(NULL AS VARCHAR) ~ '.*sd.*'
+----
+NULL
+
+query T
+SELECT CAST(NULL AS VARCHAR) ~ CAST(NULL AS VARCHAR)
+----
+NULL
+
+query T
+SELECT 'foobarbequebaz' ~ '(bar)(beque)'
+----
+true
+
+# postgres says throw error on invalid regex
+statement error
+SELECT '' ~ '\X'
+
+statement ok
+CREATE TABLE regex(s VARCHAR, p VARCHAR)
+
+statement ok
+INSERT INTO regex VALUES ('asdf', 'sd'), ('asdf', '^sd'), (NULL, '^sd'), ('asdf', NULL)
+
+query T
+SELECT s ~ '.*' FROM regex ORDER BY s
+----
+NULL
+true
+true
+true
+
+query T
+SELECT s ~ p FROM regex order by s, p
+----
+NULL
+NULL
+false
+true
+
+# test regex with case sensitivity
+query T
+SELECT 'asdf' ~* '.*SD.*'
+----
+true
+
+query T
+SELECT 'asdf' ~ '.*SD.*'
+----
+false
+
+# newlines
+query T
+SELECT 'hello
+world' ~ '.*'
+----
+true
+
+query T
+SELECT 'hello
+world' ~ '^.*$'
+----
+true
+
+# this also works with tables
+statement ok
+CREATE TABLE test(v VARCHAR);
+
+statement ok
+INSERT INTO test VALUES ('hello'), ('HELLO');
+
+query T
+SELECT v ~* 'h.*' FROM test ORDER BY v
+----
+true
+true
+
+query T
+SELECT v ~ 'h.*' FROM test ORDER BY v
+----
+false
+true
+
diff --git a/modules/calcite/src/test/sql/function/string/regex_search.test_ignore b/modules/calcite/src/test/sql/function/string/regex_search.test_ignore
deleted file mode 100644
index 04823ff..0000000
--- a/modules/calcite/src/test/sql/function/string/regex_search.test_ignore
+++ /dev/null
@@ -1,167 +0,0 @@
-# name: test/sql/function/string/regex_search.test
-# description: regex search test
-# group: [string]
-# Ignored: https://issues.apache.org/jira/browse/IGNITE-14991
-
-# constant strings
-query T
-SELECT regexp_matches('asdf', '.*sd.*')
-----
-1
-
-query T
-SELECT regexp_matches('asdf', '.*yu.*')
-----
-0
-
-query T
-SELECT regexp_matches('asdf', '')
-----
-1
-
-# partial matches okay
-query T
-SELECT regexp_matches('asdf', 'sd')
-----
-1
-
-query T
-SELECT regexp_full_match('asdf', 'sd')
-----
-0
-
-query T
-SELECT regexp_full_match('asdf', '.sd.')
-----
-1
-
-query T
-SELECT regexp_matches('asdf', '^sdf$')
-----
-0
-
-# empty strings
-query T
-SELECT regexp_matches('', '.*yu.*')
-----
-0
-
-query T
-SELECT regexp_matches('', '.*')
-----
-1
-
-# NULLs
-query T
-SELECT regexp_matches('asdf', CAST(NULL AS STRING))
-----
-NULL
-
-query T
-SELECT regexp_matches(CAST(NULL AS STRING), '.*sd.*')
-----
-NULL
-
-query T
-SELECT regexp_matches(CAST(NULL AS STRING), CAST(NULL AS STRING))
-----
-NULL
-
-query T
-SELECT regexp_matches('foobarbequebaz', '(bar)(beque)')
-----
-1
-
-# postgres says throw error on invalid regex
-statement error
-SELECT regexp_matches('', '\X')
-
-statement ok
-CREATE TABLE regex(s STRING, p STRING)
-
-statement ok
-INSERT INTO regex VALUES ('asdf', 'sd'), ('asdf', '^sd'), (NULL, '^sd'), ('asdf', NULL)
-
-query T
-SELECT regexp_matches(s, '.*') FROM regex
-----
-1
-1
-NULL
-1
-
-query T
-SELECT regexp_matches(s, p) FROM regex
-----
-1
-0
-NULL
-NULL
-
-# test regex_matches with options
-# case sensitivity
-query T
-SELECT regexp_matches('asdf', '.*SD.*', 'i')
-----
-1
-
-query T
-SELECT regexp_matches('asdf', '.*SD.*', 'c')
-----
-0
-
-# dot matches newline
-query T
-SELECT regexp_matches('hello
-world', '.*', 's')
-----
-1
-
-query T
-SELECT regexp_full_match('hello
-world', '.*', 'n')
-----
-0
-
-# whitespace is ignored
-query T
-SELECT regexp_matches('asdf', '.*SD.*', ' i 	')
-----
-1
-
-# NULL in options is ignored
-query T
-SELECT regexp_matches('asdf', '.*SD.*', NULL)
-----
-0
-
-# this also works with tables
-statement ok
-CREATE TABLE test(v VARCHAR);
-
-statement ok
-INSERT INTO test VALUES ('hello'), ('HELLO');
-
-query T
-SELECT regexp_matches(v, 'h.*', 'i') FROM test ORDER BY v
-----
-1
-1
-
-query T
-SELECT regexp_matches(v, 'h.*', 'c') FROM test ORDER BY v
-----
-0
-1
-
-statement error
-SELECT regexp_matches(v, 'h.*', v) FROM test ORDER BY v
-
-# throw on invalid options
-statement error
-SELECT regexp_matches('asdf', '.*SD.*', 'q')
-
-# can only use "g" with regexp replace
-statement error
-SELECT regexp_matches('asdf', '.*SD.*', 'g')
-
diff --git a/modules/calcite/src/test/sql/function/string/test_similar_to.test b/modules/calcite/src/test/sql/function/string/test_similar_to.test
index 3a0be50..1adc815 100644
--- a/modules/calcite/src/test/sql/function/string/test_similar_to.test
+++ b/modules/calcite/src/test/sql/function/string/test_similar_to.test
@@ -67,6 +67,36 @@ SELECT 'aaa' NOT SIMILAR TO '[b-z]{3}'
 ----
 true
 
+query T
+SELECT 'aaa' ~ 'aaa'
+----
+true
+
+query T
+SELECT 'aaa' !~ 'bbb'
+----
+true
+
+# posix regex can match any part of expression
+query T
+SELECT 'aaa' ~ '^a'
+----
+true
+
+query T
+SELECT 'aaa' ~ '^a+'
+----
+true
+
+query T
+SELECT 'aaa' ~ '(a|b)*'
+----
+true
+
+query T
+SELECT 'abc' ~ '^(b|c)'
+----
+false
 
 # Test SIMILAR TO statement with expressions
 statement ok
diff --git a/modules/calcite/src/test/sql/function/string/test_similar_to.test_ignore b/modules/calcite/src/test/sql/function/string/test_similar_to.test_ignore
deleted file mode 100644
index 8048a0e..0000000
--- a/modules/calcite/src/test/sql/function/string/test_similar_to.test_ignore
+++ /dev/null
@@ -1,138 +0,0 @@
-# name: test/sql/function/string/test_similar_to.test
-# description: Test SIMILAR TO statement
-# group: [string]
-# Ignored: https://issues.apache.org/jira/browse/IGNITE-14991
-
-query T
-SELECT 'aaa' SIMILAR TO 'bbb'
-----
-false
-
-query T
-SELECT 'aaa' SIMILAR TO 'aaa'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO '.*'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO 'a.*'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO '.*a'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO '.*b'
-----
-false
-
-query T
-SELECT 'aaa' SIMILAR TO 'b.*'
-----
-false
-
-query T
-SELECT 'aaa' SIMILAR TO 'a[a-z]a'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO 'a[a-z]{2}'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO 'a[a-z].*'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO '[a-z][a-z].*'
-----
-true
-
-query T
-SELECT 'aaa' SIMILAR TO '[a-z]{3}'
-----
-true
-
-query T
-SELECT 'aaa' NOT SIMILAR TO '[b-z]{3}'
-----
-true
-
-query T
-SELECT 'aaa' ~ 'aaa'
-----
-true
-
-query T
-SELECT 'aaa' !~ 'bbb'
-----
-true
-
-# similar to must match entire expression
-query T
-SELECT 'aaa' ~ '^a'
-----
-false
-
-query T
-SELECT 'aaa' ~ '^a+'
-----
-true
-
-query T
-SELECT 'aaa' ~ '(a|b)*'
-----
-true
-
-query T
-SELECT 'abc' ~ '^(b|c)'
-----
-false
-
-# Test SIMILAR TO statement with expressions
-statement ok
-CREATE TABLE strings (s STRING, p STRING);
-
-statement ok
-INSERT INTO strings VALUES('aaa', 'a[a-z]a'), ('abab', 'ab.*'), ('aaa', 'a[a-z]a'), ('aaa', '.*b.*');
-
-
-query T
-SELECT s FROM strings WHERE s SIMILAR TO 'ab.*'
-----
-abab
-
-query T
-SELECT s FROM strings WHERE 'aba' SIMILAR TO p
-----
-aaa
-abab
-aaa
-aaa
-
-query T
-SELECT s FROM strings WHERE s SIMILAR TO p
-----
-aaa
-abab
-aaa
-
-query T
-SELECT s FROM strings WHERE s NOT SIMILAR TO p
-----
-aaa
-
-# invalid SIMILAR TO expression
-statement error
-SELECT s FROM strings WHERE s SIMILAR TO 'ab.*%' {escape ''}
-