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/08 15:09:51 UTC

[ignite] branch sql-calcite updated: IGNITE-14596 Add TypeOf SQL function - Fixes #9382.

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 feb6ba0  IGNITE-14596 Add TypeOf SQL function - Fixes #9382.
feb6ba0 is described below

commit feb6ba070201223ea6fc054ff7e1988f30808d39
Author: Aleksey Plekhanov <pl...@gmail.com>
AuthorDate: Wed Sep 8 18:07:34 2021 +0300

    IGNITE-14596 Add TypeOf SQL function - Fixes #9382.
    
    Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
 .../query/calcite/exec/exp/RexImpTable.java        |   7 +
 .../calcite/sql/fun/IgniteSqlOperatorTable.java    |  12 ++
 .../processors/query/calcite/FunctionsTest.java    |  28 ++-
 .../test/sql/types/decimal/decimal_aggregates.test |   7 +-
 .../types/decimal/decimal_aggregates.test_ignored  |   3 +-
 .../test/sql/types/decimal/decimal_arithmetic.test |   5 +
 .../types/decimal/decimal_arithmetic.test_ignored  | 204 ---------------------
 .../sql/types/decimal/large_decimal_constants.test |  21 +++
 .../decimal/large_decimal_constants.test_ignored   |  44 -----
 .../src/test/sql/types/decimal/test_decimal.test   |   6 +
 .../sql/types/decimal/test_decimal.test_ignored    | 152 ---------------
 .../src/test/sql/types/map/test_map.test_ignored   |  36 ----
 12 files changed, 84 insertions(+), 441 deletions(-)

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 f291190..145503c 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
@@ -252,6 +252,7 @@ import static org.apache.calcite.sql.fun.SqlStdOperatorTable.UPPER;
 import static org.apache.calcite.sql.fun.SqlStdOperatorTable.USER;
 import static org.apache.ignite.internal.processors.query.calcite.sql.fun.IgniteSqlOperatorTable.LENGTH;
 import static org.apache.ignite.internal.processors.query.calcite.sql.fun.IgniteSqlOperatorTable.SYSTEM_RANGE;
+import static org.apache.ignite.internal.processors.query.calcite.sql.fun.IgniteSqlOperatorTable.TYPEOF;
 
 /**
  * Contains implementations of Rex operators as Java code.
@@ -552,6 +553,7 @@ public class RexImpTable {
         map.put(CURRENT_DATE, systemFunctionImplementor);
         map.put(LOCALTIME, systemFunctionImplementor);
         map.put(LOCALTIMESTAMP, systemFunctionImplementor);
+        map.put(TYPEOF, systemFunctionImplementor);
     }
 
     /** */
@@ -1696,6 +1698,11 @@ public class RexImpTable {
                     return createTableFunctionImplementor(IgniteBuiltInMethod.SYSTEM_RANGE3.method)
                         .implement(translator, call, NullAs.NULL);
             }
+            else if (op == TYPEOF) {
+                assert call.getOperands().size() == 1 : call.getOperands();
+
+                return Expressions.constant(call.getOperands().get(0).getType().toString());
+            }
 
             throw new AssertionError("unknown function " + op);
         }
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteSqlOperatorTable.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteSqlOperatorTable.java
index 42925b7..d4c2674 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteSqlOperatorTable.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/sql/fun/IgniteSqlOperatorTable.java
@@ -50,6 +50,18 @@ public class IgniteSqlOperatorTable extends ReflectiveSqlOperatorTable {
     public static final SqlFunction SYSTEM_RANGE = new SqlSystemRangeFunction();
 
     /**
+     *
+     */
+    public static final SqlFunction TYPEOF =
+        new SqlFunction(
+            "TYPEOF",
+            SqlKind.OTHER_FUNCTION,
+            ReturnTypes.VARCHAR_2000,
+            null,
+            OperandTypes.ANY,
+            SqlFunctionCategory.SYSTEM);
+
+    /**
      * Returns the Ignite operator table, creating it if necessary.
      */
     public static synchronized IgniteSqlOperatorTable instance() {
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 eb9c601..2c7d3a9 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
@@ -22,6 +22,7 @@ import java.sql.Time;
 import java.sql.Timestamp;
 import java.util.List;
 import java.util.function.LongFunction;
+import org.apache.calcite.sql.validate.SqlValidatorException;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -138,8 +139,7 @@ public class FunctionsTest extends GridCommonAbstractTest {
         assertEquals(0, qryEngine.query(null, "PUBLIC",
             "SELECT * FROM table(system_range(null, 1))").get(0).getAll().size());
 
-        GridTestUtils.assertThrowsAnyCause(log, () -> qryEngine.query(null, "PUBLIC",
-            "SELECT * FROM table(system_range(1, 1, 0))").get(0).getAll(), IllegalArgumentException.class,
+        assertThrows("SELECT * FROM table(system_range(1, 1, 0))", IllegalArgumentException.class,
             "Increment can't be 0");
     }
 
@@ -232,6 +232,30 @@ public class FunctionsTest extends GridCommonAbstractTest {
     }
 
     /** */
+    @Test
+    public void testTypeOf() {
+        checkQuery("SELECT TYPEOF(1)").returns("INTEGER").check();
+        checkQuery("SELECT TYPEOF(1.1::DOUBLE)").returns("DOUBLE").check();
+        checkQuery("SELECT TYPEOF(1.1::DECIMAL(3, 2))").returns("DECIMAL(3, 2)").check();
+        checkQuery("SELECT TYPEOF('a')").returns("CHAR(1)").check();
+        checkQuery("SELECT TYPEOF('a'::varchar(1))").returns("VARCHAR(1)").check();
+        checkQuery("SELECT TYPEOF(NULL)").returns("NULL").check();
+        checkQuery("SELECT TYPEOF(NULL::VARCHAR(100))").returns("VARCHAR(100)").check();
+        assertThrows("SELECT TYPEOF()", SqlValidatorException.class, "Invalid number of arguments");
+        assertThrows("SELECT TYPEOF(1, 2)", SqlValidatorException.class, "Invalid number of arguments");
+    }
+
+    /** */
+    private void assertThrows(String qry, Class<? extends Throwable> cls, String msg) {
+        GridTestUtils.assertThrowsAnyCause(
+            log,
+            () -> qryEngine.query(null, "PUBLIC", qry).get(0).getAll(),
+            cls,
+            msg
+        );
+    }
+
+    /** */
     private QueryChecker checkQuery(String qry) {
         return new QueryChecker(qry) {
             @Override protected QueryEngine getEngine() {
diff --git a/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test b/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test
index 2681cef..c6fe9b9 100644
--- a/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test
+++ b/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test
@@ -5,6 +5,11 @@
 statement ok
 PRAGMA enable_verification
 
+query I
+SELECT typeof(ANY_VALUE('0.1'::DECIMAL(4,1)))
+----
+DECIMAL(4, 1)
+
 # scalar aggregates
 # first
 query IIIII
@@ -15,7 +20,7 @@ SELECT ANY_VALUE(NULL::DECIMAL),
        ANY_VALUE('4567645908450368043562342564564938245.1'::DECIMAL(38,1))::VARCHAR
 ----
 NULL
-.1
+0.1
 4938245.1
 45672564564938245.1
 4567645908450368043562342564564938245.1
diff --git a/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test_ignored b/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test_ignored
index af4b860..fca12be 100644
--- a/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test_ignored
+++ b/modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test_ignored
@@ -2,7 +2,6 @@
 # description: Test decimal aggregates
 # group: [decimal]
 # Ignore: https://issues.apache.org/jira/browse/IGNITE-14555
-# Ignore: https://issues.apache.org/jira/browse/IGNITE-14596
 
 statement ok
 PRAGMA enable_verification
@@ -10,7 +9,7 @@ PRAGMA enable_verification
 query I
 SELECT typeof(ANY_VALUE('0.1'::DECIMAL(4,1)))
 ----
-DECIMAL(4,1)
+DECIMAL(4, 1)
 
 # scalar aggregates
 # first
diff --git a/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test b/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test
index cc9947a..1bd60e5 100644
--- a/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test
+++ b/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test
@@ -117,6 +117,11 @@ SELECT '0.1'::DECIMAL * '10.0'::DECIMAL
 1.0
 
 query I
+SELECT typeof('0.1'::DECIMAL(2,1) * '10.0'::DECIMAL(3,1))
+----
+DECIMAL(5, 2)
+
+query I
 SELECT '0.1'::DECIMAL * '0.1'::DECIMAL
 ----
 0.01
diff --git a/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test_ignored b/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test_ignored
deleted file mode 100644
index dd04391..0000000
--- a/modules/calcite/src/test/sql/types/decimal/decimal_arithmetic.test_ignored
+++ /dev/null
@@ -1,204 +0,0 @@
-# name: test/sql/types/decimal/decimal_arithmetic.test
-# description: Test basic decimals
-# group: [decimal]
-# Ignore: https://issues.apache.org/jira/browse/IGNITE-14596
-
-statement ok
-PRAGMA enable_verification
-
-# negate
-query II
-SELECT -('0.1'::DECIMAL), -('-0.1'::DECIMAL)
-----
--0.1	0.1
-
-# unary +
-query II
-SELECT +('0.1'::DECIMAL), +('-0.1'::DECIMAL)
-----
-0.1	-0.1
-
-# addition
-query I
-SELECT '0.1'::DECIMAL + '0.1'::DECIMAL
-----
-0.2
-
-# addition with non-decimal
-query I
-SELECT '0.1'::DECIMAL + 1::INTEGER
-----
-1.1
-
-# addition that would overflow the base types
-query I
-SELECT '0.5'::DECIMAL(4,4) + '0.5'::DECIMAL(4,4)
-----
-1.0
-
-# addition between different decimal types
-query I
-SELECT '0.5'::DECIMAL(1,1) + '100.0'::DECIMAL(3,0)
-----
-100.5
-
-# test decimals and integers with big decimals
-query IIIIII
-SELECT ('0.5'::DECIMAL(1,1) + 10000)::VARCHAR,
-       ('0.54321'::DECIMAL(5,5) + 10000)::VARCHAR,
-       ('0.5432154321'::DECIMAL(10,10) + 10000)::VARCHAR,
-       ('0.543215432154321'::DECIMAL(15,15) + 10000::DECIMAL(20,15))::VARCHAR,
-       ('0.54321543215432154321'::DECIMAL(20,20) + 10000)::VARCHAR,
-       ('0.5432154321543215432154321'::DECIMAL(25,25) + 10000)::VARCHAR
-----
-10000.5
-10000.54321
-10000.5432154321
-10000.543215432154321
-10000.54321543215432154321
-10000.5432154321543215432154321
-
-# out of range
-statement error
-SELECT ('0.54321543215432154321543215432154321'::DECIMAL(35,35) + 10000)::VARCHAR
-
-# different types
-query IIIII
-SELECT '0.5'::DECIMAL(1,1) + 1::TINYINT,
-       '0.5'::DECIMAL(1,1) + 1::SMALLINT,
-       '0.5'::DECIMAL(1,1) + 1::INTEGER,
-       '0.5'::DECIMAL(1,1) + 1::BIGINT,
-       '0.5'::DECIMAL(1,1) + 1::HUGEINT
-----
-1.5	1.5	1.5	1.5	1.5
-
-# negative numbers
-query IIIII
-SELECT '0.5'::DECIMAL(1,1) + -1::TINYINT,
-       '0.5'::DECIMAL(1,1) + -1::SMALLINT,
-       '0.5'::DECIMAL(1,1) + -1::INTEGER,
-       '0.5'::DECIMAL(1,1) + -1::BIGINT,
-       '0.5'::DECIMAL(1,1) + -1::HUGEINT
-----
--0.5	-0.5	-0.5	-0.5	-0.5
-
-# subtract
-query IIIII
-SELECT '0.5'::DECIMAL(1,1) - 1::TINYINT,
-       '0.5'::DECIMAL(1,1) - 1::SMALLINT,
-       '0.5'::DECIMAL(1,1) - 1::INTEGER,
-       '0.5'::DECIMAL(1,1) - 1::BIGINT,
-       '0.5'::DECIMAL(1,1) - 1::HUGEINT
-----
--0.5	-0.5	-0.5	-0.5	-0.5
-
-# negative numbers
-query IIIII
-SELECT '0.5'::DECIMAL(1,1) - -1::TINYINT,
-       '0.5'::DECIMAL(1,1) - -1::SMALLINT,
-       '0.5'::DECIMAL(1,1) - -1::INTEGER,
-       '0.5'::DECIMAL(1,1) - -1::BIGINT,
-       '0.5'::DECIMAL(1,1) - -1::HUGEINT
-----
-1.5	1.5	1.5	1.5	1.5
-
-# now with a table
-statement ok
-CREATE TABLE decimals(d DECIMAL(3, 2));
-
-statement ok
-INSERT INTO decimals VALUES ('0.1'), ('0.2');
-
-query II
-SELECT d + '0.1'::DECIMAL, d + 10000 FROM decimals;
-----
-0.2	10000.1
-0.3	10000.2
-
-# multiplication
-query I
-SELECT '0.1'::DECIMAL * '10.0'::DECIMAL
-----
-1.0
-
-query I
-SELECT typeof('0.1'::DECIMAL(2,1) * '10.0'::DECIMAL(3,1))
-----
-DECIMAL(5,2)
-
-query I
-SELECT '0.1'::DECIMAL * '0.1'::DECIMAL
-----
-0.01
-
-# multiplication with non-decimal
-query I
-SELECT '0.1'::DECIMAL * 10::INTEGER
-----
-1.0
-
-# multiplication that would overflow the base types
-query I
-SELECT '5.0'::DECIMAL(4,3) * '5.0'::DECIMAL(4,3)
-----
-25.0
-
-# negative multiplication
-query I
-SELECT '-5.0'::DECIMAL(4,3) * '5.0'::DECIMAL(4,3)
-----
--25.0
-
-# no precision is lost
-query I
-SELECT ('18.25'::DECIMAL(4,2) * '17.25'::DECIMAL(4,2))::VARCHAR
-----
-314.8125
-
-# different types
-query IIIII
-SELECT '0.001'::DECIMAL * 100::TINYINT,
-       '0.001'::DECIMAL * 10000::SMALLINT,
-       '0.001'::DECIMAL * 1000000::INTEGER,
-       '0.001'::DECIMAL * 100000000::BIGINT,
-       '0.001'::DECIMAL * 10000000000::HUGEINT
-----
-0.100
-10.000
-1000.000
-100000.000
-10000000.000
-
-# multiplication could not be performed exactly: throw error
-statement error
-SELECT '0.000000000000000000000000000001'::DECIMAL(38,30) * '0.000000000000000000000000000001'::DECIMAL(38,30)
-
-# test addition, subtraction and multiplication with various scales and precisions
-query IIII
-SELECT 2.0 + 1.0,
-       2.0000 + 1.0000,
-       2.000000000000 + 1.000000000000,
-       2.00000000000000000000 + 1.00000000000000000000
-----
-3.0
-3.0000
-3.000000000000
-3.00000000000000000000
-
-query IIII
-SELECT 2.0 - 1.0,
-       2.0000 - 1.0000,
-       2.000000000000 - 1.000000000000,
-       2.00000000000000000000 - 1.00000000000000000000
-----
-1.0
-1.0000
-1.000000000000
-1.00000000000000000000
-
-query II
-SELECT 2.0 * 1.0,
-       2.0000 * 1.0000
-----
-2.0
-2.0000
diff --git a/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test b/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test
index 953e64b..902188c 100644
--- a/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test
+++ b/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test
@@ -11,6 +11,16 @@ SELECT 42.1, -10239814.1, 1049185157.12345, 102398294123451814.12345, -492384092
 102398294123451814.12345
 -49238409238403918140294812084.12490812490
 
+query IIIII
+SELECT typeof(42.1), typeof(-10239814.1), typeof(1049185157.12345), typeof(102398294123451814.12345), typeof(-49238409238403918140294812084.12490812490)
+----
+DECIMAL(3, 1)
+DECIMAL(9, 1)
+DECIMAL(15, 5)
+DECIMAL(23, 5)
+DECIMAL(40, 11)
+
+
 query IIIIII
 SELECT 42., 42e3, 4.23e1, 10e20, .34, - 2.3
 ----
@@ -20,3 +30,14 @@ SELECT 42., 42e3, 4.23e1, 10e20, .34, - 2.3
 1000000000000000000000
 0.34
 -2.3
+
+query IIIIIII
+SELECT typeof(42.), typeof(42e3), typeof(4.23e1), typeof(10e20), typeof(.34), typeof(-2.3), typeof(10e100)
+----
+INTEGER
+DOUBLE
+DOUBLE
+DOUBLE
+DECIMAL(2, 2)
+DECIMAL(2, 1)
+DOUBLE
diff --git a/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test_ignored b/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test_ignored
deleted file mode 100644
index 660c493..0000000
--- a/modules/calcite/src/test/sql/types/decimal/large_decimal_constants.test_ignored
+++ /dev/null
@@ -1,44 +0,0 @@
-# name: test/sql/types/decimal/large_decimal_constants.test
-# description: Test large decimal constants
-# group: [decimal]
-# Ignore: https://issues.apache.org/jira/browse/IGNITE-14596
-
-query IIIII
-SELECT 42.1, -10239814.1, 1049185157.12345, 102398294123451814.12345, -49238409238403918140294812084.12490812490
-----
-42.1
--10239814.1
-1049185157.12345
-102398294123451814.12345
--49238409238403918140294812084.12490812490
-
-query IIIII
-SELECT typeof(42.1), typeof(-10239814.1), typeof(1049185157.12345), typeof(102398294123451814.12345), typeof(-49238409238403918140294812084.12490812490)
-----
-DECIMAL(3,1)
-DECIMAL(9,1)
-DECIMAL(15,5)
-DECIMAL(23,5)
-DOUBLE
-
-
-query IIIIII
-SELECT 42., 42e3, 4.23e1, 10e20, .34, - 2.3
-----
-42
-42000
-42.3
-1000000000000000000000
-0.34
--2.3
-
-query IIIIIII
-SELECT typeof(42.), typeof(42e3), typeof(4.23e1), typeof(10e20), typeof(.34), typeof(-2.3), typeof(10e100)
-----
-DECIMAL(2,0)
-DOUBLE
-DOUBLE
-DOUBLE
-DECIMAL(2,2)
-DECIMAL(2,1)
-DOUBLE
diff --git a/modules/calcite/src/test/sql/types/decimal/test_decimal.test b/modules/calcite/src/test/sql/types/decimal/test_decimal.test
index d3d2154..8345ce5 100644
--- a/modules/calcite/src/test/sql/types/decimal/test_decimal.test
+++ b/modules/calcite/src/test/sql/types/decimal/test_decimal.test
@@ -5,6 +5,12 @@
 statement ok
 PRAGMA enable_verification
 
+# default decimal type is (32767, 0), see IgniteTypeSystem.getMaxNumericPrecision
+query I
+SELECT typeof('0.1'::DECIMAL);
+----
+DECIMAL(32767, 0)
+
 # test basic string conversions
 query II
 SELECT '0.1'::DECIMAL::VARCHAR, '922337203685478.758'::DECIMAL::VARCHAR;
diff --git a/modules/calcite/src/test/sql/types/decimal/test_decimal.test_ignored b/modules/calcite/src/test/sql/types/decimal/test_decimal.test_ignored
deleted file mode 100644
index f7d256e..0000000
--- a/modules/calcite/src/test/sql/types/decimal/test_decimal.test_ignored
+++ /dev/null
@@ -1,152 +0,0 @@
-# name: test/sql/types/decimal/test_decimal.test
-# description: Test basic decimals
-# group: [decimal]
-# Ignore: https://issues.apache.org/jira/browse/IGNITE-14596
-
-statement ok
-PRAGMA enable_verification
-
-# default decimal type is (18,3)
-query I
-SELECT typeof('0.1'::DECIMAL);
-----
-DECIMAL(18,3)
-
-# test basic string conversions
-query II
-SELECT '0.1'::DECIMAL::VARCHAR, '922337203685478.758'::DECIMAL::VARCHAR;
-----
-0.1	922337203685478.758
-
-# negative values
-query II
-SELECT '-0.1'::DECIMAL::VARCHAR, '-922337203685478.758'::DECIMAL::VARCHAR;
-----
--0.1	-922337203685478.758
-
-# some more difficult string conversions
-query III
-SELECT '   7   '::DECIMAL::VARCHAR, '9.'::DECIMAL::VARCHAR, '.1'::DECIMAL::VARCHAR;
-----
-7	9	0.1
-
-# trailing decimals get truncated
-query II
-SELECT '0.123456789'::DECIMAL::VARCHAR, '-0.123456789'::DECIMAL::VARCHAR;
-----
-0.123456789	-0.123456789
-
-# overflow in conversion
-statement error
-SELECT '9223372036854788.758'::DECIMAL;
-
-# trailing decimals with scale=0
-query I
-SELECT '0.1'::DECIMAL(3, 0)::VARCHAR;
-----
-0
-
-# default scale is 0
-query I
-SELECT '123.4'::DECIMAL(9)::VARCHAR;
-----
-123
-
-# scale = width also works
-query II
-SELECT '0.1'::DECIMAL(3, 3)::VARCHAR, '-0.1'::DECIMAL(3, 3)::VARCHAR;
-----
-0.100	-0.100
-
-# any value >= 1 becomes out of range, though
-statement error
-SELECT '1'::DECIMAL(3, 3)::VARCHAR;
-
-statement error
-SELECT '-1'::DECIMAL(3, 3)::VARCHAR;
-
-# repeat the same cast many times
-query I
-select '0.1'::decimal::decimal::decimal;
-----
-0.1
-
-# string casts of various decimal sizes
-query I
-select '123.4'::DECIMAL(4,1)::VARCHAR
-----
-123.4
-
-query I
-select '2.001'::DECIMAL(4,3)::VARCHAR
-----
-2.001
-
-query I
-select '123456.789'::DECIMAL(9,3)::VARCHAR
-----
-123456.789
-
-query I
-select '123456789'::DECIMAL(9,0)::VARCHAR
-----
-123456789
-
-query I
-select '123456789'::DECIMAL(18,3)::VARCHAR
-----
-123456789.000
-
-query I
-select '1701411834604692317316873037.1588410572'::DECIMAL(38,10)::VARCHAR
-----
-1701411834604692317316873037.1588410572
-
-query I
-select '0'::DECIMAL(38,10)::VARCHAR
-----
-0.0000000000
-
-query I
-select '0.00003'::DECIMAL(38,10)::VARCHAR
-----
-0.0000300000
-
-# varchar
-query R
-SELECT '100.100'::DECIMAL(10,0)::VARCHAR
-----
-100
-
-query R
-SELECT '100.100'::DECIMAL::VARCHAR
-----
-100.100
-
-query R
-SELECT '100.100'::DECIMAL(10)::VARCHAR
-----
-100
-
-# various error conditions
-# scale must be bigger than or equal to width
-statement error
-SELECT '0.1'::DECIMAL(3, 4);
-
-# cannot have string variable as scale
-statement error
-SELECT '0.1'::DECIMAL('hello');
-
-# ...or negative numbers
-statement error
-SELECT '0.1'::DECIMAL(-17);
-
-# width/scale out of range
-statement error
-SELECT '0.1'::DECIMAL(1000);
-
-statement error
-SELECT '0.1'::DECIMAL(1, 2, 3);
-
-statement error
-SELECT '1'::INTEGER(1000);
diff --git a/modules/calcite/src/test/sql/types/map/test_map.test_ignored b/modules/calcite/src/test/sql/types/map/test_map.test_ignored
deleted file mode 100644
index 4c9f27a..0000000
--- a/modules/calcite/src/test/sql/types/map/test_map.test_ignored
+++ /dev/null
@@ -1,36 +0,0 @@
-# name: test/sql/types/map/test_map.test
-# description: Test basic casting of maps
-# group: [map]
-# Ignored: https://issues.apache.org/jira/browse/IGNITE-14596
-
-statement ok
-PRAGMA enable_verification
-
-query I
-select typeof(cast(NULL AS MAP(int, float)));
-----
-LIST<STRUCT<key: INTEGER, value: FLOAT>>
-
-query I
-select typeof(cast(NULL AS MAP(string, string)));
-----
-LIST<STRUCT<key: VARCHAR, value: VARCHAR>>
-
-# all those are FORBIDDEN
-
-statement error
-select typeof(cast(NULL AS MAP(int)));
-
-statement error
-select typeof(cast(NULL AS MAP(string)));
-
-statement error
-select typeof(cast(NULL AS MAP(int, int, int)));
-
-statement error
-select typeof(cast(NULL AS MAP()));
-
-query I
-select cast(NULL AS MAP(int, int))
-----
-NULL
\ No newline at end of file