You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2023/06/19 16:59:37 UTC

[spark] branch master updated: [SPARK-40732][SQL][TESTS] Make `(SQL|ThriftServer)QueryTestSuite` pass except Pandas UDF tests in Java 21

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

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 1008d64461e [SPARK-40732][SQL][TESTS] Make `(SQL|ThriftServer)QueryTestSuite` pass except Pandas UDF tests in Java 21
1008d64461e is described below

commit 1008d64461ef76af5e4351e161c69ee64b65c945
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Mon Jun 19 09:59:23 2023 -0700

    [SPARK-40732][SQL][TESTS] Make `(SQL|ThriftServer)QueryTestSuite` pass except Pandas UDF tests in Java 21
    
    ### What changes were proposed in this pull request?
    
    This PR aims to make `SQLQueryTestSuite` and `ThriftServerQueryTestSuite` pass except Pandas UDF tests in Java 21.
    
    ### Why are the changes needed?
    
    Two Java bug fixes changed the behavior and we need a new test output for those test cases.
    - JDK-4511638 changes 'toString' result of Float/Double
    - JDK-8282081 changes DataTimeFormatter 'F' symbol
    
    In addition, `Apache Arrow` doesn't support Java 21 until now. So, I excluded it with TODO JIRA, SPARK-44097 in Java 21 environment.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs and do manual test on Java 21.
    
    ```
    $ java -version
    openjdk version "21-ea" 2023-09-19
    OpenJDK Runtime Environment (build 21-ea+27-2343)
    OpenJDK 64-Bit Server VM (build 21-ea+27-2343, mixed mode, sharing)
    ```
    
    ```
    $ build/sbt "sql/testOnly *.SQLQueryTestSuite"
    ...
    [info] Run completed in 8 minutes, 41 seconds.
    [info] Total number of tests run: 560
    [info] Suites: completed 1, aborted 0
    [info] Tests: succeeded 560, failed 0, canceled 0, ignored 59, pending 0
    [info] All tests passed.
    [success] Total time: 683 s (11:23), completed Jun 19, 2023, 1:24:34 AM
    ```
    
    ```
    $ build/sbt "hive-thriftserver/testOnly *.ThriftServerQueryTestSuite" -Phive-thriftserver
    ...
    [info] Run completed in 6 minutes, 14 seconds.
    [info] Total number of tests run: 211
    [info] Suites: completed 1, aborted 0
    [info] Tests: succeeded 211, failed 0, canceled 0, ignored 19, pending 0
    [info] All tests passed.
    [success] Total time: 396 s (06:36), completed Jun 19, 2023, 1:43:44 AM
    ```
    
    Closes #41658 from dongjoon-hyun/SPARK-40732.
    
    Authored-by: Dongjoon Hyun <do...@apache.org>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 dev/.rat-excludes                                  |    1 +
 .../results/ansi/try_aggregates.sql.out.java21     |  415 ++
 .../results/datetime-formatting.sql.out.java21     |  428 ++
 .../results/postgreSQL/float4.sql.out.java21       |  477 ++
 .../results/postgreSQL/int8.sql.out.java21         | 1076 ++++
 .../results/postgreSQL/numeric.sql.out.java21      | 5251 ++++++++++++++++++++
 .../results/try_aggregates.sql.out.java21          |  299 ++
 .../results/try_arithmetic.sql.out.java21          |  505 ++
 .../apache/spark/sql/IntegratedUDFTestUtils.scala  |    4 +-
 .../org/apache/spark/sql/SQLQueryTestSuite.scala   |   10 +-
 .../thriftserver/ThriftServerQueryTestSuite.scala  |    8 +-
 11 files changed, 8470 insertions(+), 4 deletions(-)

diff --git a/dev/.rat-excludes b/dev/.rat-excludes
index f0cf1a35b5c..4d6a8e2f25b 100644
--- a/dev/.rat-excludes
+++ b/dev/.rat-excludes
@@ -73,6 +73,7 @@ db.lck
 build/*
 dist/*
 .*out
+.*out.java21
 .*ipr
 .*iws
 logs
diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/try_aggregates.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/ansi/try_aggregates.sql.out.java21
new file mode 100644
index 00000000000..9d3c97baeca
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/ansi/try_aggregates.sql.out.java21
@@ -0,0 +1,415 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+SELECT try_sum(col) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<try_sum(col):bigint>
+-- !query output
+30
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<try_sum(col):decimal(13,1)>
+-- !query output
+30.0
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<try_sum(col):bigint>
+-- !query output
+25
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (NULL), (NULL) AS tab(col)
+-- !query schema
+struct<try_sum(col):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<try_sum(col):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (98765432109876543210987654321098765432BD), (98765432109876543210987654321098765432BD) AS tab(col)
+-- !query schema
+struct<try_sum(col):decimal(38,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval month>
+-- !query output
+0-2
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '2147483647 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval second>
+-- !query output
+0 00:00:02.000000000
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '106751991 DAYS'), (interval '1 DAYS') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval day>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_sum(col + 1L) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "ARITHMETIC_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "alternative" : " Use 'try_add' to tolerate overflow and return NULL instead.",
+    "config" : "\"spark.sql.ansi.enabled\"",
+    "message" : "long overflow"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 23,
+    "fragment" : "col + 1L"
+  } ]
+}
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+10.0
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<try_avg(col):decimal(7,5)>
+-- !query output
+10.00000
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+12.5
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (NULL), (NULL) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+4.611686018427388E18
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (98765432109876543210987654321098765432BD), (98765432109876543210987654321098765432BD) AS tab(col)
+-- !query schema
+struct<try_avg(col):decimal(38,4)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval year to month>
+-- !query output
+0-1
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '2147483647 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval year to month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval day to second>
+-- !query output
+0 00:00:01.000000000
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '106751991 DAYS'), (interval '1 DAYS') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval day to second>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col + 1L) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "ARITHMETIC_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "alternative" : " Use 'try_add' to tolerate overflow and return NULL instead.",
+    "config" : "\"spark.sql.ansi.enabled\"",
+    "message" : "long overflow"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 23,
+    "fragment" : "col + 1L"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-formatting.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/datetime-formatting.sql.out.java21
new file mode 100644
index 00000000000..107cc114f40
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/datetime-formatting.sql.out.java21
@@ -0,0 +1,428 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+create temporary view v as select col from values
+ (timestamp '1582-06-01 11:33:33.123UTC+080000'),
+ (timestamp '1970-01-01 00:00:00.000Europe/Paris'),
+ (timestamp '1970-12-31 23:59:59.999Asia/Srednekolymsk'),
+ (timestamp '1996-04-01 00:33:33.123Australia/Darwin'),
+ (timestamp '2018-11-17 13:33:33.123Z'),
+ (timestamp '2020-01-01 01:33:33.123Asia/Shanghai'),
+ (timestamp '2100-01-01 01:33:33.123America/Los_Angeles') t(col)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+select col, date_format(col, 'G GG GGG GGGG') from v
+-- !query schema
+struct<col:timestamp,date_format(col, G GG GGG GGGG):string>
+-- !query output
+1582-05-31 19:40:35.123	AD AD AD Anno Domini
+1969-12-31 15:00:00	AD AD AD Anno Domini
+1970-12-31 04:59:59.999	AD AD AD Anno Domini
+1996-03-31 07:03:33.123	AD AD AD Anno Domini
+2018-11-17 05:33:33.123	AD AD AD Anno Domini
+2019-12-31 09:33:33.123	AD AD AD Anno Domini
+2100-01-01 01:33:33.123	AD AD AD Anno Domini
+
+
+-- !query
+select col, date_format(col, 'y yy yyy yyyy yyyyy yyyyyy') from v
+-- !query schema
+struct<col:timestamp,date_format(col, y yy yyy yyyy yyyyy yyyyyy):string>
+-- !query output
+1582-05-31 19:40:35.123	1582 82 1582 1582 01582 001582
+1969-12-31 15:00:00	1969 69 1969 1969 01969 001969
+1970-12-31 04:59:59.999	1970 70 1970 1970 01970 001970
+1996-03-31 07:03:33.123	1996 96 1996 1996 01996 001996
+2018-11-17 05:33:33.123	2018 18 2018 2018 02018 002018
+2019-12-31 09:33:33.123	2019 19 2019 2019 02019 002019
+2100-01-01 01:33:33.123	2100 00 2100 2100 02100 002100
+
+
+-- !query
+select col, date_format(col, 'q qq') from v
+-- !query schema
+struct<col:timestamp,date_format(col, q qq):string>
+-- !query output
+1582-05-31 19:40:35.123	2 02
+1969-12-31 15:00:00	4 04
+1970-12-31 04:59:59.999	4 04
+1996-03-31 07:03:33.123	1 01
+2018-11-17 05:33:33.123	4 04
+2019-12-31 09:33:33.123	4 04
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'Q QQ QQQ QQQQ') from v
+-- !query schema
+struct<col:timestamp,date_format(col, Q QQ QQQ QQQQ):string>
+-- !query output
+1582-05-31 19:40:35.123	2 02 Q2 2nd quarter
+1969-12-31 15:00:00	4 04 Q4 4th quarter
+1970-12-31 04:59:59.999	4 04 Q4 4th quarter
+1996-03-31 07:03:33.123	1 01 Q1 1st quarter
+2018-11-17 05:33:33.123	4 04 Q4 4th quarter
+2019-12-31 09:33:33.123	4 04 Q4 4th quarter
+2100-01-01 01:33:33.123	1 01 Q1 1st quarter
+
+
+-- !query
+select col, date_format(col, 'M MM MMM MMMM') from v
+-- !query schema
+struct<col:timestamp,date_format(col, M MM MMM MMMM):string>
+-- !query output
+1582-05-31 19:40:35.123	5 05 May May
+1969-12-31 15:00:00	12 12 Dec December
+1970-12-31 04:59:59.999	12 12 Dec December
+1996-03-31 07:03:33.123	3 03 Mar March
+2018-11-17 05:33:33.123	11 11 Nov November
+2019-12-31 09:33:33.123	12 12 Dec December
+2100-01-01 01:33:33.123	1 01 Jan January
+
+
+-- !query
+select col, date_format(col, 'L LL') from v
+-- !query schema
+struct<col:timestamp,date_format(col, L LL):string>
+-- !query output
+1582-05-31 19:40:35.123	5 05
+1969-12-31 15:00:00	12 12
+1970-12-31 04:59:59.999	12 12
+1996-03-31 07:03:33.123	3 03
+2018-11-17 05:33:33.123	11 11
+2019-12-31 09:33:33.123	12 12
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'E EE EEE EEEE') from v
+-- !query schema
+struct<col:timestamp,date_format(col, E EE EEE EEEE):string>
+-- !query output
+1582-05-31 19:40:35.123	Mon Mon Mon Monday
+1969-12-31 15:00:00	Wed Wed Wed Wednesday
+1970-12-31 04:59:59.999	Thu Thu Thu Thursday
+1996-03-31 07:03:33.123	Sun Sun Sun Sunday
+2018-11-17 05:33:33.123	Sat Sat Sat Saturday
+2019-12-31 09:33:33.123	Tue Tue Tue Tuesday
+2100-01-01 01:33:33.123	Fri Fri Fri Friday
+
+
+-- !query
+select col, date_format(col, 'F') from v
+-- !query schema
+struct<col:timestamp,date_format(col, F):string>
+-- !query output
+1582-05-31 19:40:35.123	5
+1969-12-31 15:00:00	5
+1970-12-31 04:59:59.999	5
+1996-03-31 07:03:33.123	5
+2018-11-17 05:33:33.123	3
+2019-12-31 09:33:33.123	5
+2100-01-01 01:33:33.123	1
+
+
+-- !query
+select col, date_format(col, 'd dd') from v
+-- !query schema
+struct<col:timestamp,date_format(col, d dd):string>
+-- !query output
+1582-05-31 19:40:35.123	31 31
+1969-12-31 15:00:00	31 31
+1970-12-31 04:59:59.999	31 31
+1996-03-31 07:03:33.123	31 31
+2018-11-17 05:33:33.123	17 17
+2019-12-31 09:33:33.123	31 31
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'DD') from v where col = timestamp '2100-01-01 01:33:33.123America/Los_Angeles'
+-- !query schema
+struct<col:timestamp,date_format(col, DD):string>
+-- !query output
+2100-01-01 01:33:33.123	01
+
+
+-- !query
+select col, date_format(col, 'D DDD') from v
+-- !query schema
+struct<col:timestamp,date_format(col, D DDD):string>
+-- !query output
+1582-05-31 19:40:35.123	151 151
+1969-12-31 15:00:00	365 365
+1970-12-31 04:59:59.999	365 365
+1996-03-31 07:03:33.123	91 091
+2018-11-17 05:33:33.123	321 321
+2019-12-31 09:33:33.123	365 365
+2100-01-01 01:33:33.123	1 001
+
+
+-- !query
+select col, date_format(col, 'H HH') from v
+-- !query schema
+struct<col:timestamp,date_format(col, H HH):string>
+-- !query output
+1582-05-31 19:40:35.123	19 19
+1969-12-31 15:00:00	15 15
+1970-12-31 04:59:59.999	4 04
+1996-03-31 07:03:33.123	7 07
+2018-11-17 05:33:33.123	5 05
+2019-12-31 09:33:33.123	9 09
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'h hh') from v
+-- !query schema
+struct<col:timestamp,date_format(col, h hh):string>
+-- !query output
+1582-05-31 19:40:35.123	7 07
+1969-12-31 15:00:00	3 03
+1970-12-31 04:59:59.999	4 04
+1996-03-31 07:03:33.123	7 07
+2018-11-17 05:33:33.123	5 05
+2019-12-31 09:33:33.123	9 09
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'k kk') from v
+-- !query schema
+struct<col:timestamp,date_format(col, k kk):string>
+-- !query output
+1582-05-31 19:40:35.123	19 19
+1969-12-31 15:00:00	15 15
+1970-12-31 04:59:59.999	4 04
+1996-03-31 07:03:33.123	7 07
+2018-11-17 05:33:33.123	5 05
+2019-12-31 09:33:33.123	9 09
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'K KK') from v
+-- !query schema
+struct<col:timestamp,date_format(col, K KK):string>
+-- !query output
+1582-05-31 19:40:35.123	7 07
+1969-12-31 15:00:00	3 03
+1970-12-31 04:59:59.999	4 04
+1996-03-31 07:03:33.123	7 07
+2018-11-17 05:33:33.123	5 05
+2019-12-31 09:33:33.123	9 09
+2100-01-01 01:33:33.123	1 01
+
+
+-- !query
+select col, date_format(col, 'm mm') from v
+-- !query schema
+struct<col:timestamp,date_format(col, m mm):string>
+-- !query output
+1582-05-31 19:40:35.123	40 40
+1969-12-31 15:00:00	0 00
+1970-12-31 04:59:59.999	59 59
+1996-03-31 07:03:33.123	3 03
+2018-11-17 05:33:33.123	33 33
+2019-12-31 09:33:33.123	33 33
+2100-01-01 01:33:33.123	33 33
+
+
+-- !query
+select col, date_format(col, 's ss') from v
+-- !query schema
+struct<col:timestamp,date_format(col, s ss):string>
+-- !query output
+1582-05-31 19:40:35.123	35 35
+1969-12-31 15:00:00	0 00
+1970-12-31 04:59:59.999	59 59
+1996-03-31 07:03:33.123	33 33
+2018-11-17 05:33:33.123	33 33
+2019-12-31 09:33:33.123	33 33
+2100-01-01 01:33:33.123	33 33
+
+
+-- !query
+select col, date_format(col, 'S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS') from v
+-- !query schema
+struct<col:timestamp,date_format(col, S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS):string>
+-- !query output
+1582-05-31 19:40:35.123	1 12 123 1230 12300 123000 1230000 12300000 123000000
+1969-12-31 15:00:00	0 00 000 0000 00000 000000 0000000 00000000 000000000
+1970-12-31 04:59:59.999	9 99 999 9990 99900 999000 9990000 99900000 999000000
+1996-03-31 07:03:33.123	1 12 123 1230 12300 123000 1230000 12300000 123000000
+2018-11-17 05:33:33.123	1 12 123 1230 12300 123000 1230000 12300000 123000000
+2019-12-31 09:33:33.123	1 12 123 1230 12300 123000 1230000 12300000 123000000
+2100-01-01 01:33:33.123	1 12 123 1230 12300 123000 1230000 12300000 123000000
+
+
+-- !query
+select col, date_format(col, 'a') from v
+-- !query schema
+struct<col:timestamp,date_format(col, a):string>
+-- !query output
+1582-05-31 19:40:35.123	PM
+1969-12-31 15:00:00	PM
+1970-12-31 04:59:59.999	AM
+1996-03-31 07:03:33.123	AM
+2018-11-17 05:33:33.123	AM
+2019-12-31 09:33:33.123	AM
+2100-01-01 01:33:33.123	AM
+
+
+-- !query
+select col, date_format(col, 'VV') from v
+-- !query schema
+struct<col:timestamp,date_format(col, VV):string>
+-- !query output
+1582-05-31 19:40:35.123	America/Los_Angeles
+1969-12-31 15:00:00	America/Los_Angeles
+1970-12-31 04:59:59.999	America/Los_Angeles
+1996-03-31 07:03:33.123	America/Los_Angeles
+2018-11-17 05:33:33.123	America/Los_Angeles
+2019-12-31 09:33:33.123	America/Los_Angeles
+2100-01-01 01:33:33.123	America/Los_Angeles
+
+
+-- !query
+select col, date_format(col, 'z zz zzz zzzz') from v
+-- !query schema
+struct<col:timestamp,date_format(col, z zz zzz zzzz):string>
+-- !query output
+1582-05-31 19:40:35.123	PST PST PST Pacific Standard Time
+1969-12-31 15:00:00	PST PST PST Pacific Standard Time
+1970-12-31 04:59:59.999	PST PST PST Pacific Standard Time
+1996-03-31 07:03:33.123	PST PST PST Pacific Standard Time
+2018-11-17 05:33:33.123	PST PST PST Pacific Standard Time
+2019-12-31 09:33:33.123	PST PST PST Pacific Standard Time
+2100-01-01 01:33:33.123	PST PST PST Pacific Standard Time
+
+
+-- !query
+select col, date_format(col, 'X XX XXX') from v
+-- !query schema
+struct<col:timestamp,date_format(col, X XX XXX):string>
+-- !query output
+1582-05-31 19:40:35.123	-0752 -0752 -07:52
+1969-12-31 15:00:00	-08 -0800 -08:00
+1970-12-31 04:59:59.999	-08 -0800 -08:00
+1996-03-31 07:03:33.123	-08 -0800 -08:00
+2018-11-17 05:33:33.123	-08 -0800 -08:00
+2019-12-31 09:33:33.123	-08 -0800 -08:00
+2100-01-01 01:33:33.123	-08 -0800 -08:00
+
+
+-- !query
+select col, date_format(col, 'XXXX XXXXX') from v
+-- !query schema
+struct<col:timestamp,date_format(col, XXXX XXXXX):string>
+-- !query output
+1582-05-31 19:40:35.123	-075258 -07:52:58
+1969-12-31 15:00:00	-0800 -08:00
+1970-12-31 04:59:59.999	-0800 -08:00
+1996-03-31 07:03:33.123	-0800 -08:00
+2018-11-17 05:33:33.123	-0800 -08:00
+2019-12-31 09:33:33.123	-0800 -08:00
+2100-01-01 01:33:33.123	-0800 -08:00
+
+
+-- !query
+select col, date_format(col, 'Z ZZ ZZZ ZZZZ ZZZZZ') from v
+-- !query schema
+struct<col:timestamp,date_format(col, Z ZZ ZZZ ZZZZ ZZZZZ):string>
+-- !query output
+1582-05-31 19:40:35.123	-0752 -0752 -0752 GMT-07:52:58 -07:52:58
+1969-12-31 15:00:00	-0800 -0800 -0800 GMT-08:00 -08:00
+1970-12-31 04:59:59.999	-0800 -0800 -0800 GMT-08:00 -08:00
+1996-03-31 07:03:33.123	-0800 -0800 -0800 GMT-08:00 -08:00
+2018-11-17 05:33:33.123	-0800 -0800 -0800 GMT-08:00 -08:00
+2019-12-31 09:33:33.123	-0800 -0800 -0800 GMT-08:00 -08:00
+2100-01-01 01:33:33.123	-0800 -0800 -0800 GMT-08:00 -08:00
+
+
+-- !query
+select col, date_format(col, 'O OOOO') from v
+-- !query schema
+struct<col:timestamp,date_format(col, O OOOO):string>
+-- !query output
+1582-05-31 19:40:35.123	GMT-7:52:58 GMT-07:52:58
+1969-12-31 15:00:00	GMT-8 GMT-08:00
+1970-12-31 04:59:59.999	GMT-8 GMT-08:00
+1996-03-31 07:03:33.123	GMT-8 GMT-08:00
+2018-11-17 05:33:33.123	GMT-8 GMT-08:00
+2019-12-31 09:33:33.123	GMT-8 GMT-08:00
+2100-01-01 01:33:33.123	GMT-8 GMT-08:00
+
+
+-- !query
+select col, date_format(col, 'x xx xxx xxxx xxxx xxxxx') from v
+-- !query schema
+struct<col:timestamp,date_format(col, x xx xxx xxxx xxxx xxxxx):string>
+-- !query output
+1582-05-31 19:40:35.123	-0752 -0752 -07:52 -075258 -075258 -07:52:58
+1969-12-31 15:00:00	-08 -0800 -08:00 -0800 -0800 -08:00
+1970-12-31 04:59:59.999	-08 -0800 -08:00 -0800 -0800 -08:00
+1996-03-31 07:03:33.123	-08 -0800 -08:00 -0800 -0800 -08:00
+2018-11-17 05:33:33.123	-08 -0800 -08:00 -0800 -0800 -08:00
+2019-12-31 09:33:33.123	-08 -0800 -08:00 -0800 -0800 -08:00
+2100-01-01 01:33:33.123	-08 -0800 -08:00 -0800 -0800 -08:00
+
+
+-- !query
+select col, date_format(col, '[yyyy-MM-dd HH:mm:ss]') from v
+-- !query schema
+struct<col:timestamp,date_format(col, [yyyy-MM-dd HH:mm:ss]):string>
+-- !query output
+1582-05-31 19:40:35.123	1582-05-31 19:40:35
+1969-12-31 15:00:00	1969-12-31 15:00:00
+1970-12-31 04:59:59.999	1970-12-31 04:59:59
+1996-03-31 07:03:33.123	1996-03-31 07:03:33
+2018-11-17 05:33:33.123	2018-11-17 05:33:33
+2019-12-31 09:33:33.123	2019-12-31 09:33:33
+2100-01-01 01:33:33.123	2100-01-01 01:33:33
+
+
+-- !query
+select col, date_format(col, "姚123'GyYqQMLwWuEFDdhHmsSaVzZxXOV'") from v
+-- !query schema
+struct<col:timestamp,date_format(col, 姚123'GyYqQMLwWuEFDdhHmsSaVzZxXOV'):string>
+-- !query output
+1582-05-31 19:40:35.123	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+1969-12-31 15:00:00	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+1970-12-31 04:59:59.999	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+1996-03-31 07:03:33.123	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+2018-11-17 05:33:33.123	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+2019-12-31 09:33:33.123	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+2100-01-01 01:33:33.123	姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV
+
+
+-- !query
+select col, date_format(col, "''") from v
+-- !query schema
+struct<col:timestamp,date_format(col, ''):string>
+-- !query output
+1582-05-31 19:40:35.123	'
+1969-12-31 15:00:00	'
+1970-12-31 04:59:59.999	'
+1996-03-31 07:03:33.123	'
+2018-11-17 05:33:33.123	'
+2019-12-31 09:33:33.123	'
+2100-01-01 01:33:33.123	'
+
+
+-- !query
+select col, date_format(col, '') from v
+-- !query schema
+struct<col:timestamp,date_format(col, ):string>
+-- !query output
+1582-05-31 19:40:35.123	
+1969-12-31 15:00:00	
+1970-12-31 04:59:59.999	
+1996-03-31 07:03:33.123	
+2018-11-17 05:33:33.123	
+2019-12-31 09:33:33.123	
+2100-01-01 01:33:33.123
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out.java21
new file mode 100644
index 00000000000..6126411071b
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out.java21
@@ -0,0 +1,477 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+CREATE TABLE FLOAT4_TBL (f1  float) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO FLOAT4_TBL VALUES (float('    0.0'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO FLOAT4_TBL VALUES (float('1004.30   '))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO FLOAT4_TBL VALUES (float('     -34.84    '))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO FLOAT4_TBL VALUES (float('1.2345678901234e+20'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO FLOAT4_TBL VALUES (float('1.2345678901234e-20'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT float('NaN')
+-- !query schema
+struct<NaN:float>
+-- !query output
+NaN
+
+
+-- !query
+SELECT float('nan')
+-- !query schema
+struct<nan:float>
+-- !query output
+NaN
+
+
+-- !query
+SELECT float('   NAN  ')
+-- !query schema
+struct<   NAN  :float>
+-- !query output
+NaN
+
+
+-- !query
+SELECT float('infinity')
+-- !query schema
+struct<infinity:float>
+-- !query output
+Infinity
+
+
+-- !query
+SELECT float('          -INFINiTY   ')
+-- !query schema
+struct<          -INFINiTY   :float>
+-- !query output
+-Infinity
+
+
+-- !query
+SELECT float('N A N')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkNumberFormatException
+{
+  "errorClass" : "CAST_INVALID_INPUT",
+  "sqlState" : "22018",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "expression" : "'N A N'",
+    "sourceType" : "\"STRING\"",
+    "targetType" : "\"FLOAT\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 21,
+    "fragment" : "float('N A N')"
+  } ]
+}
+
+
+-- !query
+SELECT float('NaN x')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkNumberFormatException
+{
+  "errorClass" : "CAST_INVALID_INPUT",
+  "sqlState" : "22018",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "expression" : "'NaN x'",
+    "sourceType" : "\"STRING\"",
+    "targetType" : "\"FLOAT\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 21,
+    "fragment" : "float('NaN x')"
+  } ]
+}
+
+
+-- !query
+SELECT float(' INFINITY    x')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkNumberFormatException
+{
+  "errorClass" : "CAST_INVALID_INPUT",
+  "sqlState" : "22018",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "expression" : "' INFINITY    x'",
+    "sourceType" : "\"STRING\"",
+    "targetType" : "\"FLOAT\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 30,
+    "fragment" : "float(' INFINITY    x')"
+  } ]
+}
+
+
+-- !query
+SELECT float('Infinity') + 100.0
+-- !query schema
+struct<(Infinity + 100.0):double>
+-- !query output
+Infinity
+
+
+-- !query
+SELECT float('Infinity') / float('Infinity')
+-- !query schema
+struct<(Infinity / Infinity):double>
+-- !query output
+NaN
+
+
+-- !query
+SELECT float('nan') / float('nan')
+-- !query schema
+struct<(nan / nan):double>
+-- !query output
+NaN
+
+
+-- !query
+SELECT float(decimal('nan'))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkNumberFormatException
+{
+  "errorClass" : "CAST_INVALID_INPUT",
+  "sqlState" : "22018",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "expression" : "'nan'",
+    "sourceType" : "\"STRING\"",
+    "targetType" : "\"DECIMAL(10,0)\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 14,
+    "stopIndex" : 27,
+    "fragment" : "decimal('nan')"
+  } ]
+}
+
+
+-- !query
+SELECT '' AS five, * FROM FLOAT4_TBL
+-- !query schema
+struct<five:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1.2345679E20
+	1004.3
+
+
+-- !query
+SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3'
+-- !query schema
+struct<four:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1.2345679E20
+	1004.3
+
+
+-- !query
+SELECT '' AS one, f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3'
+-- !query schema
+struct<one:string,f1:float>
+-- !query output
+
+
+
+-- !query
+SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1
+-- !query schema
+struct<three:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1004.3
+
+
+-- !query
+SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE  f.f1 < '1004.3'
+-- !query schema
+struct<three:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1004.3
+
+
+-- !query
+SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1
+-- !query schema
+struct<four:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1004.3
+
+
+-- !query
+SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE  f.f1 <= '1004.3'
+-- !query schema
+struct<four:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1004.3
+
+
+-- !query
+SELECT '' AS three, f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f
+   WHERE f.f1 > '0.0'
+-- !query schema
+struct<three:string,f1:float,x:double>
+-- !query output
+	1.2345679E-20	-1.2345678720289608E-19
+	1.2345679E20	-1.2345678955701443E21
+	1004.3	-10042.999877929688
+
+
+-- !query
+SELECT '' AS three, f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f
+   WHERE f.f1 > '0.0'
+-- !query schema
+struct<three:string,f1:float,x:double>
+-- !query output
+	1.2345679E-20	-10.0
+	1.2345679E20	1.2345678955701443E20
+	1004.3	994.2999877929688
+
+
+-- !query
+SELECT '' AS three, f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f
+   WHERE f.f1 > '0.0'
+-- !query schema
+struct<three:string,f1:float,x:double>
+-- !query output
+	1.2345679E-20	-1.2345678720289608E-21
+	1.2345679E20	-1.2345678955701443E19
+	1004.3	-100.42999877929688
+
+
+-- !query
+SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f
+   WHERE f.f1 > '0.0'
+-- !query schema
+struct<three:string,f1:float,x:double>
+-- !query output
+	1.2345679E-20	10.0
+	1.2345679E20	1.2345678955701443E20
+	1004.3	1014.2999877929688
+
+
+-- !query
+SELECT '' AS five, * FROM FLOAT4_TBL
+-- !query schema
+struct<five:string,f1:float>
+-- !query output
+	-34.84
+	0.0
+	1.2345679E-20
+	1.2345679E20
+	1004.3
+
+
+-- !query
+SELECT smallint(float('32767.4'))
+-- !query schema
+struct<32767.4:smallint>
+-- !query output
+32767
+
+
+-- !query
+SELECT smallint(float('32767.6'))
+-- !query schema
+struct<32767.6:smallint>
+-- !query output
+32767
+
+
+-- !query
+SELECT smallint(float('-32768.4'))
+-- !query schema
+struct<-32768.4:smallint>
+-- !query output
+-32768
+
+
+-- !query
+SELECT smallint(float('-32768.6'))
+-- !query schema
+struct<-32768.6:smallint>
+-- !query output
+-32768
+
+
+-- !query
+SELECT int(float('2147483520'))
+-- !query schema
+struct<2147483520:int>
+-- !query output
+2147483520
+
+
+-- !query
+SELECT int(float('2147483647'))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"FLOAT\"",
+    "targetType" : "\"INT\"",
+    "value" : "2.1474836E9"
+  }
+}
+
+
+-- !query
+SELECT int(float('-2147483648.5'))
+-- !query schema
+struct<-2147483648.5:int>
+-- !query output
+-2147483648
+
+
+-- !query
+SELECT int(float('-2147483900'))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"FLOAT\"",
+    "targetType" : "\"INT\"",
+    "value" : "-2.147484E9"
+  }
+}
+
+
+-- !query
+SELECT bigint(float('9223369837831520256'))
+-- !query schema
+struct<9223369837831520256:bigint>
+-- !query output
+9223369837831520256
+
+
+-- !query
+SELECT bigint(float('9223372036854775807'))
+-- !query schema
+struct<9223372036854775807:bigint>
+-- !query output
+9223372036854775807
+
+
+-- !query
+SELECT bigint(float('-9223372036854775808.5'))
+-- !query schema
+struct<-9223372036854775808.5:bigint>
+-- !query output
+-9223372036854775808
+
+
+-- !query
+SELECT bigint(float('-9223380000000000000'))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"FLOAT\"",
+    "targetType" : "\"BIGINT\"",
+    "value" : "-9.22338E18"
+  }
+}
+
+
+-- !query
+DROP TABLE FLOAT4_TBL
+-- !query schema
+struct<>
+-- !query output
+
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out.java21
new file mode 100755
index 00000000000..ee3f8625da8
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out.java21
@@ -0,0 +1,1076 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+CREATE TABLE INT8_TBL(q1 bigint, q2 bigint) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO INT8_TBL VALUES(bigint(trim('  123   ')),bigint(trim('  456')))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO INT8_TBL VALUES(bigint(trim('123   ')),bigint('4567890123456789'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO INT8_TBL VALUES(bigint('4567890123456789'),bigint('123'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO INT8_TBL VALUES(+4567890123456789,bigint('4567890123456789'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO INT8_TBL VALUES(bigint('+4567890123456789'),bigint('-4567890123456789'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM INT8_TBL
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 = 4567890123456789
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 <> 4567890123456789
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+4567890123456789	-4567890123456789
+4567890123456789	123
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 < 4567890123456789
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+4567890123456789	-4567890123456789
+4567890123456789	123
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 > 4567890123456789
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 <= 4567890123456789
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 >= 4567890123456789
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 = 456
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 <> 456
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	4567890123456789
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 < 456
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+4567890123456789	-4567890123456789
+4567890123456789	123
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 > 456
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 <= 456
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+4567890123456789	-4567890123456789
+4567890123456789	123
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 >= 456
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE 123 = q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE 123 <> q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE 123 < q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE 123 > q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE 123 <= q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE 123 >= q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 = smallint('456')
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 <> smallint('456')
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	4567890123456789
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 < smallint('456')
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+4567890123456789	-4567890123456789
+4567890123456789	123
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 > smallint('456')
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 <= smallint('456')
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+4567890123456789	-4567890123456789
+4567890123456789	123
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE q2 >= smallint('456')
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE smallint('123') = q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE smallint('123') <> q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE smallint('123') < q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE smallint('123') > q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE smallint('123') <= q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+4567890123456789	-4567890123456789
+4567890123456789	123
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT * FROM INT8_TBL WHERE smallint('123') >= q1
+-- !query schema
+struct<q1:bigint,q2:bigint>
+-- !query output
+123	456
+123	4567890123456789
+
+
+-- !query
+SELECT '' AS five, q1 AS plus, -q1 AS `minus` FROM INT8_TBL
+-- !query schema
+struct<five:string,plus:bigint,minus:bigint>
+-- !query output
+	123	-123
+	123	-123
+	4567890123456789	-4567890123456789
+	4567890123456789	-4567890123456789
+	4567890123456789	-4567890123456789
+
+
+-- !query
+SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL
+-- !query schema
+struct<five:string,q1:bigint,q2:bigint,plus:bigint>
+-- !query output
+	123	456	579
+	123	4567890123456789	4567890123456912
+	4567890123456789	-4567890123456789	0
+	4567890123456789	123	4567890123456912
+	4567890123456789	4567890123456789	9135780246913578
+
+
+-- !query
+SELECT '' AS five, q1, q2, q1 - q2 AS `minus` FROM INT8_TBL
+-- !query schema
+struct<five:string,q1:bigint,q2:bigint,minus:bigint>
+-- !query output
+	123	456	-333
+	123	4567890123456789	-4567890123456666
+	4567890123456789	-4567890123456789	9135780246913578
+	4567890123456789	123	4567890123456666
+	4567890123456789	4567890123456789	0
+
+
+-- !query
+SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "ARITHMETIC_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "alternative" : " Use 'try_multiply' to tolerate overflow and return NULL instead.",
+    "config" : "\"spark.sql.ansi.enabled\"",
+    "message" : "long overflow"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 29,
+    "stopIndex" : 35,
+    "fragment" : "q1 * q2"
+  } ]
+}
+
+
+-- !query
+SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000)
+-- !query schema
+struct<three:string,q1:bigint,q2:bigint,multiply:bigint>
+-- !query output
+	123	456	56088
+	123	4567890123456789	561850485185185047
+	4567890123456789	123	561850485185185047
+
+
+-- !query
+SELECT '' AS five, q1, q2, q1 / q2 AS divide, q1 % q2 AS mod FROM INT8_TBL
+-- !query schema
+struct<five:string,q1:bigint,q2:bigint,divide:double,mod:bigint>
+-- !query output
+	123	456	0.26973684210526316	123
+	123	4567890123456789	2.6927092525360204E-14	123
+	4567890123456789	-4567890123456789	-1.0	0
+	4567890123456789	123	3.713731807688446E13	57
+	4567890123456789	4567890123456789	1.0	0
+
+
+-- !query
+SELECT '' AS five, q1, double(q1) FROM INT8_TBL
+-- !query schema
+struct<five:string,q1:bigint,q1:double>
+-- !query output
+	123	123.0
+	123	123.0
+	4567890123456789	4.567890123456789E15
+	4567890123456789	4.567890123456789E15
+	4567890123456789	4.567890123456789E15
+
+
+-- !query
+SELECT '' AS five, q2, double(q2) FROM INT8_TBL
+-- !query schema
+struct<five:string,q2:bigint,q2:double>
+-- !query output
+	-4567890123456789	-4.567890123456789E15
+	123	123.0
+	456	456.0
+	4567890123456789	4.567890123456789E15
+	4567890123456789	4.567890123456789E15
+
+
+-- !query
+SELECT 37 + q1 AS plus4 FROM INT8_TBL
+-- !query schema
+struct<plus4:bigint>
+-- !query output
+160
+160
+4567890123456826
+4567890123456826
+4567890123456826
+
+
+-- !query
+SELECT 37 - q1 AS minus4 FROM INT8_TBL
+-- !query schema
+struct<minus4:bigint>
+-- !query output
+-4567890123456752
+-4567890123456752
+-4567890123456752
+-86
+-86
+
+
+-- !query
+SELECT '' AS five, 2 * q1 AS `twice int4` FROM INT8_TBL
+-- !query schema
+struct<five:string,twice int4:bigint>
+-- !query output
+	246
+	246
+	9135780246913578
+	9135780246913578
+	9135780246913578
+
+
+-- !query
+SELECT '' AS five, q1 * 2 AS `twice int4` FROM INT8_TBL
+-- !query schema
+struct<five:string,twice int4:bigint>
+-- !query output
+	246
+	246
+	9135780246913578
+	9135780246913578
+	9135780246913578
+
+
+-- !query
+SELECT q1 + int(42) AS `8plus4`, q1 - int(42) AS `8minus4`, q1 * int(42) AS `8mul4`, q1 / int(42) AS `8div4` FROM INT8_TBL
+-- !query schema
+struct<8plus4:bigint,8minus4:bigint,8mul4:bigint,8div4:double>
+-- !query output
+165	81	5166	2.9285714285714284
+165	81	5166	2.9285714285714284
+4567890123456831	4567890123456747	191851385185185138	1.0875928865373308E14
+4567890123456831	4567890123456747	191851385185185138	1.0875928865373308E14
+4567890123456831	4567890123456747	191851385185185138	1.0875928865373308E14
+
+
+-- !query
+SELECT int(246) + q1 AS `4plus8`, int(246) - q1 AS `4minus8`, int(246) * q1 AS `4mul8`, int(246) / q1 AS `4div8` FROM INT8_TBL
+-- !query schema
+struct<4plus8:bigint,4minus8:bigint,4mul8:bigint,4div8:double>
+-- !query output
+369	123	30258	2.0
+369	123	30258	2.0
+4567890123457035	-4567890123456543	1123700970370370094	5.385418505072041E-14
+4567890123457035	-4567890123456543	1123700970370370094	5.385418505072041E-14
+4567890123457035	-4567890123456543	1123700970370370094	5.385418505072041E-14
+
+
+-- !query
+SELECT q1 + smallint(42) AS `8plus2`, q1 - smallint(42) AS `8minus2`, q1 * smallint(42) AS `8mul2`, q1 / smallint(42) AS `8div2` FROM INT8_TBL
+-- !query schema
+struct<8plus2:bigint,8minus2:bigint,8mul2:bigint,8div2:double>
+-- !query output
+165	81	5166	2.9285714285714284
+165	81	5166	2.9285714285714284
+4567890123456831	4567890123456747	191851385185185138	1.0875928865373308E14
+4567890123456831	4567890123456747	191851385185185138	1.0875928865373308E14
+4567890123456831	4567890123456747	191851385185185138	1.0875928865373308E14
+
+
+-- !query
+SELECT smallint(246) + q1 AS `2plus8`, smallint(246) - q1 AS `2minus8`, smallint(246) * q1 AS `2mul8`, smallint(246) / q1 AS `2div8` FROM INT8_TBL
+-- !query schema
+struct<2plus8:bigint,2minus8:bigint,2mul8:bigint,2div8:double>
+-- !query output
+369	123	30258	2.0
+369	123	30258	2.0
+4567890123457035	-4567890123456543	1123700970370370094	5.385418505072041E-14
+4567890123457035	-4567890123456543	1123700970370370094	5.385418505072041E-14
+4567890123457035	-4567890123456543	1123700970370370094	5.385418505072041E-14
+
+
+-- !query
+SELECT q2, abs(q2) FROM INT8_TBL
+-- !query schema
+struct<q2:bigint,abs(q2):bigint>
+-- !query output
+-4567890123456789	4567890123456789
+123	123
+456	456
+4567890123456789	4567890123456789
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT min(q1), min(q2) FROM INT8_TBL
+-- !query schema
+struct<min(q1):bigint,min(q2):bigint>
+-- !query output
+123	-4567890123456789
+
+
+-- !query
+SELECT max(q1), max(q2) FROM INT8_TBL
+-- !query schema
+struct<max(q1):bigint,max(q2):bigint>
+-- !query output
+4567890123456789	4567890123456789
+
+
+-- !query
+SELECT '' AS to_char_1, to_char(q1, '9G999G999G999G999G999'), to_char(q2, '9,999,999,999,999,999')
+FROM INT8_TBL
+-- !query schema
+struct<to_char_1:string,to_char(q1, 9G999G999G999G999G999):string,to_char(q2, 9,999,999,999,999,999):string>
+-- !query output
+	                  123	                  456
+	                  123	4,567,890,123,456,789
+	4,567,890,123,456,789	                  123
+	4,567,890,123,456,789	4,567,890,123,456,789
+	4,567,890,123,456,789	4,567,890,123,456,789
+
+
+-- !query
+SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'), to_char( (q2 * -1), '9999999999999999.999PR')
+FROM INT8_TBL
+-- !query schema
+struct<to_char_3:string,to_char((q1 * -1), 9999999999999999PR):string,to_char((q2 * -1), 9999999999999999.999PR):string>
+-- !query output
+	             <123>	             <456.000>
+	             <123>	<4567890123456789.000>
+	<4567890123456789>	             <123.000>
+	<4567890123456789>	4567890123456789.000  
+	<4567890123456789>	<4567890123456789.000>
+
+
+-- !query
+SELECT '' AS to_char_4, to_char( (q1 * -1), '9999999999999999S'), to_char( (q2 * -1), 'S9999999999999999')
+FROM INT8_TBL
+-- !query schema
+struct<to_char_4:string,to_char((q1 * -1), 9999999999999999S):string,to_char((q2 * -1), S9999999999999999):string>
+-- !query output
+	             123-	             -456
+	             123-	-4567890123456789
+	4567890123456789-	             -123
+	4567890123456789-	+4567890123456789
+	4567890123456789-	-4567890123456789
+
+
+-- !query
+SELECT '' AS to_char_5,  to_char(q2, 'MI9999999999999999')     FROM INT8_TBL
+-- !query schema
+struct<to_char_5:string,to_char(q2, MI9999999999999999):string>
+-- !query output
+	              123
+	              456
+	 4567890123456789
+	 4567890123456789
+	-4567890123456789
+
+
+-- !query
+SELECT '' AS to_char_9,  to_char(q2, '0999999999999999')       FROM INT8_TBL
+-- !query schema
+struct<to_char_9:string,to_char(q2, 0999999999999999):string>
+-- !query output
+	0000000000000123
+	0000000000000456
+	4567890123456789
+	4567890123456789
+	4567890123456789
+
+
+-- !query
+SELECT '' AS to_char_10, to_char(q2, 'S0999999999999999')      FROM INT8_TBL
+-- !query schema
+struct<to_char_10:string,to_char(q2, S0999999999999999):string>
+-- !query output
+	+0000000000000123
+	+0000000000000456
+	+4567890123456789
+	+4567890123456789
+	-4567890123456789
+
+
+-- !query
+select bigint('9223372036854775800') / bigint('0')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 50,
+    "fragment" : "bigint('9223372036854775800') / bigint('0')"
+  } ]
+}
+
+
+-- !query
+select bigint('-9223372036854775808') / smallint('0')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 53,
+    "fragment" : "bigint('-9223372036854775808') / smallint('0')"
+  } ]
+}
+
+
+-- !query
+select smallint('100') / bigint('0')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DIVIDE_BY_ZERO",
+  "sqlState" : "22012",
+  "messageParameters" : {
+    "config" : "\"spark.sql.ansi.enabled\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 36,
+    "fragment" : "smallint('100') / bigint('0')"
+  } ]
+}
+
+
+-- !query
+SELECT CAST(q1 AS int) FROM int8_tbl WHERE q2 = 456
+-- !query schema
+struct<q1:int>
+-- !query output
+123
+
+
+-- !query
+SELECT CAST(q1 AS int) FROM int8_tbl WHERE q2 <> 456
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"BIGINT\"",
+    "targetType" : "\"INT\"",
+    "value" : "4567890123456789L"
+  }
+}
+
+
+-- !query
+SELECT CAST(q1 AS smallint) FROM int8_tbl WHERE q2 = 456
+-- !query schema
+struct<q1:smallint>
+-- !query output
+123
+
+
+-- !query
+SELECT CAST(q1 AS smallint) FROM int8_tbl WHERE q2 <> 456
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"BIGINT\"",
+    "targetType" : "\"SMALLINT\"",
+    "value" : "4567890123456789L"
+  }
+}
+
+
+-- !query
+SELECT CAST(smallint('42') AS bigint), CAST(smallint('-37') AS bigint)
+-- !query schema
+struct<CAST(42 AS BIGINT):bigint,CAST(-37 AS BIGINT):bigint>
+-- !query output
+42	-37
+
+
+-- !query
+SELECT CAST(q1 AS float), CAST(q2 AS double) FROM INT8_TBL
+-- !query schema
+struct<q1:float,q2:double>
+-- !query output
+123.0	4.567890123456789E15
+123.0	456.0
+4.56789E15	-4.567890123456789E15
+4.56789E15	123.0
+4.56789E15	4.567890123456789E15
+
+
+-- !query
+SELECT CAST(float('36854775807.0') AS bigint)
+-- !query schema
+struct<CAST(36854775807.0 AS BIGINT):bigint>
+-- !query output
+36854775808
+
+
+-- !query
+SELECT CAST(double('922337203685477580700.0') AS bigint)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"DOUBLE\"",
+    "targetType" : "\"BIGINT\"",
+    "value" : "9.223372036854776E20D"
+  }
+}
+
+
+-- !query
+SELECT q1, q2, q1 & q2 AS `and`, q1 | q2 AS `or`, ~q1 AS `not` FROM INT8_TBL
+-- !query schema
+struct<q1:bigint,q2:bigint,and:bigint,or:bigint,not:bigint>
+-- !query output
+123	456	72	507	-124
+123	4567890123456789	17	4567890123456895	-124
+4567890123456789	-4567890123456789	1	-1	-4567890123456790
+4567890123456789	123	17	4567890123456895	-4567890123456790
+4567890123456789	4567890123456789	4567890123456789	4567890123456789	-4567890123456790
+
+
+-- !query
+SELECT * FROM range(bigint('+4567890123456789'), bigint('+4567890123456799'))
+-- !query schema
+struct<id:bigint>
+-- !query output
+4567890123456789
+4567890123456790
+4567890123456791
+4567890123456792
+4567890123456793
+4567890123456794
+4567890123456795
+4567890123456796
+4567890123456797
+4567890123456798
+
+
+-- !query
+SELECT * FROM range(bigint('+4567890123456789'), bigint('+4567890123456799'), 0)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+{
+  "errorClass" : "FAILED_FUNCTION_CALL",
+  "sqlState" : "38000",
+  "messageParameters" : {
+    "funcName" : "`range`"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 15,
+    "stopIndex" : 80,
+    "fragment" : "range(bigint('+4567890123456789'), bigint('+4567890123456799'), 0)"
+  } ]
+}
+
+
+-- !query
+SELECT * FROM range(bigint('+4567890123456789'), bigint('+4567890123456799'), 2)
+-- !query schema
+struct<id:bigint>
+-- !query output
+4567890123456789
+4567890123456791
+4567890123456793
+4567890123456795
+4567890123456797
+
+
+-- !query
+SELECT string(shiftleft(bigint(-1), 63))
+-- !query schema
+struct<shiftleft(-1, 63):string>
+-- !query output
+-9223372036854775808
+
+
+-- !query
+SELECT string(int(shiftleft(bigint(-1), 63))+1)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "CAST_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "ansiConfig" : "\"spark.sql.ansi.enabled\"",
+    "sourceType" : "\"BIGINT\"",
+    "targetType" : "\"INT\"",
+    "value" : "-9223372036854775808L"
+  }
+}
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) * bigint((-1))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "ARITHMETIC_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "alternative" : " Use 'try_multiply' to tolerate overflow and return NULL instead.",
+    "config" : "\"spark.sql.ansi.enabled\"",
+    "message" : "long overflow"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 52,
+    "fragment" : "bigint((-9223372036854775808)) * bigint((-1))"
+  } ]
+}
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) / bigint((-1))
+-- !query schema
+struct<(-9223372036854775808 / -1):double>
+-- !query output
+9.223372036854776E18
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) % bigint((-1))
+-- !query schema
+struct<(-9223372036854775808 % -1):bigint>
+-- !query output
+0
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) * int((-1))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "ARITHMETIC_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "alternative" : " Use 'try_multiply' to tolerate overflow and return NULL instead.",
+    "config" : "\"spark.sql.ansi.enabled\"",
+    "message" : "long overflow"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 49,
+    "fragment" : "bigint((-9223372036854775808)) * int((-1))"
+  } ]
+}
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) / int((-1))
+-- !query schema
+struct<(-9223372036854775808 / -1):double>
+-- !query output
+9.223372036854776E18
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) % int((-1))
+-- !query schema
+struct<(-9223372036854775808 % -1):bigint>
+-- !query output
+0
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) * smallint((-1))
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "ARITHMETIC_OVERFLOW",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "alternative" : " Use 'try_multiply' to tolerate overflow and return NULL instead.",
+    "config" : "\"spark.sql.ansi.enabled\"",
+    "message" : "long overflow"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 54,
+    "fragment" : "bigint((-9223372036854775808)) * smallint((-1))"
+  } ]
+}
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) / smallint((-1))
+-- !query schema
+struct<(-9223372036854775808 / -1):double>
+-- !query output
+9.223372036854776E18
+
+
+-- !query
+SELECT bigint((-9223372036854775808)) % smallint((-1))
+-- !query schema
+struct<(-9223372036854775808 % -1):bigint>
+-- !query output
+0
+
+
+-- !query
+SELECT x, bigint(x) AS int8_value
+FROM (VALUES (double(-2.5)),
+             (double(-1.5)),
+             (double(-0.5)),
+             (double(0.0)),
+             (double(0.5)),
+             (double(1.5)),
+             (double(2.5))) t(x)
+-- !query schema
+struct<x:double,int8_value:bigint>
+-- !query output
+-0.5	0
+-1.5	-1
+-2.5	-2
+0.0	0
+0.5	0
+1.5	1
+2.5	2
+
+
+-- !query
+SELECT x, bigint(x) AS int8_value
+FROM (VALUES cast(-2.5 as decimal(38, 18)),
+             cast(-1.5 as decimal(38, 18)),
+             cast(-0.5 as decimal(38, 18)),
+             cast(-0.0 as decimal(38, 18)),
+             cast(0.5 as decimal(38, 18)),
+             cast(1.5 as decimal(38, 18)),
+             cast(2.5 as decimal(38, 18))) t(x)
+-- !query schema
+struct<x:decimal(38,18),int8_value:bigint>
+-- !query output
+-0.500000000000000000	0
+-1.500000000000000000	-1
+-2.500000000000000000	-2
+0.000000000000000000	0
+0.500000000000000000	0
+1.500000000000000000	1
+2.500000000000000000	2
+
+
+-- !query
+DROP TABLE INT8_TBL
+-- !query schema
+struct<>
+-- !query output
+
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out.java21
new file mode 100644
index 00000000000..6a26485c04d
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out.java21
@@ -0,0 +1,5251 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+CREATE TABLE num_data (id int, val decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_add (id1 int, id2 int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_sub (id1 int, id2 int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_div (id1 int, id2 int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_mul (id1 int, id2 int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_sqrt (id int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_ln (id int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_log10 (id int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_exp_power_10_ln (id int, expected decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE num_result (id1 int, id2 int, result decimal(38,10)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,2,-34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,2,34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,2,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,2,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,3,4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,3,-4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,3,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,3,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,4,7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,4,-7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,4,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,4,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,5,16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,5,-16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,5,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,5,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,6,93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,6,-93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,6,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,6,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,7,-83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,7,83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,7,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,7,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,8,74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,8,-74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,8,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,8,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (0,9,-24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (0,9,24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (0,9,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (0,9,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,2,-34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,2,34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,2,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,2,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,3,4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,3,-4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,3,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,3,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,4,7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,4,-7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,4,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,4,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,5,16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,5,-16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,5,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,5,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,6,93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,6,-93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,6,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,6,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,7,-83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,7,83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,7,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,7,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,8,74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,8,-74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,8,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,8,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (1,9,-24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (1,9,24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (1,9,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (1,9,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,0,-34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,0,-34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,1,-34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,1,-34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,2,-68676984.430794094)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,2,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,2,1179132047626883.596862135856320209)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,2,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,3,-34338487.905397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,3,-34338496.525397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,3,-147998901.44836127257)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,3,-7967167.56737750510440835266)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,4,-26539030.803497047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,4,-42137953.627297047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,4,-267821744976817.8111137106593)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,4,-4.40267480046830116685)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,5,-34322095.176906047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,5,-34354889.253888047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,5,-563049578578.769242506736077)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,5,-2094.18866914563535496429)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,6,-34244590.637766787)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,6,-34432393.793027307)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,6,-3224438592470.18449811926184222)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,6,-365.68599891479766440940)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,7,-117366977.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,7,48689992.784602953)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,7,2851072985828710.485883795)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,7,.41357483778485235518)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,8,-34263611.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,8,-34413373.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,8,-2571300635581.146276407)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,8,-458.57416721727870888476)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (2,9,-59265296.260444467)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (2,9,-9411688.170349627)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (2,9,855948866655588.453741509242968740)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (2,9,1.37757299946438931811)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,0,4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,0,4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,1,4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,1,4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,2,-34338487.905397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,2,34338496.525397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,2,-147998901.44836127257)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,2,-.00000012551512084352)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,3,8.62)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,3,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,3,18.5761)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,3,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,4,7799465.7219)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,4,-7799457.1019)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,4,33615678.685289)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,4,.00000055260225961552)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,5,16401.348491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,5,-16392.728491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,5,70671.23589621)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,5,.00026285234387695504)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,6,93905.88763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,6,-93897.26763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,6,404715.7995864206)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,6,.00004589912234457595)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,7,-83028480.69)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,7,83028489.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,7,-357852770.35)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,7,-.00000005190989574240)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,8,74885.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,8,-74876.69)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,8,322737.11)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,8,.00005755799201399553)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (3,9,-24926799.735047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (3,9,24926808.355047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (3,9,-107434525.43415438020)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (3,9,-.00000017290624149854)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,0,7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,0,7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,1,7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,1,7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,2,-26539030.803497047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,2,42137953.627297047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,2,-267821744976817.8111137106593)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,2,-.22713465002993920385)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,3,7799465.7219)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,3,7799457.1019)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,3,33615678.685289)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,3,1809619.81714617169373549883)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,4,15598922.8238)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,4,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,4,60831598315717.14146161)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,4,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,5,7815858.450391)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,5,7783064.373409)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,5,127888068979.9935054429)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,5,475.66281046305802686061)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,6,7893362.98953026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,6,7705559.83426974)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,6,732381731243.745115764094)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,6,83.05996138436129499606)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,7,-75229023.5881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,7,90827946.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,7,-647577464846017.9715)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,7,-.09393717604145131637)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,8,7874342.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,8,7724580.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,8,584031469984.4839)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,8,104.15808298366741897143)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (4,9,-17127342.633147420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (4,9,32726265.456947420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (4,9,-194415646271340.1815956522980)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (4,9,-.31289456112403769409)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,0,16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,0,16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,1,16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,1,16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,2,-34322095.176906047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,2,34354889.253888047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,2,-563049578578.769242506736077)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,2,-.00047751189505192446)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,3,16401.348491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,3,16392.728491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,3,70671.23589621)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,3,3804.41728329466357308584)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,4,7815858.450391)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,4,-7783064.373409)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,4,127888068979.9935054429)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,4,.00210232958726897192)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,5,32794.076982)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,5,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,5,268862871.275335557081)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,5,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,6,110298.61612126)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,6,-77504.53913926)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,6,1539707782.76899778633766)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,6,.17461941433576102689)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,7,-83012087.961509)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,7,83044882.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,7,-1361421264394.416135)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,7,-.00019748690453643710)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,8,91278.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,8,-58483.961509)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,8,1227826639.244571)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,8,.21897461960978085228)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (5,9,-24910407.006556420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (5,9,24943201.083538420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (5,9,-408725765384.257043660243220)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (5,9,-.00065780749354660427)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,0,93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,0,93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,1,93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,1,93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,2,-34244590.637766787)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,2,34432393.793027307)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,2,-3224438592470.18449811926184222)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,2,-.00273458651128995823)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,3,93905.88763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,3,93897.26763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,3,404715.7995864206)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,3,21786.90896293735498839907)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,4,7893362.98953026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,4,-7705559.83426974)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,4,732381731243.745115764094)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,4,.01203949512295682469)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,5,110298.61612126)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,5,77504.53913926)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,5,1539707782.76899778633766)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,5,5.72674008674192359679)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,6,187803.15526052)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,6,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,6,8817506281.4517452372676676)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,6,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,7,-82934583.42236974)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,7,83122386.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,7,-7796505729750.37795610)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,7,-.00113095617281538980)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,8,168782.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,8,19020.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,8,7031444034.53149906)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,8,1.25401073209839612184)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (6,9,-24832902.467417160)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (6,9,25020705.622677680)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (6,9,-2340666225110.29929521292692920)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (6,9,-.00376709254265256789)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,0,-83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,0,-83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,1,-83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,1,-83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,2,-117366977.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,2,-48689992.784602953)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,2,2851072985828710.485883795)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,2,2.41794207151503385700)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,3,-83028480.69)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,3,-83028489.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,3,-357852770.35)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,3,-19264149.65197215777262180974)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,4,-75229023.5881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,4,-90827946.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,4,-647577464846017.9715)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,4,-10.64541262725136247686)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,5,-83012087.961509)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,5,-83044882.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,5,-1361421264394.416135)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,5,-5063.62688881730941836574)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,6,-82934583.42236974)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,6,-83122386.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,6,-7796505729750.37795610)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,6,-884.20756174009028770294)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,7,-166056970)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,7,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,7,6893729321395225)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,7,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,8,-82953604)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,8,-83103366)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,8,-6217255985285)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,8,-1108.80577182462841041118)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (7,9,-107955289.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (7,9,-58101680.954952580)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (7,9,2069634775752159.035758700)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (7,9,3.33089171198810413382)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,0,74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,0,74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,1,74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,1,74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,2,-34263611.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,2,34413373.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,2,-2571300635581.146276407)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,2,-.00218067233500788615)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,3,74885.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,3,74876.69)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,3,322737.11)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,3,17373.78190255220417633410)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,4,7874342.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,4,-7724580.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,4,584031469984.4839)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,4,.00960079113741758956)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,5,91278.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,5,58483.961509)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,5,1227826639.244571)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,5,4.56673929509287019456)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,6,168782.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,6,-19020.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,6,7031444034.53149906)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,6,.79744134113322314424)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,7,-82953604)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,7,83103366)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,7,-6217255985285)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,7,-.00090187120721280172)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,8,149762)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,8,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,8,5607164161)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,8,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (8,9,-24851923.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (8,9,25001685.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (8,9,-1866544013697.195857020)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (8,9,-.00300403532938582735)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,0,-24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,0,-24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,1,-24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,1,-24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,2,-59265296.260444467)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,2,9411688.170349627)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,2,855948866655588.453741509242968740)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,2,.72591434384152961526)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,3,-24926799.735047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,3,-24926808.355047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,3,-107434525.43415438020)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,3,-5783481.21694835730858468677)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,4,-17127342.633147420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,4,-32726265.456947420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,4,-194415646271340.1815956522980)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,4,-3.19596478892958416484)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,5,-24910407.006556420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,5,-24943201.083538420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,5,-408725765384.257043660243220)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,5,-1520.20159364322004505807)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,6,-24832902.467417160)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,6,-25020705.622677680)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,6,-2340666225110.29929521292692920)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,6,-265.45671195426965751280)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,7,-107955289.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,7,58101680.954952580)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,7,2069634775752159.035758700)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,7,.30021990699995814689)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,8,-24851923.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,8,-25001685.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,8,-1866544013697.195857020)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,8,-332.88556569820675471748)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_add VALUES (9,9,-49853608.090094840)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sub VALUES (9,9,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_mul VALUES (9,9,621345559900192.420120630048656400)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_div VALUES (9,9,1.00000000000000000000)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (0,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (1,0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (2,5859.90547836712524903505)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (3,2.07605394920266944396)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (4,2792.75158435189147418923)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (5,128.05092147657509145473)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (6,306.43364311096782703406)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (7,9111.99676251039939975230)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (8,273.64392922189960397542)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_sqrt VALUES (9,4992.67503899937593364766)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (2,17.35177750493897715514)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (3,1.46093790411565641971)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (4,15.86956523951936572464)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (5,9.70485601768871834038)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (6,11.45000246622944403127)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (7,18.23469429965478772991)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (8,11.22365546576315513668)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_ln VALUES (9,17.03145425013166006962)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (2,7.53578122160797276459)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (3,.63447727016073160075)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (4,6.89206461372691743345)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (5,4.21476541614777768626)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (6,4.97267288886207207671)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (7,7.91922711353275546914)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (8,4.87437163556421004138)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_log10 VALUES (9,7.39666659961986567059)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (0,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (1,double('NaN'))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (2,224790267919917955.13261618583642653184)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (3,28.90266599445155957393)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (4,7405685069594999.07733999469386277636)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (5,5068226527.32127265408584640098)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (6,281839893606.99372343357047819067)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (7,1716699575118597095.42330819910640247627)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "DECIMAL_PRECISION_EXCEEDS_MAX_PRECISION",
+  "sqlState" : "22003",
+  "messageParameters" : {
+    "maxPrecision" : "38",
+    "precision" : "39"
+  }
+}
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (8,167361463828.07491320069016125952)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_exp_power_10_ln VALUES (9,107511333880052007.04141124673540337457)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (0, 0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (1, 0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (2, -34338492.215397047)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (3, 4.31)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (4, 7799461.4119)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (5, 16397.038491)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (6, 93901.57763026)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (7, -83028485)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (8, 74881)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_data VALUES (9, -24926804.045047420)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM num_data
+-- !query schema
+struct<id:int,val:decimal(38,10)>
+-- !query output
+0	0.0000000000
+1	0.0000000000
+2	-34338492.2153970470
+3	4.3100000000
+4	7799461.4119000000
+5	16397.0384910000
+6	93901.5776302600
+7	-83028485.0000000000
+8	74881.0000000000
+9	-24926804.0450474200
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val + t2.val
+    FROM num_data t1, num_data t2
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+    FROM num_result t1, num_exp_add t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val + t2.val, 10)
+    FROM num_data t1, num_data t2
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 10) as expected
+    FROM num_result t1, num_exp_add t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != round(t2.expected, 10)
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val - t2.val
+    FROM num_data t1, num_data t2
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+    FROM num_result t1, num_exp_sub t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val - t2.val, 40)
+    FROM num_data t1, num_data t2
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 40)
+    FROM num_result t1, num_exp_sub t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != round(t2.expected, 40)
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),round(expected, 40):decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val, t2.val, t1.val * t2.val
+    FROM num_data t1, num_data t2
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+{
+  "errorClass" : "INSERT_COLUMN_ARITY_MISMATCH",
+  "sqlState" : "21S01",
+  "messageParameters" : {
+    "dataColumns" : "'id', 'id', 'val', 'val', '(val * val)'",
+    "reason" : "too many data columns",
+    "tableColumns" : "'id1', 'id2', 'result'",
+    "tableName" : "`spark_catalog`.`default`.`num_result`"
+  }
+}
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+    FROM num_result t1, num_exp_mul t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val * t2.val, 30)
+    FROM num_data t1, num_data t2
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
+    FROM num_result t1, num_exp_mul t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != round(t2.expected, 30)
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+2	2	1179132047626883.5968620000	1179132047626883.5968621359
+2	3	-147998901.4483610000	-147998901.4483612726
+2	4	-267821744976817.8111140000	-267821744976817.8111137107
+2	5	-563049578578.7692430000	-563049578578.7692425067
+2	6	-3224438592470.1844980000	-3224438592470.1844981193
+2	7	2851072985828710.4858840000	2851072985828710.4858837950
+2	8	-2571300635581.1462760000	-2571300635581.1462764070
+2	9	855948866655588.4537420000	855948866655588.4537415092
+3	2	-147998901.4483610000	-147998901.4483612726
+3	5	70671.2358960000	70671.2358962100
+3	6	404715.7995860000	404715.7995864206
+3	9	-107434525.4341540000	-107434525.4341543802
+4	2	-267821744976817.8111140000	-267821744976817.8111137107
+4	4	60831598315717.1414620000	60831598315717.1414616100
+4	5	127888068979.9935050000	127888068979.9935054429
+4	6	732381731243.7451160000	732381731243.7451157641
+4	9	-194415646271340.1815960000	-194415646271340.1815956523
+5	2	-563049578578.7692430000	-563049578578.7692425067
+5	3	70671.2358960000	70671.2358962100
+5	4	127888068979.9935050000	127888068979.9935054429
+5	5	268862871.2753360000	268862871.2753355571
+5	6	1539707782.7689980000	1539707782.7689977863
+5	9	-408725765384.2570440000	-408725765384.2570436602
+6	2	-3224438592470.1844980000	-3224438592470.1844981193
+6	3	404715.7995860000	404715.7995864206
+6	4	732381731243.7451160000	732381731243.7451157641
+6	5	1539707782.7689980000	1539707782.7689977863
+6	6	8817506281.4517450000	8817506281.4517452373
+6	7	-7796505729750.3779560000	-7796505729750.3779561000
+6	8	7031444034.5314990000	7031444034.5314990600
+6	9	-2340666225110.2992950000	-2340666225110.2992952129
+7	2	2851072985828710.4858840000	2851072985828710.4858837950
+7	6	-7796505729750.3779560000	-7796505729750.3779561000
+7	9	2069634775752159.0357590000	2069634775752159.0357587000
+8	2	-2571300635581.1462760000	-2571300635581.1462764070
+8	6	7031444034.5314990000	7031444034.5314990600
+8	9	-1866544013697.1958570000	-1866544013697.1958570200
+9	2	855948866655588.4537420000	855948866655588.4537415092
+9	3	-107434525.4341540000	-107434525.4341543802
+9	4	-194415646271340.1815960000	-194415646271340.1815956523
+9	5	-408725765384.2570440000	-408725765384.2570436602
+9	6	-2340666225110.2992950000	-2340666225110.2992952129
+9	7	2069634775752159.0357590000	2069634775752159.0357587000
+9	8	-1866544013697.1958570000	-1866544013697.1958570200
+9	9	621345559900192.4201210000	621345559900192.4201206300
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, t1.val / t2.val
+    FROM num_data t1, num_data t2
+    WHERE t2.val != '0.0'
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, t2.expected
+    FROM num_result t1, num_exp_div t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+2	3	-7967167.5673780000	-7967167.5673775051
+2	4	-4.4026750000	-4.4026748005
+2	5	-2094.1886690000	-2094.1886691456
+2	6	-365.6859990000	-365.6859989148
+2	7	0.4135750000	0.4135748378
+2	8	-458.5741670000	-458.5741672173
+2	9	1.3775730000	1.3775729995
+3	2	0.0000000000	-0.0000001255
+3	4	0.0000010000	0.0000005526
+3	5	0.0002630000	0.0002628523
+3	6	0.0000460000	0.0000458991
+3	7	0.0000000000	-0.0000000519
+3	8	0.0000580000	0.0000575580
+3	9	0.0000000000	-0.0000001729
+4	2	-0.2271350000	-0.2271346500
+4	3	1809619.8171460000	1809619.8171461717
+4	5	475.6628100000	475.6628104631
+4	6	83.0599610000	83.0599613844
+4	7	-0.0939370000	-0.0939371760
+4	8	104.1580830000	104.1580829837
+4	9	-0.3128950000	-0.3128945611
+5	2	-0.0004780000	-0.0004775119
+5	3	3804.4172830000	3804.4172832947
+5	4	0.0021020000	0.0021023296
+5	6	0.1746190000	0.1746194143
+5	7	-0.0001970000	-0.0001974869
+5	8	0.2189750000	0.2189746196
+5	9	-0.0006580000	-0.0006578075
+6	2	-0.0027350000	-0.0027345865
+6	3	21786.9089630000	21786.9089629374
+6	4	0.0120390000	0.0120394951
+6	5	5.7267400000	5.7267400867
+6	7	-0.0011310000	-0.0011309562
+6	8	1.2540110000	1.2540107321
+6	9	-0.0037670000	-0.0037670925
+7	2	2.4179420000	2.4179420715
+7	3	-19264149.6519720000	-19264149.6519721578
+7	4	-10.6454130000	-10.6454126273
+7	5	-5063.6268890000	-5063.6268888173
+7	6	-884.2075620000	-884.2075617401
+7	8	-1108.8057720000	-1108.8057718246
+7	9	3.3308920000	3.3308917120
+8	2	-0.0021810000	-0.0021806723
+8	3	17373.7819030000	17373.7819025522
+8	4	0.0096010000	0.0096007911
+8	5	4.5667390000	4.5667392951
+8	6	0.7974410000	0.7974413411
+8	7	-0.0009020000	-0.0009018712
+8	9	-0.0030040000	-0.0030040353
+9	2	0.7259140000	0.7259143438
+9	3	-5783481.2169480000	-5783481.2169483573
+9	4	-3.1959650000	-3.1959647889
+9	5	-1520.2015940000	-1520.2015936432
+9	6	-265.4567120000	-265.4567119543
+9	7	0.3002200000	0.3002199070
+9	8	-332.8855660000	-332.8855656982
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT t1.id, t2.id, round(t1.val / t2.val, 80)
+    FROM num_data t1, num_data t2
+    WHERE t2.val != '0.0'
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
+    FROM num_result t1, num_exp_div t2
+    WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2
+    AND t1.result != round(t2.expected, 80)
+-- !query schema
+struct<id1:int,id2:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+2	3	-7967167.5673780000	-7967167.5673775051
+2	4	-4.4026750000	-4.4026748005
+2	5	-2094.1886690000	-2094.1886691456
+2	6	-365.6859990000	-365.6859989148
+2	7	0.4135750000	0.4135748378
+2	8	-458.5741670000	-458.5741672173
+2	9	1.3775730000	1.3775729995
+3	2	0.0000000000	-0.0000001255
+3	4	0.0000010000	0.0000005526
+3	5	0.0002630000	0.0002628523
+3	6	0.0000460000	0.0000458991
+3	7	0.0000000000	-0.0000000519
+3	8	0.0000580000	0.0000575580
+3	9	0.0000000000	-0.0000001729
+4	2	-0.2271350000	-0.2271346500
+4	3	1809619.8171460000	1809619.8171461717
+4	5	475.6628100000	475.6628104631
+4	6	83.0599610000	83.0599613844
+4	7	-0.0939370000	-0.0939371760
+4	8	104.1580830000	104.1580829837
+4	9	-0.3128950000	-0.3128945611
+5	2	-0.0004780000	-0.0004775119
+5	3	3804.4172830000	3804.4172832947
+5	4	0.0021020000	0.0021023296
+5	6	0.1746190000	0.1746194143
+5	7	-0.0001970000	-0.0001974869
+5	8	0.2189750000	0.2189746196
+5	9	-0.0006580000	-0.0006578075
+6	2	-0.0027350000	-0.0027345865
+6	3	21786.9089630000	21786.9089629374
+6	4	0.0120390000	0.0120394951
+6	5	5.7267400000	5.7267400867
+6	7	-0.0011310000	-0.0011309562
+6	8	1.2540110000	1.2540107321
+6	9	-0.0037670000	-0.0037670925
+7	2	2.4179420000	2.4179420715
+7	3	-19264149.6519720000	-19264149.6519721578
+7	4	-10.6454130000	-10.6454126273
+7	5	-5063.6268890000	-5063.6268888173
+7	6	-884.2075620000	-884.2075617401
+7	8	-1108.8057720000	-1108.8057718246
+7	9	3.3308920000	3.3308917120
+8	2	-0.0021810000	-0.0021806723
+8	3	17373.7819030000	17373.7819025522
+8	4	0.0096010000	0.0096007911
+8	5	4.5667390000	4.5667392951
+8	6	0.7974410000	0.7974413411
+8	7	-0.0009020000	-0.0009018712
+8	9	-0.0030040000	-0.0030040353
+9	2	0.7259140000	0.7259143438
+9	3	-5783481.2169480000	-5783481.2169483573
+9	4	-3.1959650000	-3.1959647889
+9	5	-1520.2015940000	-1520.2015936432
+9	6	-265.4567120000	-265.4567119543
+9	7	0.3002200000	0.3002199070
+9	8	-332.8855660000	-332.8855656982
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT id, 0, SQRT(ABS(val))
+    FROM num_data
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.result, t2.expected
+    FROM num_result t1, num_exp_sqrt t2
+    WHERE t1.id1 = t2.id
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT id, 0, LN(ABS(val))
+    FROM num_data
+    WHERE val != '0.0'
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.result, t2.expected
+    FROM num_result t1, num_exp_ln t2
+    WHERE t1.id1 = t2.id
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT id, 0, LOG(cast('10' as decimal(38, 18)), ABS(val))
+    FROM num_data
+    WHERE val != '0.0'
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.result, t2.expected
+    FROM num_result t1, num_exp_log10 t2
+    WHERE t1.id1 = t2.id
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+
+
+
+-- !query
+TRUNCATE TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_result SELECT id, 0, POWER(cast('10' as decimal(38, 18)), LN(ABS(round(val,200))))
+    FROM num_data
+    WHERE val != '0.0'
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT t1.id1, t1.result, t2.expected
+    FROM num_result t1, num_exp_power_10_ln t2
+    WHERE t1.id1 = t2.id
+    AND t1.result != t2.expected
+-- !query schema
+struct<id1:int,result:decimal(38,10),expected:decimal(38,10)>
+-- !query output
+2	224790267919917440.0000000000	224790267919917955.1326161858
+4	7405685069595001.0000000000	7405685069594999.0773399947
+5	5068226527.3212630000	5068226527.3212726541
+6	281839893606.9936500000	281839893606.9937234336
+8	167361463828.0749000000	167361463828.0749132007
+9	107511333880051870.0000000000	107511333880052007.0414112467
+
+
+-- !query
+SELECT AVG(val) FROM num_data
+-- !query schema
+struct<avg(val):decimal(38,14)>
+-- !query output
+-13430913.59224232070000
+
+
+-- !query
+CREATE TABLE fract_only (id int, val decimal(4,4)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO fract_only VALUES (1, 0.0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO fract_only VALUES (2, 0.1)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO fract_only VALUES (4, -0.9999)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO fract_only VALUES (5, 0.99994)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO fract_only VALUES (7, 0.00001)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO fract_only VALUES (8, 0.00017)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM fract_only
+-- !query schema
+struct<id:int,val:decimal(4,4)>
+-- !query output
+1	0.0000
+2	0.1000
+4	-0.9999
+5	0.9999
+7	0.0000
+8	0.0002
+
+
+-- !query
+DROP TABLE fract_only
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT decimal(double('NaN'))
+-- !query schema
+struct<NaN:decimal(10,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT decimal(double('Infinity'))
+-- !query schema
+struct<Infinity:decimal(10,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT decimal(double('-Infinity'))
+-- !query schema
+struct<-Infinity:decimal(10,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT decimal(float('NaN'))
+-- !query schema
+struct<NaN:decimal(10,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT decimal(float('Infinity'))
+-- !query schema
+struct<Infinity:decimal(10,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT decimal(float('-Infinity'))
+-- !query schema
+struct<-Infinity:decimal(10,0)>
+-- !query output
+NULL
+
+
+-- !query
+CREATE TABLE ceil_floor_round (a decimal(38, 18)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (-5.5)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (-5.499999)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (9.5)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (9.4999999)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (0.0)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (0.0000001)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO ceil_floor_round VALUES (-0.000001)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT a, ceil(a), ceiling(a), floor(a), round(a) FROM ceil_floor_round
+-- !query schema
+struct<a:decimal(38,18),CEIL(a):decimal(21,0),ceiling(a):decimal(21,0),FLOOR(a):decimal(21,0),round(a, 0):decimal(21,0)>
+-- !query output
+-0.000001000000000000	0	0	-1	0
+-5.499999000000000000	-5	-5	-6	-5
+-5.500000000000000000	-5	-5	-6	-6
+0.000000000000000000	0	0	0	0
+0.000000100000000000	1	1	0	0
+9.499999900000000000	10	10	9	9
+9.500000000000000000	10	10	9	10
+
+
+-- !query
+DROP TABLE ceil_floor_round
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT width_bucket(5.0, 3.0, 4.0, 0)
+-- !query schema
+struct<width_bucket(5.0, 3.0, 4.0, 0):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(5.0, 3.0, 4.0, -5)
+-- !query schema
+struct<width_bucket(5.0, 3.0, 4.0, -5):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(3.5, 3.0, 3.0, 888)
+-- !query schema
+struct<width_bucket(3.5, 3.0, 3.0, 888):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(double(5.0), double(3.0), double(4.0), 0)
+-- !query schema
+struct<width_bucket(5.0, 3.0, 4.0, 0):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(double(5.0), double(3.0), double(4.0), -5)
+-- !query schema
+struct<width_bucket(5.0, 3.0, 4.0, -5):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(double(3.5), double(3.0), double(3.0), 888)
+-- !query schema
+struct<width_bucket(3.5, 3.0, 3.0, 888):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket('NaN', 3.0, 4.0, 888)
+-- !query schema
+struct<width_bucket(NaN, 3.0, 4.0, 888):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(double(0), 'NaN', double(4.0), 888)
+-- !query schema
+struct<width_bucket(0, NaN, 4.0, 888):bigint>
+-- !query output
+NULL
+
+
+-- !query
+CREATE TABLE width_bucket_test (operand_num decimal(30,15), operand_f8 double) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO width_bucket_test VALUES
+    (-5.2, -5.2),
+    (-0.0000000001, -0.0000000001),
+    (0.000000000001, 0.000000000001),
+    (1, 1),
+    (1.99999999999999, 1.99999999999999),
+    (2, 2),
+    (2.00000000000001, 2.00000000000001),
+    (3, 3),
+    (4, 4),
+    (4.5, 4.5),
+    (5, 5),
+    (5.5, 5.5),
+    (6, 6),
+    (7, 7),
+    (8, 8),
+    (9, 9),
+    (9.99999999999999, 9.99999999999999),
+    (10, 10),
+    (10.0000000000001, 10.0000000000001)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT
+    operand_num,
+    width_bucket(operand_num, 0, 10, 5) AS wb_1,
+    width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
+    width_bucket(operand_num, 10, 0, 5) AS wb_2,
+    width_bucket(operand_f8, 10, 0, 5) AS wb_2f,
+    width_bucket(operand_num, 2, 8, 4) AS wb_3,
+    width_bucket(operand_f8, 2, 8, 4) AS wb_3f,
+    width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4,
+    width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f,
+    width_bucket(operand_num, -25, 25, 10) AS wb_5,
+    width_bucket(operand_f8, -25, 25, 10) AS wb_5f
+    FROM width_bucket_test
+    ORDER BY operand_num ASC
+-- !query schema
+struct<operand_num:decimal(30,15),wb_1:bigint,wb_1f:bigint,wb_2:bigint,wb_2f:bigint,wb_3:bigint,wb_3f:bigint,wb_4:bigint,wb_4f:bigint,wb_5:bigint,wb_5f:bigint>
+-- !query output
+-5.200000000000000	0	0	6	6	0	0	0	0	4	4
+-0.000000000100000	0	0	6	6	0	0	0	0	5	5
+0.000000000001000	1	1	5	5	0	0	0	0	6	6
+1.000000000000000	1	1	5	5	0	0	0	0	6	6
+1.999999999999990	1	1	5	5	0	0	0	0	6	6
+2.000000000000000	2	2	5	5	1	1	0	0	6	6
+2.000000000000010	2	2	4	4	1	1	0	0	6	6
+3.000000000000000	2	2	4	4	1	1	0	0	6	6
+4.000000000000000	3	3	4	4	2	2	0	0	6	6
+4.500000000000000	3	3	3	3	2	2	0	0	6	6
+5.000000000000000	3	3	3	3	3	3	1	1	7	7
+5.500000000000000	3	3	3	3	3	3	21	21	7	7
+6.000000000000000	4	4	3	3	3	3	21	21	7	7
+7.000000000000000	4	4	2	2	4	4	21	21	7	7
+8.000000000000000	5	5	2	2	5	5	21	21	7	7
+9.000000000000000	5	5	1	1	5	5	21	21	7	7
+9.999999999999990	5	5	1	1	5	5	21	21	7	7
+10.000000000000000	6	6	1	1	5	5	21	21	8	8
+10.000000000000100	6	6	0	0	5	5	21	21	8	8
+
+
+-- !query
+SELECT width_bucket(double(0.0), double('Infinity'), 5, 10)
+-- !query schema
+struct<width_bucket(0.0, Infinity, 5, 10):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(double(0.0), 5, double('-Infinity'), 20)
+-- !query schema
+struct<width_bucket(0.0, 5, -Infinity, 20):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT width_bucket(double('Infinity'), 1, 10, 10),
+       width_bucket(double('-Infinity'), 1, 10, 10)
+-- !query schema
+struct<width_bucket(Infinity, 1, 10, 10):bigint,width_bucket(-Infinity, 1, 10, 10):bigint>
+-- !query output
+11	0
+
+
+-- !query
+DROP TABLE width_bucket_test
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT '' AS to_char_3, to_char(val, '9999999999999999.999999999999999PR'), val
+FROM num_data
+-- !query schema
+struct<to_char_3:string,to_char(val, 9999999999999999.999999999999999PR):string,val:decimal(38,10)>
+-- !query output
+	               0.000000000000000  	0.0000000000
+	               0.000000000000000  	0.0000000000
+	               4.310000000000000  	4.3100000000
+	           16397.038491000000000  	16397.0384910000
+	           74881.000000000000000  	74881.0000000000
+	           93901.577630260000000  	93901.5776302600
+	         7799461.411900000000000  	7799461.4119000000
+	        <24926804.045047420000000>	-24926804.0450474200
+	        <34338492.215397047000000>	-34338492.2153970470
+	        <83028485.000000000000000>	-83028485.0000000000
+
+
+-- !query
+SELECT '' AS to_char_4, to_char(val, '9999999999999999.999999999999999S'), val
+FROM num_data
+-- !query schema
+struct<to_char_4:string,to_char(val, 9999999999999999.999999999999999S):string,val:decimal(38,10)>
+-- !query output
+	               0.000000000000000+	0.0000000000
+	               0.000000000000000+	0.0000000000
+	               4.310000000000000+	4.3100000000
+	           16397.038491000000000+	16397.0384910000
+	           74881.000000000000000+	74881.0000000000
+	           93901.577630260000000+	93901.5776302600
+	         7799461.411900000000000+	7799461.4119000000
+	        24926804.045047420000000-	-24926804.0450474200
+	        34338492.215397047000000-	-34338492.2153970470
+	        83028485.000000000000000-	-83028485.0000000000
+
+
+-- !query
+SELECT '' AS to_char_5,  to_char(val, 'MI9999999999999999.999999999999999'), val     FROM num_data
+-- !query schema
+struct<to_char_5:string,to_char(val, MI9999999999999999.999999999999999):string,val:decimal(38,10)>
+-- !query output
+	                0.000000000000000	0.0000000000
+	                0.000000000000000	0.0000000000
+	                4.310000000000000	4.3100000000
+	            16397.038491000000000	16397.0384910000
+	            74881.000000000000000	74881.0000000000
+	            93901.577630260000000	93901.5776302600
+	          7799461.411900000000000	7799461.4119000000
+	        -24926804.045047420000000	-24926804.0450474200
+	        -34338492.215397047000000	-34338492.2153970470
+	        -83028485.000000000000000	-83028485.0000000000
+
+
+-- !query
+SELECT '' AS to_char_9,  to_char(val, '0999999999999999.999999999999999'), val       FROM num_data
+-- !query schema
+struct<to_char_9:string,to_char(val, 0999999999999999.999999999999999):string,val:decimal(38,10)>
+-- !query output
+	0000000000000000.000000000000000	0.0000000000
+	0000000000000000.000000000000000	0.0000000000
+	0000000000000004.310000000000000	4.3100000000
+	0000000000016397.038491000000000	16397.0384910000
+	0000000000074881.000000000000000	74881.0000000000
+	0000000000093901.577630260000000	93901.5776302600
+	0000000007799461.411900000000000	7799461.4119000000
+	0000000024926804.045047420000000	-24926804.0450474200
+	0000000034338492.215397047000000	-34338492.2153970470
+	0000000083028485.000000000000000	-83028485.0000000000
+
+
+-- !query
+SELECT '' AS to_char_10, to_char(val, 'S0999999999999999.999999999999999'), val      FROM num_data
+-- !query schema
+struct<to_char_10:string,to_char(val, S0999999999999999.999999999999999):string,val:decimal(38,10)>
+-- !query output
+	+0000000000000000.000000000000000	0.0000000000
+	+0000000000000000.000000000000000	0.0000000000
+	+0000000000000004.310000000000000	4.3100000000
+	+0000000000016397.038491000000000	16397.0384910000
+	+0000000000074881.000000000000000	74881.0000000000
+	+0000000000093901.577630260000000	93901.5776302600
+	+0000000007799461.411900000000000	7799461.4119000000
+	-0000000024926804.045047420000000	-24926804.0450474200
+	-0000000034338492.215397047000000	-34338492.2153970470
+	-0000000083028485.000000000000000	-83028485.0000000000
+
+
+-- !query
+SELECT '' AS to_number_1,  to_number('-34,338,492', '99G999G999')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkIllegalArgumentException
+{
+  "errorClass" : "_LEGACY_ERROR_TEMP_2278",
+  "messageParameters" : {
+    "format" : "99G999G999",
+    "input" : "-34,338,492",
+    "valueType" : "string"
+  }
+}
+
+
+-- !query
+SELECT '' AS to_number_2,  to_number('-34,338,492.654,878', '99G999G999D999G999')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+{
+  "errorClass" : "INVALID_FORMAT.THOUSANDS_SEPS_MUST_BEFORE_DEC",
+  "sqlState" : "42601",
+  "messageParameters" : {
+    "format" : "'99G999G999D999G999'"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 28,
+    "stopIndex" : 81,
+    "fragment" : "to_number('-34,338,492.654,878', '99G999G999D999G999')"
+  } ]
+}
+
+
+-- !query
+SELECT '' AS to_number_4,  to_number('0.00001-', '9.999999S')
+-- !query schema
+struct<to_number_4:string,to_number(0.00001-, 9.999999S):decimal(7,6)>
+-- !query output
+	-0.000010
+
+
+-- !query
+SELECT '' AS to_number_9,  to_number('.0', '99999999.99999999')
+-- !query schema
+struct<to_number_9:string,to_number(.0, 99999999.99999999):decimal(16,8)>
+-- !query output
+	0.00000000
+
+
+-- !query
+SELECT '' AS to_number_10, to_number('0', '99.99')
+-- !query schema
+struct<to_number_10:string,to_number(0, 99.99):decimal(4,2)>
+-- !query output
+	0.00
+
+
+-- !query
+SELECT '' AS to_number_12, to_number('.01-', '99.99S')
+-- !query schema
+struct<to_number_12:string,to_number(.01-, 99.99S):decimal(4,2)>
+-- !query output
+	-0.01
+
+
+-- !query
+SELECT '' AS to_number_14, to_number('34,50','999,99')
+-- !query schema
+struct<to_number_14:string,to_number(34,50, 999,99):decimal(5,0)>
+-- !query output
+	3450
+
+
+-- !query
+SELECT '' AS to_number_15, to_number('123,000','999G')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+{
+  "errorClass" : "INVALID_FORMAT.CONT_THOUSANDS_SEPS",
+  "sqlState" : "42601",
+  "messageParameters" : {
+    "format" : "'999G'"
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 28,
+    "stopIndex" : 54,
+    "fragment" : "to_number('123,000','999G')"
+  } ]
+}
+
+
+-- !query
+SELECT '' AS to_number_16, to_number('123456','999G999')
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkIllegalArgumentException
+{
+  "errorClass" : "_LEGACY_ERROR_TEMP_2278",
+  "messageParameters" : {
+    "format" : "999G999",
+    "input" : "123456",
+    "valueType" : "string"
+  }
+}
+
+
+-- !query
+CREATE TABLE num_input_test (n1 decimal(38, 18)) USING parquet
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_input_test VALUES (double(trim(' 123')))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_input_test VALUES (double(trim('   3245874    ')))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_input_test VALUES (double(trim('  -93853')))
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_input_test VALUES (555.50)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+INSERT INTO num_input_test VALUES (-555.50)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM num_input_test
+-- !query schema
+struct<n1:decimal(38,18)>
+-- !query output
+-555.500000000000000000
+-93853.000000000000000000
+123.000000000000000000
+3245874.000000000000000000
+555.500000000000000000
+
+
+-- !query
+select cast(999999999999999999999 as decimal(38, 0))/1000000000000000000000
+-- !query schema
+struct<(CAST(999999999999999999999 AS DECIMAL(38,0)) / 1000000000000000000000):decimal(38,6)>
+-- !query output
+1.000000
+
+
+-- !query
+select div(cast(999999999999999999999 as decimal(38, 0)),1000000000000000000000)
+-- !query schema
+struct<(CAST(999999999999999999999 AS DECIMAL(38,0)) div 1000000000000000000000):bigint>
+-- !query output
+0
+
+
+-- !query
+select mod(cast(999999999999999999999 as decimal(38, 0)),1000000000000000000000)
+-- !query schema
+struct<mod(CAST(999999999999999999999 AS DECIMAL(38,0)), 1000000000000000000000):decimal(22,0)>
+-- !query output
+999999999999999999999
+
+
+-- !query
+select div(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000)
+-- !query schema
+struct<(CAST(-9999999999999999999999 AS DECIMAL(38,0)) div 1000000000000000000000):bigint>
+-- !query output
+-9
+
+
+-- !query
+select mod(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000)
+-- !query schema
+struct<mod(CAST(-9999999999999999999999 AS DECIMAL(38,0)), 1000000000000000000000):decimal(22,0)>
+-- !query output
+-999999999999999999999
+
+
+-- !query
+select div(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000)*1000000000000000000000 + mod(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000)
+-- !query schema
+struct<(((CAST(-9999999999999999999999 AS DECIMAL(38,0)) div 1000000000000000000000) * 1000000000000000000000) + mod(CAST(-9999999999999999999999 AS DECIMAL(38,0)), 1000000000000000000000)):decimal(38,0)>
+-- !query output
+-9999999999999999999999
+
+
+-- !query
+select mod (70.0,70)
+-- !query schema
+struct<mod(70.0, 70):decimal(3,1)>
+-- !query output
+0.0
+
+
+-- !query
+select div (70.0,70)
+-- !query schema
+struct<(70.0 div 70):bigint>
+-- !query output
+1
+
+
+-- !query
+select 70.0 / 70
+-- !query schema
+struct<(70.0 / 70):decimal(8,6)>
+-- !query output
+1.000000
+
+
+-- !query
+select 12345678901234567890 % 123
+-- !query schema
+struct<(12345678901234567890 % 123):decimal(3,0)>
+-- !query output
+78
+
+
+-- !query
+select exp(0.0)
+-- !query schema
+struct<EXP(0.0):double>
+-- !query output
+1.0
+
+
+-- !query
+select exp(1.0)
+-- !query schema
+struct<EXP(1.0):double>
+-- !query output
+2.7182818284590455
+
+
+-- !query
+select exp(32.999)
+-- !query schema
+struct<EXP(32.999):double>
+-- !query output
+2.1442904349215556E14
+
+
+-- !query
+select exp(-32.999)
+-- !query schema
+struct<EXP(-32.999):double>
+-- !query output
+4.663547361468238E-15
+
+
+-- !query
+select exp(123.456)
+-- !query schema
+struct<EXP(123.456):double>
+-- !query output
+4.132944352778106E53
+
+
+-- !query
+select exp(-123.456)
+-- !query schema
+struct<EXP(-123.456):double>
+-- !query output
+2.4195825412645934E-54
+
+
+-- !query
+select exp(1234.5678)
+-- !query schema
+struct<EXP(1234.5678):double>
+-- !query output
+Infinity
+
+
+-- !query
+select * from range(cast(0.0 as decimal(38, 18)), cast(4.0 as decimal(38, 18)))
+-- !query schema
+struct<id:bigint>
+-- !query output
+0
+1
+2
+3
+
+
+-- !query
+select * from range(cast(0.1 as decimal(38, 18)), cast(4.0 as decimal(38, 18)), cast(1.3 as decimal(38, 18)))
+-- !query schema
+struct<id:bigint>
+-- !query output
+0
+1
+2
+3
+
+
+-- !query
+select * from range(cast(4.0 as decimal(38, 18)), cast(-1.5 as decimal(38, 18)), cast(-2.2 as decimal(38, 18)))
+-- !query schema
+struct<id:bigint>
+-- !query output
+0
+2
+4
+
+
+-- !query
+select ln(1.2345678e-28)
+-- !query schema
+struct<ln(1.2345678E-28):double>
+-- !query output
+-64.26166165451762
+
+
+-- !query
+select ln(0.0456789)
+-- !query schema
+struct<ln(0.0456789):double>
+-- !query output
+-3.0861187944847437
+
+
+-- !query
+select ln(0.99949452)
+-- !query schema
+struct<ln(0.99949452):double>
+-- !query output
+-5.056077980832118E-4
+
+
+-- !query
+select ln(1.00049687395)
+-- !query schema
+struct<ln(1.00049687395):double>
+-- !query output
+4.967505490136803E-4
+
+
+-- !query
+select ln(1234.567890123456789)
+-- !query schema
+struct<ln(1234.567890123456789):double>
+-- !query output
+7.11847630129779
+
+
+-- !query
+select ln(5.80397490724e5)
+-- !query schema
+struct<ln(580397.490724):double>
+-- !query output
+13.271468476626518
+
+
+-- !query
+select ln(9.342536355e34)
+-- !query schema
+struct<ln(9.342536355E34):double>
+-- !query output
+80.52247093552418
+
+
+-- !query
+select log(3.4634998359873254962349856073435545)
+-- !query schema
+struct<LOG(E(), 3.4634998359873254962349856073435545):double>
+-- !query output
+1.2422795911259166
+
+
+-- !query
+select log(9.999999999999999999)
+-- !query schema
+struct<LOG(E(), 9.999999999999999999):double>
+-- !query output
+2.302585092994046
+
+
+-- !query
+select log(10.00000000000000000)
+-- !query schema
+struct<LOG(E(), 10.00000000000000000):double>
+-- !query output
+2.302585092994046
+
+
+-- !query
+select log(10.00000000000000001)
+-- !query schema
+struct<LOG(E(), 10.00000000000000001):double>
+-- !query output
+2.302585092994046
+
+
+-- !query
+select log(590489.45235237)
+-- !query schema
+struct<LOG(E(), 590489.45235237):double>
+-- !query output
+13.288707052228641
+
+
+-- !query
+select log(0.99923, 4.58934e34)
+-- !query schema
+struct<LOG(0.99923, 4.58934E34):double>
+-- !query output
+-103611.55579543479
+
+
+-- !query
+select log(1.000016, 8.452010e18)
+-- !query schema
+struct<LOG(1.000016, 8.45201E18):double>
+-- !query output
+2723830.287707013
+
+
+-- !query
+SELECT SUM(decimal(9999)) FROM range(1, 100001)
+-- !query schema
+struct<sum(9999):decimal(20,0)>
+-- !query output
+999900000
+
+
+-- !query
+SELECT SUM(decimal(-9999)) FROM range(1, 100001)
+-- !query schema
+struct<sum(-9999):decimal(20,0)>
+-- !query output
+-999900000
+
+
+-- !query
+DROP TABLE num_data
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_add
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_sub
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_div
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_mul
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_sqrt
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_ln
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_log10
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_exp_power_10_ln
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_result
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+DROP TABLE num_input_test
+-- !query schema
+struct<>
+-- !query output
+
diff --git a/sql/core/src/test/resources/sql-tests/results/try_aggregates.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/try_aggregates.sql.out.java21
new file mode 100644
index 00000000000..7affe568234
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/try_aggregates.sql.out.java21
@@ -0,0 +1,299 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+SELECT try_sum(col) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<try_sum(col):bigint>
+-- !query output
+30
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<try_sum(col):decimal(13,1)>
+-- !query output
+30.0
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<try_sum(col):bigint>
+-- !query output
+25
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (NULL), (NULL) AS tab(col)
+-- !query schema
+struct<try_sum(col):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<try_sum(col):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (98765432109876543210987654321098765432BD), (98765432109876543210987654321098765432BD) AS tab(col)
+-- !query schema
+struct<try_sum(col):decimal(38,0)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval month>
+-- !query output
+0-2
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '2147483647 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval second>
+-- !query output
+0 00:00:02.000000000
+
+
+-- !query
+SELECT try_sum(col) FROM VALUES (interval '106751991 DAYS'), (interval '1 DAYS') AS tab(col)
+-- !query schema
+struct<try_sum(col):interval day>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<try_sum((col / 0)):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<try_sum((col / 0)):decimal(18,6)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<try_sum((col / 0)):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_sum(col + 1L) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<try_sum((col + 1)):bigint>
+-- !query output
+-9223372036854775806
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_sum(col / 0) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+10.0
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<try_avg(col):decimal(7,5)>
+-- !query output
+10.00000
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+12.5
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (NULL), (NULL) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<try_avg(col):double>
+-- !query output
+4.611686018427388E18
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (98765432109876543210987654321098765432BD), (98765432109876543210987654321098765432BD) AS tab(col)
+-- !query schema
+struct<try_avg(col):decimal(38,4)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval year to month>
+-- !query output
+0-1
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '2147483647 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval year to month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval day to second>
+-- !query output
+0 00:00:01.000000000
+
+
+-- !query
+SELECT try_avg(col) FROM VALUES (interval '106751991 DAYS'), (interval '1 DAYS') AS tab(col)
+-- !query schema
+struct<try_avg(col):interval day to second>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (5), (10), (15) AS tab(col)
+-- !query schema
+struct<try_avg((col / 0)):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (5.0), (10.0), (15.0) AS tab(col)
+-- !query schema
+struct<try_avg((col / 0)):decimal(12,10)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (NULL), (10), (15) AS tab(col)
+-- !query schema
+struct<try_avg((col / 0)):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_avg(col + 1L) FROM VALUES (9223372036854775807L), (1L) AS tab(col)
+-- !query schema
+struct<try_avg((col + 1)):double>
+-- !query output
+-4.611686018427388E18
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (interval '1 months'), (interval '1 months') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
+
+
+-- !query
+SELECT try_avg(col / 0) FROM VALUES (interval '1 seconds'), (interval '1 seconds') AS tab(col)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.SparkArithmeticException
+{
+  "errorClass" : "INTERVAL_DIVIDED_BY_ZERO",
+  "sqlState" : "22012",
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 16,
+    "stopIndex" : 22,
+    "fragment" : "col / 0"
+  } ]
+}
diff --git a/sql/core/src/test/resources/sql-tests/results/try_arithmetic.sql.out.java21 b/sql/core/src/test/resources/sql-tests/results/try_arithmetic.sql.out.java21
new file mode 100644
index 00000000000..a1eebe70c71
--- /dev/null
+++ b/sql/core/src/test/resources/sql-tests/results/try_arithmetic.sql.out.java21
@@ -0,0 +1,505 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+SELECT try_add(1, 1)
+-- !query schema
+struct<try_add(1, 1):int>
+-- !query output
+2
+
+
+-- !query
+SELECT try_add(2147483647, 1)
+-- !query schema
+struct<try_add(2147483647, 1):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_add(-2147483648, -1)
+-- !query schema
+struct<try_add(-2147483648, -1):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_add(9223372036854775807L, 1)
+-- !query schema
+struct<try_add(9223372036854775807, 1):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_add(-9223372036854775808L, -1)
+-- !query schema
+struct<try_add(-9223372036854775808, -1):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_add(1, (2147483647 + 1))
+-- !query schema
+struct<try_add(1, (2147483647 + 1)):int>
+-- !query output
+-2147483647
+
+
+-- !query
+SELECT try_add(1L, (9223372036854775807L + 1L))
+-- !query schema
+struct<try_add(1, (9223372036854775807 + 1)):bigint>
+-- !query output
+-9223372036854775807
+
+
+-- !query
+SELECT try_add(1, 1.0 / 0.0)
+-- !query schema
+struct<try_add(1, (1.0 / 0.0)):decimal(9,6)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_add(date'2021-01-01', 1)
+-- !query schema
+struct<try_add(DATE '2021-01-01', 1):date>
+-- !query output
+2021-01-02
+
+
+-- !query
+SELECT try_add(1, date'2021-01-01')
+-- !query schema
+struct<try_add(1, DATE '2021-01-01'):date>
+-- !query output
+2021-01-02
+
+
+-- !query
+SELECT try_add(date'2021-01-01', interval 2 year)
+-- !query schema
+struct<try_add(DATE '2021-01-01', INTERVAL '2' YEAR):date>
+-- !query output
+2023-01-01
+
+
+-- !query
+SELECT try_add(date'2021-01-01', interval 2 second)
+-- !query schema
+struct<try_add(DATE '2021-01-01', INTERVAL '02' SECOND):timestamp>
+-- !query output
+2021-01-01 00:00:02
+
+
+-- !query
+SELECT try_add(interval 2 year, date'2021-01-01')
+-- !query schema
+struct<try_add(INTERVAL '2' YEAR, DATE '2021-01-01'):date>
+-- !query output
+2023-01-01
+
+
+-- !query
+SELECT try_add(interval 2 second, date'2021-01-01')
+-- !query schema
+struct<try_add(INTERVAL '02' SECOND, DATE '2021-01-01'):timestamp>
+-- !query output
+2021-01-01 00:00:02
+
+
+-- !query
+SELECT try_add(timestamp_ltz'2021-01-01 00:00:00', interval 2 year)
+-- !query schema
+struct<try_add(TIMESTAMP '2021-01-01 00:00:00', INTERVAL '2' YEAR):timestamp>
+-- !query output
+2023-01-01 00:00:00
+
+
+-- !query
+SELECT try_add(timestamp_ntz'2021-01-01 00:00:00', interval 2 second)
+-- !query schema
+struct<try_add(TIMESTAMP_NTZ '2021-01-01 00:00:00', INTERVAL '02' SECOND):timestamp_ntz>
+-- !query output
+2021-01-01 00:00:02
+
+
+-- !query
+SELECT try_add(interval 2 year, timestamp_ltz'2021-01-01 00:00:00')
+-- !query schema
+struct<try_add(INTERVAL '2' YEAR, TIMESTAMP '2021-01-01 00:00:00'):timestamp>
+-- !query output
+2023-01-01 00:00:00
+
+
+-- !query
+SELECT try_add(interval 2 second, timestamp_ntz'2021-01-01 00:00:00')
+-- !query schema
+struct<try_add(INTERVAL '02' SECOND, TIMESTAMP_NTZ '2021-01-01 00:00:00'):timestamp_ntz>
+-- !query output
+2021-01-01 00:00:02
+
+
+-- !query
+SELECT try_add(interval 2 year, interval 2 year)
+-- !query schema
+struct<try_add(INTERVAL '2' YEAR, INTERVAL '2' YEAR):interval year>
+-- !query output
+4-0
+
+
+-- !query
+SELECT try_add(interval 2 second, interval 2 second)
+-- !query schema
+struct<try_add(INTERVAL '02' SECOND, INTERVAL '02' SECOND):interval second>
+-- !query output
+0 00:00:04.000000000
+
+
+-- !query
+SELECT try_add(interval 2 year, interval 2 second)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+{
+  "errorClass" : "DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE",
+  "sqlState" : "42K09",
+  "messageParameters" : {
+    "inputSql" : "\"INTERVAL '2' YEAR\"",
+    "inputType" : "\"INTERVAL YEAR\"",
+    "paramIndex" : "1",
+    "requiredType" : "\"(TIMESTAMP OR TIMESTAMP WITHOUT TIME ZONE)\"",
+    "sqlExpr" : "\"INTERVAL '2' YEAR + INTERVAL '02' SECOND\""
+  },
+  "queryContext" : [ {
+    "objectType" : "",
+    "objectName" : "",
+    "startIndex" : 8,
+    "stopIndex" : 50,
+    "fragment" : "try_add(interval 2 year, interval 2 second)"
+  } ]
+}
+
+
+-- !query
+SELECT try_add(interval 2147483647 month, interval 2 month)
+-- !query schema
+struct<try_add(INTERVAL '2147483647' MONTH, INTERVAL '2' MONTH):interval month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_add(interval 106751991 day, interval 3 day)
+-- !query schema
+struct<try_add(INTERVAL '106751991' DAY, INTERVAL '3' DAY):interval day>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(1, 0.5)
+-- !query schema
+struct<try_divide(1, 0.5):decimal(8,6)>
+-- !query output
+2.000000
+
+
+-- !query
+SELECT try_divide(1, 0)
+-- !query schema
+struct<try_divide(1, 0):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(0, 0)
+-- !query schema
+struct<try_divide(0, 0):double>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(1, (2147483647 + 1))
+-- !query schema
+struct<try_divide(1, (2147483647 + 1)):double>
+-- !query output
+-4.656612873077393E-10
+
+
+-- !query
+SELECT try_divide(1L, (9223372036854775807L + 1L))
+-- !query schema
+struct<try_divide(1, (9223372036854775807 + 1)):double>
+-- !query output
+-1.0842021724855044E-19
+
+
+-- !query
+SELECT try_divide(1, 1.0 / 0.0)
+-- !query schema
+struct<try_divide(1, (1.0 / 0.0)):decimal(16,9)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(interval 2 year, 2)
+-- !query schema
+struct<try_divide(INTERVAL '2' YEAR, 2):interval year to month>
+-- !query output
+1-0
+
+
+-- !query
+SELECT try_divide(interval 2 second, 2)
+-- !query schema
+struct<try_divide(INTERVAL '02' SECOND, 2):interval day to second>
+-- !query output
+0 00:00:01.000000000
+
+
+-- !query
+SELECT try_divide(interval 2 year, 0)
+-- !query schema
+struct<try_divide(INTERVAL '2' YEAR, 0):interval year to month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(interval 2 second, 0)
+-- !query schema
+struct<try_divide(INTERVAL '02' SECOND, 0):interval day to second>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(interval 2147483647 month, 0.5)
+-- !query schema
+struct<try_divide(INTERVAL '2147483647' MONTH, 0.5):interval year to month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_divide(interval 106751991 day, 0.5)
+-- !query schema
+struct<try_divide(INTERVAL '106751991' DAY, 0.5):interval day to second>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(1, 1)
+-- !query schema
+struct<try_subtract(1, 1):int>
+-- !query output
+0
+
+
+-- !query
+SELECT try_subtract(2147483647, -1)
+-- !query schema
+struct<try_subtract(2147483647, -1):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(-2147483648, 1)
+-- !query schema
+struct<try_subtract(-2147483648, 1):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(9223372036854775807L, -1)
+-- !query schema
+struct<try_subtract(9223372036854775807, -1):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(-9223372036854775808L, 1)
+-- !query schema
+struct<try_subtract(-9223372036854775808, 1):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(1, (2147483647 + 1))
+-- !query schema
+struct<try_subtract(1, (2147483647 + 1)):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(1L, (9223372036854775807L + 1L))
+-- !query schema
+struct<try_subtract(1, (9223372036854775807 + 1)):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(1, 1.0 / 0.0)
+-- !query schema
+struct<try_subtract(1, (1.0 / 0.0)):decimal(9,6)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(interval 2 year, interval 3 year)
+-- !query schema
+struct<try_subtract(INTERVAL '2' YEAR, INTERVAL '3' YEAR):interval year>
+-- !query output
+-1-0
+
+
+-- !query
+SELECT try_subtract(interval 3 second, interval 2 second)
+-- !query schema
+struct<try_subtract(INTERVAL '03' SECOND, INTERVAL '02' SECOND):interval second>
+-- !query output
+0 00:00:01.000000000
+
+
+-- !query
+SELECT try_subtract(interval 2147483647 month, interval -2 month)
+-- !query schema
+struct<try_subtract(INTERVAL '2147483647' MONTH, INTERVAL '-2' MONTH):interval month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_subtract(interval 106751991 day, interval -3 day)
+-- !query schema
+struct<try_subtract(INTERVAL '106751991' DAY, INTERVAL '-3' DAY):interval day>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(2, 3)
+-- !query schema
+struct<try_multiply(2, 3):int>
+-- !query output
+6
+
+
+-- !query
+SELECT try_multiply(2147483647, -2)
+-- !query schema
+struct<try_multiply(2147483647, -2):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(-2147483648, 2)
+-- !query schema
+struct<try_multiply(-2147483648, 2):int>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(9223372036854775807L, 2)
+-- !query schema
+struct<try_multiply(9223372036854775807, 2):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(-9223372036854775808L, -2)
+-- !query schema
+struct<try_multiply(-9223372036854775808, -2):bigint>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(1, (2147483647 + 1))
+-- !query schema
+struct<try_multiply(1, (2147483647 + 1)):int>
+-- !query output
+-2147483648
+
+
+-- !query
+SELECT try_multiply(1L, (9223372036854775807L + 1L))
+-- !query schema
+struct<try_multiply(1, (9223372036854775807 + 1)):bigint>
+-- !query output
+-9223372036854775808
+
+
+-- !query
+SELECT try_multiply(1, 1.0 / 0.0)
+-- !query schema
+struct<try_multiply(1, (1.0 / 0.0)):decimal(10,6)>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(interval 2 year, 2)
+-- !query schema
+struct<try_multiply(INTERVAL '2' YEAR, 2):interval year to month>
+-- !query output
+4-0
+
+
+-- !query
+SELECT try_multiply(interval 2 second, 2)
+-- !query schema
+struct<try_multiply(INTERVAL '02' SECOND, 2):interval day to second>
+-- !query output
+0 00:00:04.000000000
+
+
+-- !query
+SELECT try_multiply(interval 2 year, 0)
+-- !query schema
+struct<try_multiply(INTERVAL '2' YEAR, 0):interval year to month>
+-- !query output
+0-0
+
+
+-- !query
+SELECT try_multiply(interval 2 second, 0)
+-- !query schema
+struct<try_multiply(INTERVAL '02' SECOND, 0):interval day to second>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+SELECT try_multiply(interval 2147483647 month, 2)
+-- !query schema
+struct<try_multiply(INTERVAL '2147483647' MONTH, 2):interval year to month>
+-- !query output
+NULL
+
+
+-- !query
+SELECT try_multiply(interval 106751991 day, 2)
+-- !query schema
+struct<try_multiply(INTERVAL '106751991' DAY, 2):interval day to second>
+-- !query output
+NULL
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala
index f3d8e883f7f..c76e01a59d6 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala
@@ -33,6 +33,7 @@ import org.apache.spark.sql.catalyst.plans.SQLHelper
 import org.apache.spark.sql.execution.python.{UserDefinedPythonFunction, UserDefinedPythonTableFunction}
 import org.apache.spark.sql.expressions.SparkUserDefinedFunction
 import org.apache.spark.sql.types.{DataType, IntegerType, NullType, StringType, StructType}
+import org.apache.spark.util.Utils
 
 /**
  * This object targets to integrate various UDF test cases so that Scalar UDF, Python UDF,
@@ -305,8 +306,9 @@ object IntegratedUDFTestUtils extends SQLHelper {
 
   lazy val shouldTestPythonUDFs: Boolean = isPythonAvailable && isPySparkAvailable
 
+  // TODO(SPARK-44097) Renable PandasUDF Tests in Java 21
   lazy val shouldTestPandasUDFs: Boolean =
-    isPythonAvailable && isPandasAvailable && isPyArrowAvailable
+    isPythonAvailable && isPandasAvailable && isPyArrowAvailable && !Utils.isJavaVersionAtLeast21
 
   /**
    * A base trait for various UDFs defined in this object.
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala
index e22e40c29ea..b354642eede 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala
@@ -590,9 +590,15 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper
 
   protected lazy val listTestCases: Seq[TestCase] = {
     listFilesRecursively(new File(inputFilePath)).flatMap { file =>
-      val resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out"
-      val analyzerResultFile =
+      var resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out"
+      var analyzerResultFile =
         file.getAbsolutePath.replace(inputFilePath, analyzerGoldenFilePath) + ".out"
+      // JDK-4511638 changes 'toString' result of Float/Double
+      // JDK-8282081 changes DataTimeFormatter 'F' symbol
+      if (Utils.isJavaVersionAtLeast21) {
+        if (new File(resultFile + ".java21").exists()) resultFile += ".java21"
+        if (new File(analyzerResultFile + ".java21").exists()) analyzerResultFile += ".java21"
+      }
       val absPath = file.getAbsolutePath
       val testCaseName = absPath.stripPrefix(inputFilePath).stripPrefix(File.separator)
       val analyzerTestCaseName = s"${testCaseName}_analyzer_test"
diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
index ba9bd30d43a..91c75581b33 100644
--- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
+++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
@@ -34,6 +34,7 @@ import org.apache.spark.sql.execution.HiveResult.{getTimeFormatters, toHiveStrin
 import org.apache.spark.sql.internal.SQLConf
 import org.apache.spark.sql.internal.SQLConf.TimestampTypes
 import org.apache.spark.sql.types._
+import org.apache.spark.util.Utils
 
 // scalastyle:off line.size.limit
 /**
@@ -245,7 +246,12 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ
 
   override lazy val listTestCases: Seq[TestCase] = {
     listFilesRecursively(new File(inputFilePath)).flatMap { file =>
-      val resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out"
+      var resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out"
+      // JDK-4511638 changes 'toString' result of Float/Double
+      // JDK-8282081 changes DataTimeFormatter 'F' symbol
+      if (Utils.isJavaVersionAtLeast21 && (new File(resultFile + ".java21")).exists()) {
+        resultFile += ".java21"
+      }
       val absPath = file.getAbsolutePath
       val testCaseName = absPath.stripPrefix(inputFilePath).stripPrefix(File.separator)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org