diff --git a/docs/sql-migration-guide.md b/docs/sql-migration-guide.md
index 74ba694800d2d..12d734fcbdf52 100644
--- a/docs/sql-migration-guide.md
+++ b/docs/sql-migration-guide.md
@@ -226,6 +226,32 @@ license: |
- Since Spark 3.0, when casting string value to date, timestamp and interval values, the leading and trailing white spaces(<= ACSII 32) will be trimmed before casing, e.g. `cast('2019-10-10\t as date)` results the date value `2019-10-10`. In Spark version 2.4 and earlier, only the trailing space will be removed, thus, the result is `null`.
+ - Since Spark 3.0, we pad decimal numbers with trailing zeros to the scale of the column for `spark-sql` interface, for example:
+
+
+
+ Query
+ |
+
+ Spark 2.4 or Prior
+ |
+
+ Spark 3.0
+ |
+
+
+
+ SELECT CAST(1 AS decimal(38, 18));
+ |
+
+ 1
+ |
+
+ 1.000000000000000000
+ |
+
+
+
## Upgrading from Spark SQL 2.4 to 2.4.1
- The value of `spark.executor.heartbeatInterval`, when specified without units like "30" rather than "30s", was
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala
index 59481ce049165..ea0ed2e8fa11b 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala
@@ -63,7 +63,7 @@ import org.apache.spark.sql.types._
> SELECT _FUNC_(10.0, array(0.5, 0.4, 0.1), 100);
[10.0,10.0,10.0]
> SELECT _FUNC_(10.0, 0.5, 100);
- 10
+ 10.0
""",
since = "2.1.0")
case class ApproximatePercentile(
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
index 3a2dc40862bb8..6c6210994954c 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
@@ -111,9 +111,9 @@ case class If(predicate: Expression, trueValue: Expression, falseValue: Expressi
examples = """
Examples:
> SELECT CASE WHEN 1 > 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END;
- 1
+ 1.0
> SELECT CASE WHEN 1 < 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END;
- 2
+ 2.0
> SELECT CASE WHEN 1 < 0 THEN 1 WHEN 2 < 0 THEN 2.0 END;
NULL
""")
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
index d4e10b3ffc733..f7f7e08462fe1 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
@@ -59,14 +59,6 @@ object HiveResult {
result.map(_.zip(types).map(toHiveString)).map(_.mkString("\t"))
}
- private def formatDecimal(d: java.math.BigDecimal): String = {
- if (d.compareTo(java.math.BigDecimal.ZERO) == 0) {
- java.math.BigDecimal.ZERO.toPlainString
- } else {
- d.stripTrailingZeros().toPlainString // Hive strips trailing zeros
- }
- }
-
private val primitiveTypes = Seq(
StringType,
IntegerType,
@@ -127,7 +119,7 @@ object HiveResult {
case (t: Timestamp, TimestampType) =>
DateTimeUtils.timestampToString(timestampFormatter, DateTimeUtils.fromJavaTimestamp(t))
case (bin: Array[Byte], BinaryType) => new String(bin, StandardCharsets.UTF_8)
- case (decimal: java.math.BigDecimal, DecimalType()) => formatDecimal(decimal)
+ case (decimal: java.math.BigDecimal, DecimalType()) => decimal.toPlainString
case (interval: CalendarInterval, CalendarIntervalType) =>
SQLConf.get.intervalOutputStyle match {
case SQL_STANDARD => toSqlStandardString(interval)
diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
index e12f409f6d47e..67cb0a2b36a92 100644
--- a/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
@@ -24,10 +24,10 @@ select id, a*10, b/10 from decimals_test order by id
-- !query 2 schema
struct
-- !query 2 output
-1 1000 99.9
-2 123451.23 1234.5123
-3 1.234567891011 123.41
-4 1234567891234567890 0.112345678912345679
+1 1000.000000000000000 99.900000000000000000
+2 123451.230000000000000 1234.512300000000000000
+3 1.234567891011000 123.410000000000000000
+4 1234567891234567890.000000000000000 0.112345678912345679
-- !query 3
@@ -35,7 +35,7 @@ select 10.3 * 3.0
-- !query 3 schema
struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)>
-- !query 3 output
-30.9
+30.90
-- !query 4
@@ -43,7 +43,7 @@ select 10.3000 * 3.0
-- !query 4 schema
struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)>
-- !query 4 output
-30.9
+30.90000
-- !query 5
@@ -51,7 +51,7 @@ select 10.30000 * 30.0
-- !query 5 schema
struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)>
-- !query 5 output
-309
+309.000000
-- !query 6
@@ -59,7 +59,7 @@ select 10.300000000000000000 * 3.000000000000000000
-- !query 6 schema
struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)>
-- !query 6 output
-30.9
+30.9000000000000000000000000000000000
-- !query 7
@@ -67,7 +67,7 @@ select 10.300000000000000000 * 3.0000000000000000000
-- !query 7 schema
struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)>
-- !query 7 output
-30.9
+30.9000000000000000000000000000000000
-- !query 8
diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out
index c1488eaf2aa36..5d8a893d334c2 100644
--- a/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out
@@ -169,7 +169,7 @@ select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5, .9e+2, 0.9e+2, 900e-1, 9.e+1
-- !query 17 schema
struct<1.0:double,1.2:double,1E+10:decimal(1,-10),1.5E+5:decimal(2,-4),0.1:double,0.1:double,1E+4:decimal(1,-4),9E+1:decimal(1,-1),9E+1:decimal(1,-1),90.0:decimal(3,1),9E+1:decimal(1,-1)>
-- !query 17 output
-1.0 1.2 10000000000 150000 0.1 0.1 10000 90 90 90 90
+1.0 1.2 10000000000 150000 0.1 0.1 10000 90 90 90.0 90
-- !query 18
@@ -339,7 +339,7 @@ select 90912830918230182310293801923652346786BD, 123.0E-28BD, 123.08BD
-- !query 35 schema
struct<90912830918230182310293801923652346786:decimal(38,0),1.230E-26:decimal(29,29),123.08:decimal(5,2)>
-- !query 35 output
-90912830918230182310293801923652346786 0.0000000000000000000000000123 123.08
+90912830918230182310293801923652346786 0.00000000000000000000000001230 123.08
-- !query 36
diff --git a/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out b/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out
index cbf44548b3cce..6f035a1904ea3 100644
--- a/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out
@@ -56,9 +56,9 @@ select id, a+b, a-b, a*b, a/b from decimals_test order by id
-- !query 6 schema
struct
-- !query 6 output
-1 1099 -899 99900 0.1001
-2 24690.246 0 152402061.885129 1
-3 1234.2234567891011 -1233.9765432108989 152.358023 0.0001
+1 1099.00000000000000000 -899.00000000000000000 99900.000000 0.100100
+2 24690.24600000000000000 0.00000000000000000 152402061.885129 1.000000
+3 1234.22345678910110000 -1233.97654321089890000 152.358023 0.000100
4 123456789123456790.12345678912345679 123456789123456787.87654321087654321 138698367904130467.515623 109890109097814272.043109
@@ -67,10 +67,10 @@ select id, a*10, b/10 from decimals_test order by id
-- !query 7 schema
struct
-- !query 7 output
-1 1000 99.9
-2 123451.23 1234.5123
-3 1.234567891011 123.41
-4 1234567891234567890 0.112345678912345679
+1 1000.000000000000000 99.900000000000000000
+2 123451.230000000000000 1234.512300000000000000
+3 1.234567891011000 123.410000000000000000
+4 1234567891234567890.000000000000000 0.112345678912345679
-- !query 8
@@ -78,7 +78,7 @@ select 10.3 * 3.0
-- !query 8 schema
struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)>
-- !query 8 output
-30.9
+30.90
-- !query 9
@@ -86,7 +86,7 @@ select 10.3000 * 3.0
-- !query 9 schema
struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)>
-- !query 9 output
-30.9
+30.90000
-- !query 10
@@ -94,7 +94,7 @@ select 10.30000 * 30.0
-- !query 10 schema
struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)>
-- !query 10 output
-309
+309.000000
-- !query 11
@@ -102,7 +102,7 @@ select 10.300000000000000000 * 3.000000000000000000
-- !query 11 schema
struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)>
-- !query 11 output
-30.9
+30.9000000000000000000000000000000000
-- !query 12
@@ -110,7 +110,7 @@ select 10.300000000000000000 * 3.0000000000000000000
-- !query 12 schema
struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)>
-- !query 12 output
-30.9
+30.9000000000000000000000000000000000
-- !query 13
@@ -198,9 +198,9 @@ select id, a+b, a-b, a*b, a/b from decimals_test order by id
-- !query 23 schema
struct
-- !query 23 output
-1 1099 -899 NULL 0.1001001001001001
-2 24690.246 0 NULL 1
-3 1234.2234567891011 -1233.9765432108989 NULL 0.000100037913541123
+1 1099.000000000000000000 -899.000000000000000000 NULL 0.100100100100100100
+2 24690.246000000000000000 0.000000000000000000 NULL 1.000000000000000000
+3 1234.223456789101100000 -1233.976543210898900000 NULL 0.000100037913541123
4 123456789123456790.123456789123456789 123456789123456787.876543210876543211 NULL 109890109097814272.043109406191131436
@@ -209,10 +209,10 @@ select id, a*10, b/10 from decimals_test order by id
-- !query 24 schema
struct
-- !query 24 output
-1 1000 99.9
-2 123451.23 1234.5123
-3 1.234567891011 123.41
-4 1234567891234567890 0.1123456789123456789
+1 1000.000000000000000000 99.9000000000000000000
+2 123451.230000000000000000 1234.5123000000000000000
+3 1.234567891011000000 123.4100000000000000000
+4 1234567891234567890.000000000000000000 0.1123456789123456789
-- !query 25
@@ -220,7 +220,7 @@ select 10.3 * 3.0
-- !query 25 schema
struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)>
-- !query 25 output
-30.9
+30.90
-- !query 26
@@ -228,7 +228,7 @@ select 10.3000 * 3.0
-- !query 26 schema
struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)>
-- !query 26 output
-30.9
+30.90000
-- !query 27
@@ -236,7 +236,7 @@ select 10.30000 * 30.0
-- !query 27 schema
struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)>
-- !query 27 output
-309
+309.000000
-- !query 28
@@ -244,7 +244,7 @@ select 10.300000000000000000 * 3.000000000000000000
-- !query 28 schema
struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,36)>
-- !query 28 output
-30.9
+30.900000000000000000000000000000000000
-- !query 29
diff --git a/sql/core/src/test/resources/sql-tests/results/literals.sql.out b/sql/core/src/test/resources/sql-tests/results/literals.sql.out
index c1488eaf2aa36..5d8a893d334c2 100644
--- a/sql/core/src/test/resources/sql-tests/results/literals.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/literals.sql.out
@@ -169,7 +169,7 @@ select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5, .9e+2, 0.9e+2, 900e-1, 9.e+1
-- !query 17 schema
struct<1.0:double,1.2:double,1E+10:decimal(1,-10),1.5E+5:decimal(2,-4),0.1:double,0.1:double,1E+4:decimal(1,-4),9E+1:decimal(1,-1),9E+1:decimal(1,-1),90.0:decimal(3,1),9E+1:decimal(1,-1)>
-- !query 17 output
-1.0 1.2 10000000000 150000 0.1 0.1 10000 90 90 90 90
+1.0 1.2 10000000000 150000 0.1 0.1 10000 90 90 90.0 90
-- !query 18
@@ -339,7 +339,7 @@ select 90912830918230182310293801923652346786BD, 123.0E-28BD, 123.08BD
-- !query 35 schema
struct<90912830918230182310293801923652346786:decimal(38,0),1.230E-26:decimal(29,29),123.08:decimal(5,2)>
-- !query 35 output
-90912830918230182310293801923652346786 0.0000000000000000000000000123 123.08
+90912830918230182310293801923652346786 0.00000000000000000000000001230 123.08
-- !query 36
diff --git a/sql/core/src/test/resources/sql-tests/results/order-by-nulls-ordering.sql.out b/sql/core/src/test/resources/sql-tests/results/order-by-nulls-ordering.sql.out
index c1b63dfb8caef..e1289dd8c8bde 100644
--- a/sql/core/src/test/resources/sql-tests/results/order-by-nulls-ordering.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/order-by-nulls-ordering.sql.out
@@ -206,14 +206,14 @@ select * from spark_10747_mix order by col1 nulls last, col5 nulls last
-- !query 13 schema
struct
-- !query 13 output
-a 1 1.0 1 NULL
-b 2 1.0 1 10
-c 3 2.0 2 15.1
-c 3 2.0 2 NULL
-d 3 2.0 3 0
-d 3 0.0 3 1
-d 3 NULL 4 1
-NULL 3 0.0 3 1
+a 1 1.0 1.00 NULL
+b 2 1.0 1.00 10.0
+c 3 2.0 2.00 15.1
+c 3 2.0 2.00 NULL
+d 3 2.0 3.00 0.0
+d 3 0.0 3.00 1.0
+d 3 NULL 4.00 1.0
+NULL 3 0.0 3.00 1.0
-- !query 14
@@ -221,14 +221,14 @@ select * from spark_10747_mix order by col1 desc nulls first, col5 desc nulls fi
-- !query 14 schema
struct
-- !query 14 output
-NULL 3 0.0 3 1
-d 3 0.0 3 1
-d 3 NULL 4 1
-d 3 2.0 3 0
-c 3 2.0 2 NULL
-c 3 2.0 2 15.1
-b 2 1.0 1 10
-a 1 1.0 1 NULL
+NULL 3 0.0 3.00 1.0
+d 3 0.0 3.00 1.0
+d 3 NULL 4.00 1.0
+d 3 2.0 3.00 0.0
+c 3 2.0 2.00 NULL
+c 3 2.0 2.00 15.1
+b 2 1.0 1.00 10.0
+a 1 1.0 1.00 NULL
-- !query 15
@@ -236,14 +236,14 @@ select * from spark_10747_mix order by col5 desc nulls first, col3 desc nulls la
-- !query 15 schema
struct
-- !query 15 output
-c 3 2.0 2 NULL
-a 1 1.0 1 NULL
-c 3 2.0 2 15.1
-b 2 1.0 1 10
-d 3 0.0 3 1
-NULL 3 0.0 3 1
-d 3 NULL 4 1
-d 3 2.0 3 0
+c 3 2.0 2.00 NULL
+a 1 1.0 1.00 NULL
+c 3 2.0 2.00 15.1
+b 2 1.0 1.00 10.0
+d 3 0.0 3.00 1.0
+NULL 3 0.0 3.00 1.0
+d 3 NULL 4.00 1.0
+d 3 2.0 3.00 0.0
-- !query 16
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out
index 031918961df4c..cd4d3e64b8da1 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out
@@ -956,7 +956,7 @@ SELECT * FROM tt1
struct
-- !query 83 output
0123456789 abc 42.12 abc
-abc 0123456789 42 abcd
+abc 0123456789 42.00 abcd
-- !query 84
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out
index 68ff2a9f68899..5371e07423c28 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out
@@ -576,7 +576,7 @@ SELECT EXTRACT(EPOCH FROM DATE '1970-01-01')
-- !query 54 schema
struct
-- !query 54 output
-0
+0.000000
-- !query 55
@@ -584,7 +584,7 @@ SELECT EXTRACT(EPOCH FROM TIMESTAMP '1970-01-01')
-- !query 55 schema
struct
-- !query 55 output
-0
+0.000000
-- !query 56
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out
index 8f41accfc8c49..d0a14618a5163 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out
@@ -346,13 +346,13 @@ FROM (VALUES cast(-2.5 as decimal(38, 18)),
-- !query 33 schema
struct
-- !query 33 output
--0.5 0
--1.5 -1
--2.5 -2
-0 0
-0.5 0
-1.5 1
-2.5 2
+-0.500000000000000000 0
+-1.500000000000000000 -1
+-2.500000000000000000 -2
+0.000000000000000000 0
+0.500000000000000000 0
+1.500000000000000000 1
+2.500000000000000000 2
-- !query 34
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out
index 6b1a8eb4a5883..30afd6e695842 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out
@@ -495,13 +495,13 @@ FROM (VALUES cast(-2.5 as decimal(38, 18)),
-- !query 51 schema
struct
-- !query 51 output
--0.5 0
--1.5 -1
--2.5 -2
-0 0
-0.5 0
-1.5 1
-2.5 2
+-0.500000000000000000 0
+-1.500000000000000000 -1
+-2.500000000000000000 -2
+0.000000000000000000 0
+0.500000000000000000 0
+1.500000000000000000 1
+2.500000000000000000 2
-- !query 52
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out
index c4d8affe75267..7a8e706cb8d85 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out
@@ -836,13 +836,13 @@ FROM (VALUES cast(-2.5 as decimal(38, 18)),
-- !query 83 schema
struct
-- !query 83 output
--0.5 0
--1.5 -1
--2.5 -2
-0 0
-0.5 0
-1.5 1
-2.5 2
+-0.500000000000000000 0
+-1.500000000000000000 -1
+-2.500000000000000000 -2
+0.000000000000000000 0
+0.500000000000000000 0
+1.500000000000000000 1
+2.500000000000000000 2
-- !query 84
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out
index 5ffa29a93d5de..e245af28508c1 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out
@@ -3691,16 +3691,16 @@ SELECT * FROM num_data
-- !query 460 schema
struct
-- !query 460 output
-0 0
-1 0
-2 -34338492.215397047
-3 4.31
-4 7799461.4119
-5 16397.038491
-6 93901.57763026
-7 -83028485
-8 74881
-9 -24926804.04504742
+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 461
@@ -3869,51 +3869,51 @@ SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 30) as expected
-- !query 478 schema
struct
-- !query 478 output
-2 2 1179132047626883.596862 1179132047626883.5968621359
-2 3 -147998901.448361 -147998901.4483612726
-2 4 -267821744976817.811114 -267821744976817.8111137107
-2 5 -563049578578.769243 -563049578578.7692425067
-2 6 -3224438592470.184498 -3224438592470.1844981193
-2 7 2851072985828710.485884 2851072985828710.485883795
-2 8 -2571300635581.146276 -2571300635581.146276407
-2 9 855948866655588.453742 855948866655588.4537415092
-3 2 -147998901.448361 -147998901.4483612726
-3 5 70671.235896 70671.23589621
-3 6 404715.799586 404715.7995864206
-3 9 -107434525.434154 -107434525.4341543802
-4 2 -267821744976817.811114 -267821744976817.8111137107
-4 4 60831598315717.141462 60831598315717.14146161
-4 5 127888068979.993505 127888068979.9935054429
-4 6 732381731243.745116 732381731243.7451157641
-4 9 -194415646271340.181596 -194415646271340.1815956523
-5 2 -563049578578.769243 -563049578578.7692425067
-5 3 70671.235896 70671.23589621
-5 4 127888068979.993505 127888068979.9935054429
-5 5 268862871.275336 268862871.2753355571
-5 6 1539707782.768998 1539707782.7689977863
-5 9 -408725765384.257044 -408725765384.2570436602
-6 2 -3224438592470.184498 -3224438592470.1844981193
-6 3 404715.799586 404715.7995864206
-6 4 732381731243.745116 732381731243.7451157641
-6 5 1539707782.768998 1539707782.7689977863
-6 6 8817506281.451745 8817506281.4517452373
-6 7 -7796505729750.377956 -7796505729750.3779561
-6 8 7031444034.531499 7031444034.53149906
-6 9 -2340666225110.299295 -2340666225110.2992952129
-7 2 2851072985828710.485884 2851072985828710.485883795
-7 6 -7796505729750.377956 -7796505729750.3779561
-7 9 2069634775752159.035759 2069634775752159.0357587
-8 2 -2571300635581.146276 -2571300635581.146276407
-8 6 7031444034.531499 7031444034.53149906
-8 9 -1866544013697.195857 -1866544013697.19585702
-9 2 855948866655588.453742 855948866655588.4537415092
-9 3 -107434525.434154 -107434525.4341543802
-9 4 -194415646271340.181596 -194415646271340.1815956523
-9 5 -408725765384.257044 -408725765384.2570436602
-9 6 -2340666225110.299295 -2340666225110.2992952129
-9 7 2069634775752159.035759 2069634775752159.0357587
-9 8 -1866544013697.195857 -1866544013697.19585702
-9 9 621345559900192.420121 621345559900192.42012063
+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 479
@@ -3942,62 +3942,62 @@ SELECT t1.id1, t1.id2, t1.result, t2.expected
-- !query 481 schema
struct
-- !query 481 output
-2 3 -7967167.567378 -7967167.5673775051
-2 4 -4.402675 -4.4026748005
-2 5 -2094.188669 -2094.1886691456
-2 6 -365.685999 -365.6859989148
-2 7 0.413575 0.4135748378
-2 8 -458.574167 -458.5741672173
-2 9 1.377573 1.3775729995
-3 2 0 -0.0000001255
-3 4 0.000001 0.0000005526
-3 5 0.000263 0.0002628523
-3 6 0.000046 0.0000458991
-3 7 0 -0.0000000519
-3 8 0.000058 0.000057558
-3 9 0 -0.0000001729
-4 2 -0.227135 -0.22713465
-4 3 1809619.817146 1809619.8171461717
-4 5 475.66281 475.6628104631
-4 6 83.059961 83.0599613844
-4 7 -0.093937 -0.093937176
-4 8 104.158083 104.1580829837
-4 9 -0.312895 -0.3128945611
-5 2 -0.000478 -0.0004775119
-5 3 3804.417283 3804.4172832947
-5 4 0.002102 0.0021023296
-5 6 0.174619 0.1746194143
-5 7 -0.000197 -0.0001974869
-5 8 0.218975 0.2189746196
-5 9 -0.000658 -0.0006578075
-6 2 -0.002735 -0.0027345865
-6 3 21786.908963 21786.9089629374
-6 4 0.012039 0.0120394951
-6 5 5.72674 5.7267400867
-6 7 -0.001131 -0.0011309562
-6 8 1.254011 1.2540107321
-6 9 -0.003767 -0.0037670925
-7 2 2.417942 2.4179420715
-7 3 -19264149.651972 -19264149.6519721578
-7 4 -10.645413 -10.6454126273
-7 5 -5063.626889 -5063.6268888173
-7 6 -884.207562 -884.2075617401
-7 8 -1108.805772 -1108.8057718246
-7 9 3.330892 3.330891712
-8 2 -0.002181 -0.0021806723
-8 3 17373.781903 17373.7819025522
-8 4 0.009601 0.0096007911
-8 5 4.566739 4.5667392951
-8 6 0.797441 0.7974413411
-8 7 -0.000902 -0.0009018712
-8 9 -0.003004 -0.0030040353
-9 2 0.725914 0.7259143438
-9 3 -5783481.216948 -5783481.2169483573
-9 4 -3.195965 -3.1959647889
-9 5 -1520.201594 -1520.2015936432
-9 6 -265.456712 -265.4567119543
-9 7 0.30022 0.300219907
-9 8 -332.885566 -332.8855656982
+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 482
@@ -4026,62 +4026,62 @@ SELECT t1.id1, t1.id2, t1.result, round(t2.expected, 80) as expected
-- !query 484 schema
struct
-- !query 484 output
-2 3 -7967167.567378 -7967167.5673775051
-2 4 -4.402675 -4.4026748005
-2 5 -2094.188669 -2094.1886691456
-2 6 -365.685999 -365.6859989148
-2 7 0.413575 0.4135748378
-2 8 -458.574167 -458.5741672173
-2 9 1.377573 1.3775729995
-3 2 0 -0.0000001255
-3 4 0.000001 0.0000005526
-3 5 0.000263 0.0002628523
-3 6 0.000046 0.0000458991
-3 7 0 -0.0000000519
-3 8 0.000058 0.000057558
-3 9 0 -0.0000001729
-4 2 -0.227135 -0.22713465
-4 3 1809619.817146 1809619.8171461717
-4 5 475.66281 475.6628104631
-4 6 83.059961 83.0599613844
-4 7 -0.093937 -0.093937176
-4 8 104.158083 104.1580829837
-4 9 -0.312895 -0.3128945611
-5 2 -0.000478 -0.0004775119
-5 3 3804.417283 3804.4172832947
-5 4 0.002102 0.0021023296
-5 6 0.174619 0.1746194143
-5 7 -0.000197 -0.0001974869
-5 8 0.218975 0.2189746196
-5 9 -0.000658 -0.0006578075
-6 2 -0.002735 -0.0027345865
-6 3 21786.908963 21786.9089629374
-6 4 0.012039 0.0120394951
-6 5 5.72674 5.7267400867
-6 7 -0.001131 -0.0011309562
-6 8 1.254011 1.2540107321
-6 9 -0.003767 -0.0037670925
-7 2 2.417942 2.4179420715
-7 3 -19264149.651972 -19264149.6519721578
-7 4 -10.645413 -10.6454126273
-7 5 -5063.626889 -5063.6268888173
-7 6 -884.207562 -884.2075617401
-7 8 -1108.805772 -1108.8057718246
-7 9 3.330892 3.330891712
-8 2 -0.002181 -0.0021806723
-8 3 17373.781903 17373.7819025522
-8 4 0.009601 0.0096007911
-8 5 4.566739 4.5667392951
-8 6 0.797441 0.7974413411
-8 7 -0.000902 -0.0009018712
-8 9 -0.003004 -0.0030040353
-9 2 0.725914 0.7259143438
-9 3 -5783481.216948 -5783481.2169483573
-9 4 -3.195965 -3.1959647889
-9 5 -1520.201594 -1520.2015936432
-9 6 -265.456712 -265.4567119543
-9 7 0.30022 0.300219907
-9 8 -332.885566 -332.8855656982
+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 485
@@ -4196,12 +4196,12 @@ SELECT t1.id1, t1.result, t2.expected
-- !query 496 schema
struct
-- !query 496 output
-2 224790267919917440 224790267919917955.1326161858
-4 7405685069595001 7405685069594999.0773399947
-5 5068226527.321263 5068226527.3212726541
-6 281839893606.99365 281839893606.9937234336
-8 167361463828.0749 167361463828.0749132007
-9 107511333880051872 107511333880052007.0414112467
+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 107511333880051872.0000000000 107511333880052007.0414112467
-- !query 497
@@ -4209,7 +4209,7 @@ SELECT AVG(val) FROM num_data
-- !query 497 schema
struct
-- !query 497 output
--13430913.5922423207
+-13430913.59224232070000
-- !query 498
@@ -4273,11 +4273,11 @@ SELECT * FROM fract_only
-- !query 505 schema
struct
-- !query 505 output
-1 0
-2 0.1
+1 0.0000
+2 0.1000
4 -0.9999
5 0.9999
-7 0
+7 0.0000
8 0.0002
@@ -4406,13 +4406,13 @@ SELECT a, ceil(a), ceiling(a), floor(a), round(a) FROM ceil_floor_round
-- !query 521 schema
struct
-- !query 521 output
--0.000001 0 0 -1 0
--5.499999 -5 -5 -6 -5
--5.5 -5 -5 -6 -6
-0 0 0 0 0
-0.0000001 1 1 0 0
-9.4999999 10 10 9 9
-9.5 10 10 9 10
+-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 522
@@ -4476,11 +4476,11 @@ SELECT * FROM num_input_test
-- !query 529 schema
struct
-- !query 529 output
--555.5
--93853
-123
-3245874
-555.5
+-555.500000000000000000
+-93853.000000000000000000
+123.000000000000000000
+3245874.000000000000000000
+555.500000000000000000
-- !query 530
@@ -4488,7 +4488,7 @@ select cast(999999999999999999999 as decimal(38, 0))/1000000000000000000000
-- !query 530 schema
struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) / CAST(1000000000000000000000 AS DECIMAL(38,0))):decimal(38,6)>
-- !query 530 output
-1
+1.000000
-- !query 531
@@ -4536,7 +4536,7 @@ select mod (70.0,70)
-- !query 536 schema
struct<(CAST(70.0 AS DECIMAL(3,1)) % CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3,1))):decimal(3,1)>
-- !query 536 output
-0
+0.0
-- !query 537
@@ -4552,7 +4552,7 @@ select 70.0 / 70
-- !query 538 schema
struct<(CAST(70.0 AS DECIMAL(3,1)) / CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3,1))):decimal(8,6)>
-- !query 538 output
-1
+1.000000
-- !query 539
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/select.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/select.sql.out
index e54de1d6fdbdc..a106e33c2a595 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/select.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/select.sql.out
@@ -336,8 +336,8 @@ VALUES (1,2), (3,4+4), (7,77.7)
-- !query 17 schema
struct
-- !query 17 output
-1 2
-3 8
+1 2.0
+3 8.0
7 77.7
@@ -350,14 +350,14 @@ TABLE int8_tbl
-- !query 18 schema
struct
-- !query 18 output
-1 2
-123 456
-123 4567890123456789
-3 8
-4 57
-4567890123456789 -4567890123456789
-4567890123456789 123
-4567890123456789 4567890123456789
+1 2.0
+123 456.0
+123 4567890123456789.0
+3 8.0
+4 57.0
+4567890123456789 -4567890123456789.0
+4567890123456789 123.0
+4567890123456789 4567890123456789.0
7 77.7
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out
index 6cb3690a464e1..460b6d1fdd02f 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out
@@ -258,11 +258,11 @@ SELECT '' AS `54`, d1 as `timestamp`,
-- !query 27 schema
struct<54:string,timestamp:timestamp,year:int,month:int,day:int,hour:int,minute:int,second:decimal(8,6)>
-- !query 27 output
- 1969-12-31 16:00:00 1969 12 31 16 0 0
- 1997-01-02 00:00:00 1997 1 2 0 0 0
- 1997-01-02 03:04:05 1997 1 2 3 4 5
- 1997-02-10 17:32:01 1997 2 10 17 32 1
- 2001-09-22 18:19:20 2001 9 22 18 19 20
+ 1969-12-31 16:00:00 1969 12 31 16 0 0.000000
+ 1997-01-02 00:00:00 1997 1 2 0 0 0.000000
+ 1997-01-02 03:04:05 1997 1 2 3 4 5.000000
+ 1997-02-10 17:32:01 1997 2 10 17 32 1.000000
+ 2001-09-22 18:19:20 2001 9 22 18 19 20.000000
-- !query 28
@@ -273,11 +273,11 @@ SELECT '' AS `54`, d1 as `timestamp`,
-- !query 28 schema
struct<54:string,timestamp:timestamp,quarter:int,msec:decimal(8,3),usec:int>
-- !query 28 output
- 1969-12-31 16:00:00 4 0 0
- 1997-01-02 00:00:00 1 0 0
- 1997-01-02 03:04:05 1 5000 5000000
- 1997-02-10 17:32:01 1 1000 1000000
- 2001-09-22 18:19:20 3 20000 20000000
+ 1969-12-31 16:00:00 4 0.000 0
+ 1997-01-02 00:00:00 1 0.000 0
+ 1997-01-02 03:04:05 1 5000.000 5000000
+ 1997-02-10 17:32:01 1 1000.000 1000000
+ 2001-09-22 18:19:20 3 20000.000 20000000
-- !query 29
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out
index 05dedc547086e..703463e6d6b5a 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out
@@ -117,7 +117,7 @@ SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1
struct
-- !query 11 output
1.1
-2
+2.0
-- !query 12
@@ -125,7 +125,7 @@ SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1
-- !query 12 schema
struct
-- !query 12 output
-1
+1.0
2.2
@@ -143,7 +143,7 @@ SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1
struct
-- !query 14 output
1.1
-2
+2.0
-- !query 15
@@ -161,8 +161,8 @@ SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1
struct
-- !query 16 output
1.1
-2
-3
+2.0
+3.0
-- !query 17
@@ -180,8 +180,8 @@ SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1
struct
-- !query 18 output
1.1
-2
-2
+2.0
+2.0
-- !query 19
@@ -190,7 +190,7 @@ SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1
struct
-- !query 19 output
1.1
-2
+2.0
-- !query 20
diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out
index f4ada1e18a90a..54ceacd3b3b3e 100644
--- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out
@@ -44,8 +44,8 @@ SELECT i,AVG(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWIN
-- !query 3 schema
struct
-- !query 3 output
-1 2
-2 2.5
+1 2.00000
+2 2.50000
3 NULL
4 NULL
@@ -104,8 +104,8 @@ SELECT SUM(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
-- !query 8 schema
struct
-- !query 8 output
-3
-5
+3.00
+5.00
6.01
diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out
index f02f760727976..3045cff1de19b 100644
--- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out
@@ -23,7 +23,7 @@ WHERE b = 1.0 -- Matches (null, 1.0)
-- !query 1 schema
struct
-- !query 1 output
-NULL 1
+NULL 1.0
-- !query 2
@@ -45,4 +45,4 @@ WHERE b = 5.0 -- Matches (4, 5.0)
-- !query 3 schema
struct
-- !query 3 output
-4 5
+4 5.0
diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out
index a27a66e3f27f5..5ccea3846cd36 100644
--- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out
@@ -37,9 +37,9 @@ WHERE (a, b) NOT IN (SELECT *
-- !query 2 schema
struct
-- !query 2 output
-2 3
-4 5
-NULL 1
+2 3.0
+4 5.0
+NULL 1.0
NULL NULL
@@ -91,7 +91,7 @@ WHERE b = 1.0 -- Matches (null, 1.0)
-- !query 6 schema
struct
-- !query 6 output
-NULL 1
+NULL 1.0
-- !query 7
@@ -117,4 +117,4 @@ WHERE b = 5.0 -- Matches (4, 5.0)
-- !query 8 schema
struct
-- !query 8 output
-4 5
+4 5.0
diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out
index cf8f03eaa9311..9190e9c1e7a4b 100644
--- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out
@@ -54,4 +54,4 @@ WHERE b = 3.0 -- Only matches (2, 3.0)
-- !query 4 schema
struct
-- !query 4 output
-2 3
+2 3.0
diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out
index d07981cfd11e5..d7473e1ada151 100644
--- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out
@@ -35,9 +35,9 @@ WHERE a NOT IN (SELECT c
-- !query 2 schema
struct
-- !query 2 output
-2 3
-4 5
-NULL 1
+2 3.0
+4 5.0
+NULL 1.0
-- !query 3
@@ -88,7 +88,7 @@ WHERE b = 3.0 -- Only matches (2, 3.0)
-- !query 6 schema
struct
-- !query 6 output
-2 3
+2 3.0
-- !query 7
@@ -100,9 +100,9 @@ WHERE a NOT IN (SELECT c
-- !query 7 schema
struct
-- !query 7 output
-2 3
-4 5
-NULL 1
+2 3.0
+4 5.0
+NULL 1.0
-- !query 8
@@ -115,7 +115,7 @@ WHERE b = 1.0 -- Only matches (null, 1.0)
-- !query 8 schema
struct
-- !query 8 output
-NULL 1
+NULL 1.0
-- !query 9
@@ -128,4 +128,4 @@ WHERE b = 3.0 -- Only matches (2, 3.0)
-- !query 9 schema
struct
-- !query 9 output
-2 3
+2 3.0
diff --git a/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out b/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out
index 1a2bd5ea91cde..653dc1ca357f8 100644
--- a/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out
@@ -93,5 +93,5 @@ SELECT * FROM (src1 s1 INNER JOIN src2 s2 ON s1.id = s2.id) dst(a, b, c, d)
struct
-- !query 10 output
1 a 1 8.5
-2 b 2 1
+2 b 2 1.0
3 c 3 3.2
diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out
index 6ee7f59d69877..e479a6d73a182 100644
--- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out
@@ -2211,7 +2211,7 @@ SELECT cast(1 as tinyint) / cast(1 as decimal(3, 0)) FROM t
-- !query 265 schema
struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) / CAST(1 AS DECIMAL(3,0))):decimal(9,6)>
-- !query 265 output
-1
+1.000000
-- !query 266
@@ -2219,7 +2219,7 @@ SELECT cast(1 as tinyint) / cast(1 as decimal(5, 0)) FROM t
-- !query 266 schema
struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(9,6)>
-- !query 266 output
-1
+1.000000
-- !query 267
@@ -2227,7 +2227,7 @@ SELECT cast(1 as tinyint) / cast(1 as decimal(10, 0)) FROM t
-- !query 267 schema
struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)>
-- !query 267 output
-1
+1.00000000000
-- !query 268
@@ -2235,7 +2235,7 @@ SELECT cast(1 as tinyint) / cast(1 as decimal(20, 0)) FROM t
-- !query 268 schema
struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(24,21)>
-- !query 268 output
-1
+1.000000000000000000000
-- !query 269
@@ -2243,7 +2243,7 @@ SELECT cast(1 as smallint) / cast(1 as decimal(3, 0)) FROM t
-- !query 269 schema
struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(11,6)>
-- !query 269 output
-1
+1.000000
-- !query 270
@@ -2251,7 +2251,7 @@ SELECT cast(1 as smallint) / cast(1 as decimal(5, 0)) FROM t
-- !query 270 schema
struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) / CAST(1 AS DECIMAL(5,0))):decimal(11,6)>
-- !query 270 output
-1
+1.000000
-- !query 271
@@ -2259,7 +2259,7 @@ SELECT cast(1 as smallint) / cast(1 as decimal(10, 0)) FROM t
-- !query 271 schema
struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)>
-- !query 271 output
-1
+1.00000000000
-- !query 272
@@ -2267,7 +2267,7 @@ SELECT cast(1 as smallint) / cast(1 as decimal(20, 0)) FROM t
-- !query 272 schema
struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(26,21)>
-- !query 272 output
-1
+1.000000000000000000000
-- !query 273
@@ -2275,7 +2275,7 @@ SELECT cast(1 as int) / cast(1 as decimal(3, 0)) FROM t
-- !query 273 schema
struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 273 output
-1
+1.000000
-- !query 274
@@ -2283,7 +2283,7 @@ SELECT cast(1 as int) / cast(1 as decimal(5, 0)) FROM t
-- !query 274 schema
struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 274 output
-1
+1.000000
-- !query 275
@@ -2291,7 +2291,7 @@ SELECT cast(1 as int) / cast(1 as decimal(10, 0)) FROM t
-- !query 275 schema
struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)>
-- !query 275 output
-1
+1.00000000000
-- !query 276
@@ -2299,7 +2299,7 @@ SELECT cast(1 as int) / cast(1 as decimal(20, 0)) FROM t
-- !query 276 schema
struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)>
-- !query 276 output
-1
+1.000000000000000000000
-- !query 277
@@ -2307,7 +2307,7 @@ SELECT cast(1 as bigint) / cast(1 as decimal(3, 0)) FROM t
-- !query 277 schema
struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(26,6)>
-- !query 277 output
-1
+1.000000
-- !query 278
@@ -2315,7 +2315,7 @@ SELECT cast(1 as bigint) / cast(1 as decimal(5, 0)) FROM t
-- !query 278 schema
struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(26,6)>
-- !query 278 output
-1
+1.000000
-- !query 279
@@ -2323,7 +2323,7 @@ SELECT cast(1 as bigint) / cast(1 as decimal(10, 0)) FROM t
-- !query 279 schema
struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)>
-- !query 279 output
-1
+1.00000000000
-- !query 280
@@ -2331,7 +2331,7 @@ SELECT cast(1 as bigint) / cast(1 as decimal(20, 0)) FROM t
-- !query 280 schema
struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) / CAST(1 AS DECIMAL(20,0))):decimal(38,18)>
-- !query 280 output
-1
+1.000000000000000000
-- !query 281
@@ -2403,7 +2403,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(3, 0)) FROM t
-- !query 289 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 289 output
-1
+1.000000
-- !query 290
@@ -2411,7 +2411,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(5, 0)) FROM t
-- !query 290 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 290 output
-1
+1.000000
-- !query 291
@@ -2419,7 +2419,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(10, 0)) FROM t
-- !query 291 schema
struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)>
-- !query 291 output
-1
+1.00000000000
-- !query 292
@@ -2427,7 +2427,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(20, 0)) FROM t
-- !query 292 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)>
-- !query 292 output
-1
+1.000000000000000000000
-- !query 293
@@ -2543,7 +2543,7 @@ SELECT cast(1 as decimal(3, 0)) / cast(1 as tinyint) FROM t
-- !query 305 schema
struct<(CAST(1 AS DECIMAL(3,0)) / CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):decimal(9,6)>
-- !query 305 output
-1
+1.000000
-- !query 306
@@ -2551,7 +2551,7 @@ SELECT cast(1 as decimal(5, 0)) / cast(1 as tinyint) FROM t
-- !query 306 schema
struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(11,6)>
-- !query 306 output
-1
+1.000000
-- !query 307
@@ -2559,7 +2559,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as tinyint) FROM t
-- !query 307 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 307 output
-1
+1.000000
-- !query 308
@@ -2567,7 +2567,7 @@ SELECT cast(1 as decimal(20, 0)) / cast(1 as tinyint) FROM t
-- !query 308 schema
struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(26,6)>
-- !query 308 output
-1
+1.000000
-- !query 309
@@ -2575,7 +2575,7 @@ SELECT cast(1 as decimal(3, 0)) / cast(1 as smallint) FROM t
-- !query 309 schema
struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(9,6)>
-- !query 309 output
-1
+1.000000
-- !query 310
@@ -2583,7 +2583,7 @@ SELECT cast(1 as decimal(5, 0)) / cast(1 as smallint) FROM t
-- !query 310 schema
struct<(CAST(1 AS DECIMAL(5,0)) / CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):decimal(11,6)>
-- !query 310 output
-1
+1.000000
-- !query 311
@@ -2591,7 +2591,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as smallint) FROM t
-- !query 311 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 311 output
-1
+1.000000
-- !query 312
@@ -2599,7 +2599,7 @@ SELECT cast(1 as decimal(20, 0)) / cast(1 as smallint) FROM t
-- !query 312 schema
struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(26,6)>
-- !query 312 output
-1
+1.000000
-- !query 313
@@ -2607,7 +2607,7 @@ SELECT cast(1 as decimal(3, 0)) / cast(1 as int) FROM t
-- !query 313 schema
struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)>
-- !query 313 output
-1
+1.00000000000
-- !query 314
@@ -2615,7 +2615,7 @@ SELECT cast(1 as decimal(5, 0)) / cast(1 as int) FROM t
-- !query 314 schema
struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)>
-- !query 314 output
-1
+1.00000000000
-- !query 315
@@ -2623,7 +2623,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as int) FROM t
-- !query 315 schema
struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(21,11)>
-- !query 315 output
-1
+1.00000000000
-- !query 316
@@ -2631,7 +2631,7 @@ SELECT cast(1 as decimal(20, 0)) / cast(1 as int) FROM t
-- !query 316 schema
struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)>
-- !query 316 output
-1
+1.00000000000
-- !query 317
@@ -2639,7 +2639,7 @@ SELECT cast(1 as decimal(3, 0)) / cast(1 as bigint) FROM t
-- !query 317 schema
struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(24,21)>
-- !query 317 output
-1
+1.000000000000000000000
-- !query 318
@@ -2647,7 +2647,7 @@ SELECT cast(1 as decimal(5, 0)) / cast(1 as bigint) FROM t
-- !query 318 schema
struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(26,21)>
-- !query 318 output
-1
+1.000000000000000000000
-- !query 319
@@ -2655,7 +2655,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as bigint) FROM t
-- !query 319 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)>
-- !query 319 output
-1
+1.000000000000000000000
-- !query 320
@@ -2663,7 +2663,7 @@ SELECT cast(1 as decimal(20, 0)) / cast(1 as bigint) FROM t
-- !query 320 schema
struct<(CAST(1 AS DECIMAL(20,0)) / CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):decimal(38,18)>
-- !query 320 output
-1
+1.000000000000000000
-- !query 321
@@ -2735,7 +2735,7 @@ SELECT cast(1 as decimal(3, 0)) / cast(1 as decimal(10, 0)) FROM t
-- !query 329 schema
struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)>
-- !query 329 output
-1
+1.00000000000
-- !query 330
@@ -2743,7 +2743,7 @@ SELECT cast(1 as decimal(5, 0)) / cast(1 as decimal(10, 0)) FROM t
-- !query 330 schema
struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)>
-- !query 330 output
-1
+1.00000000000
-- !query 331
@@ -2751,7 +2751,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(10, 0)) FROM t
-- !query 331 schema
struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)>
-- !query 331 output
-1
+1.00000000000
-- !query 332
@@ -2759,7 +2759,7 @@ SELECT cast(1 as decimal(20, 0)) / cast(1 as decimal(10, 0)) FROM t
-- !query 332 schema
struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)>
-- !query 332 output
-1
+1.00000000000
-- !query 333
diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out
index 017e0fea30e90..97cdf01763a70 100644
--- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out
@@ -63,7 +63,7 @@ SELECT cast(1 as tinyint) / cast(1 as decimal(10, 0)) FROM t
-- !query 7 schema
struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)>
-- !query 7 output
-1
+1.00000000000
-- !query 8
@@ -163,7 +163,7 @@ SELECT cast(1 as smallint) / cast(1 as decimal(10, 0)) FROM t
-- !query 19 schema
struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)>
-- !query 19 output
-1
+1.00000000000
-- !query 20
@@ -263,7 +263,7 @@ SELECT cast(1 as int) / cast(1 as decimal(10, 0)) FROM t
-- !query 31 schema
struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)>
-- !query 31 output
-1
+1.00000000000
-- !query 32
@@ -363,7 +363,7 @@ SELECT cast(1 as bigint) / cast(1 as decimal(10, 0)) FROM t
-- !query 43 schema
struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)>
-- !query 43 output
-1
+1.00000000000
-- !query 44
@@ -615,7 +615,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as tinyint) FROM t
-- !query 73 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 73 output
-1
+1.000000
-- !query 74
@@ -623,7 +623,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as smallint) FROM t
-- !query 74 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)>
-- !query 74 output
-1
+1.000000
-- !query 75
@@ -631,7 +631,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as int) FROM t
-- !query 75 schema
struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(21,11)>
-- !query 75 output
-1
+1.00000000000
-- !query 76
@@ -639,7 +639,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as bigint) FROM t
-- !query 76 schema
struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)>
-- !query 76 output
-1
+1.000000000000000000000
-- !query 77
@@ -663,7 +663,7 @@ SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(10, 0)) FROM t
-- !query 79 schema
struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)>
-- !query 79 output
-1
+1.00000000000
-- !query 80
diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-union.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-union.sql.out
index 84b5e10dbeb8e..835abe3d32775 100644
--- a/sql/core/src/test/resources/sql-tests/results/udf/udf-union.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-union.sql.out
@@ -42,12 +42,12 @@ FROM (SELECT udf(c1) as c1, udf(c2) as c2 FROM t1
-- !query 3 schema
struct
-- !query 3 output
-1 1
-1 1
-1 a
-2 4
-2 4
-2 b
+1.0 1
+1.0 1
+1.0 a
+2.0 4
+2.0 4
+2.0 b
-- !query 4
diff --git a/sql/core/src/test/resources/sql-tests/results/union.sql.out b/sql/core/src/test/resources/sql-tests/results/union.sql.out
index b023df825d814..95a10f0b0a8c9 100644
--- a/sql/core/src/test/resources/sql-tests/results/union.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/union.sql.out
@@ -42,12 +42,12 @@ FROM (SELECT * FROM t1
-- !query 3 schema
struct
-- !query 3 output
-1 1
-1 1
-1 a
-2 4
-2 4
-2 b
+1.0 1
+1.0 1
+1.0 a
+2.0 4
+2.0 4
+2.0 b
-- !query 4
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
index 104cf4c58d617..4d1bb470e4e2e 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
@@ -43,4 +43,19 @@ class HiveResultSuite extends SharedSparkSession {
val tpe = new ExamplePointUDT()
assert(HiveResult.toHiveString((point, tpe)) === "(50.0, 50.0)")
}
+
+ test("decimal formatting in hive result") {
+ val df = Seq(new java.math.BigDecimal("1")).toDS()
+ Seq(2, 6, 18).foreach { scala =>
+ val executedPlan =
+ df.selectExpr(s"CAST(value AS decimal(38, $scala))").queryExecution.executedPlan
+ val result = HiveResult.hiveResultString(executedPlan)
+ assert(result.head.split("\\.").last.length === scala)
+ }
+
+ val executedPlan = Seq(java.math.BigDecimal.ZERO).toDS()
+ .selectExpr(s"CAST(value AS decimal(38, 8))").queryExecution.executedPlan
+ val result = HiveResult.hiveResultString(executedPlan)
+ assert(result.head === "0.00000000")
+ }
}
diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
index 04e7f579ff712..856102bc900a8 100644
--- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
+++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
@@ -393,4 +393,11 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging {
"select concat('Test4', ';');" -> "Test4;"
)
}
+
+ test("Pad Decimal numbers with trailing zeros to the scale of the column") {
+ runCliWithin(1.minute)(
+ "SELECT CAST(1 AS DECIMAL(38, 18));"
+ -> "1.000000000000000000"
+ )
+ }
}
diff --git a/sql/hive/src/test/resources/golden/decimal_4-6-693c2e345731f9b2b547c3b75218458e b/sql/hive/src/test/resources/golden/decimal_4-6-693c2e345731f9b2b547c3b75218458e
index f59549a6e4a46..a298a84cb2c5a 100644
--- a/sql/hive/src/test/resources/golden/decimal_4-6-693c2e345731f9b2b547c3b75218458e
+++ b/sql/hive/src/test/resources/golden/decimal_4-6-693c2e345731f9b2b547c3b75218458e
@@ -1,38 +1,38 @@
NULL 0
--1234567890.123456789 -1234567890
--4400 4400
--1255.49 -1255
--1.122 -11
--1.12 -1
--1.12 -1
--0.333 0
--0.33 0
--0.3 0
-0 0
-0 0
-0 0
-0.01 0
-0.02 0
-0.1 0
-0.2 0
-0.3 0
-0.33 0
-0.333 0
+-1234567890.1234567890000000000000000 -1234567890
+-4400.0000000000000000000000000 4400
+-1255.4900000000000000000000000 -1255
+-1.1220000000000000000000000 -11
+-1.1200000000000000000000000 -1
+-1.1200000000000000000000000 -1
+-0.3330000000000000000000000 0
+-0.3300000000000000000000000 0
+-0.3000000000000000000000000 0
+0.0000000000000000000000000 0
+0.0000000000000000000000000 0
+0.0000000000000000000000000 0
+0.0100000000000000000000000 0
+0.0200000000000000000000000 0
+0.1000000000000000000000000 0
+0.2000000000000000000000000 0
+0.3000000000000000000000000 0
+0.3300000000000000000000000 0
+0.3330000000000000000000000 0
0.9999999999999999999999999 1
-1 1
-1 1
-1.12 1
-1.122 1
-2 2
-2 2
-3.14 3
-3.14 3
-3.14 3
-3.14 4
-10 10
-20 20
-100 100
-124 124
-125.2 125
-200 200
-1234567890.12345678 1234567890
+1.0000000000000000000000000 1
+1.0000000000000000000000000 1
+1.1200000000000000000000000 1
+1.1220000000000000000000000 1
+2.0000000000000000000000000 2
+2.0000000000000000000000000 2
+3.1400000000000000000000000 3
+3.1400000000000000000000000 3
+3.1400000000000000000000000 3
+3.1400000000000000000000000 4
+10.0000000000000000000000000 10
+20.0000000000000000000000000 20
+100.0000000000000000000000000 100
+124.0000000000000000000000000 124
+125.2000000000000000000000000 125
+200.0000000000000000000000000 200
+1234567890.1234567800000000000000000 1234567890
diff --git a/sql/hive/src/test/resources/golden/decimal_4-7-f1eb45492510cb76cf6b452121af8531 b/sql/hive/src/test/resources/golden/decimal_4-7-f1eb45492510cb76cf6b452121af8531
index 6bada475c6d3d..60df68a2e3ab5 100644
--- a/sql/hive/src/test/resources/golden/decimal_4-7-f1eb45492510cb76cf6b452121af8531
+++ b/sql/hive/src/test/resources/golden/decimal_4-7-f1eb45492510cb76cf6b452121af8531
@@ -1,38 +1,38 @@
NULL NULL
--1234567890.123456789 -3703703670.370370367
--4400 -13200
--1255.49 -3766.47
--1.122 -3.366
--1.12 -3.36
--1.12 -3.36
--0.333 -0.999
--0.33 -0.99
--0.3 -0.9
-0 0
-0 0
-0 0
-0.01 0.03
-0.02 0.06
-0.1 0.3
-0.2 0.6
-0.3 0.9
-0.33 0.99
-0.333 0.999
+-1234567890.1234567890000000000000000 -3703703670.3703703670000000000000000
+-4400.0000000000000000000000000 -13200.0000000000000000000000000
+-1255.4900000000000000000000000 -3766.4700000000000000000000000
+-1.1220000000000000000000000 -3.3660000000000000000000000
+-1.1200000000000000000000000 -3.3600000000000000000000000
+-1.1200000000000000000000000 -3.3600000000000000000000000
+-0.3330000000000000000000000 -0.9990000000000000000000000
+-0.3300000000000000000000000 -0.9900000000000000000000000
+-0.3000000000000000000000000 -0.9000000000000000000000000
+0.0000000000000000000000000 0.0000000000000000000000000
+0.0000000000000000000000000 0.0000000000000000000000000
+0.0000000000000000000000000 0.0000000000000000000000000
+0.0100000000000000000000000 0.0300000000000000000000000
+0.0200000000000000000000000 0.0600000000000000000000000
+0.1000000000000000000000000 0.3000000000000000000000000
+0.2000000000000000000000000 0.6000000000000000000000000
+0.3000000000000000000000000 0.9000000000000000000000000
+0.3300000000000000000000000 0.9900000000000000000000000
+0.3330000000000000000000000 0.9990000000000000000000000
0.9999999999999999999999999 2.9999999999999999999999997
-1 3
-1 3
-1.12 3.36
-1.122 3.366
-2 6
-2 6
-3.14 9.42
-3.14 9.42
-3.14 9.42
-3.14 9.42
-10 30
-20 60
-100 300
-124 372
-125.2 375.6
-200 600
-1234567890.12345678 3703703670.37037034
+1.0000000000000000000000000 3.0000000000000000000000000
+1.0000000000000000000000000 3.0000000000000000000000000
+1.1200000000000000000000000 3.3600000000000000000000000
+1.1220000000000000000000000 3.3660000000000000000000000
+2.0000000000000000000000000 6.0000000000000000000000000
+2.0000000000000000000000000 6.0000000000000000000000000
+3.1400000000000000000000000 9.4200000000000000000000000
+3.1400000000000000000000000 9.4200000000000000000000000
+3.1400000000000000000000000 9.4200000000000000000000000
+3.1400000000000000000000000 9.4200000000000000000000000
+10.0000000000000000000000000 30.0000000000000000000000000
+20.0000000000000000000000000 60.0000000000000000000000000
+100.0000000000000000000000000 300.0000000000000000000000000
+124.0000000000000000000000000 372.0000000000000000000000000
+125.2000000000000000000000000 375.6000000000000000000000000
+200.0000000000000000000000000 600.0000000000000000000000000
+1234567890.1234567800000000000000000 3703703670.3703703400000000000000000
diff --git a/sql/hive/src/test/resources/golden/serde_regex-10-c5b3ec90419a40660e5f83736241c429 b/sql/hive/src/test/resources/golden/serde_regex-10-c5b3ec90419a40660e5f83736241c429
index 93cdc5c85645c..a26c8b7d12886 100644
--- a/sql/hive/src/test/resources/golden/serde_regex-10-c5b3ec90419a40660e5f83736241c429
+++ b/sql/hive/src/test/resources/golden/serde_regex-10-c5b3ec90419a40660e5f83736241c429
@@ -1,38 +1,38 @@
NULL 0
--1234567890.123456789 -1234567890
--4400 4400
--1255.49 -1255
--1.122 -11
--1.12 -1
--1.12 -1
--0.333 0
--0.33 0
--0.3 0
-0 0
-0 0
-0 0
-0.01 0
-0.02 0
-0.1 0
-0.2 0
-0.3 0
-0.33 0
-0.333 0
-1 1
-1 1
-1 1
-1.12 1
-1.122 1
-2 2
-2 2
-3.14 3
-3.14 3
-3.14 3
-3.14 4
-10 10
-20 20
-100 100
-124 124
-125.2 125
-200 200
-1234567890.12345678 1234567890
+-1234567890.123456789000000000 -1234567890
+-4400.000000000000000000 4400
+-1255.490000000000000000 -1255
+-1.122000000000000000 -11
+-1.120000000000000000 -1
+-1.120000000000000000 -1
+-0.333000000000000000 0
+-0.330000000000000000 0
+-0.300000000000000000 0
+0.000000000000000000 0
+0.000000000000000000 0
+0.000000000000000000 0
+0.010000000000000000 0
+0.020000000000000000 0
+0.100000000000000000 0
+0.200000000000000000 0
+0.300000000000000000 0
+0.330000000000000000 0
+0.333000000000000000 0
+1.000000000000000000 1
+1.000000000000000000 1
+1.000000000000000000 1
+1.120000000000000000 1
+1.122000000000000000 1
+2.000000000000000000 2
+2.000000000000000000 2
+3.140000000000000000 3
+3.140000000000000000 3
+3.140000000000000000 3
+3.140000000000000000 4
+10.000000000000000000 10
+20.000000000000000000 20
+100.000000000000000000 100
+124.000000000000000000 124
+125.200000000000000000 125
+200.000000000000000000 200
+1234567890.123456780000000000 1234567890
diff --git a/sql/hive/src/test/resources/golden/windowing_navfn.q (deterministic)-2-1e88e0ba414a00195f7ebf6b8600ac04 b/sql/hive/src/test/resources/golden/windowing_navfn.q (deterministic)-2-1e88e0ba414a00195f7ebf6b8600ac04
index 62d71abc6fc7d..33ea4edf780a6 100644
--- a/sql/hive/src/test/resources/golden/windowing_navfn.q (deterministic)-2-1e88e0ba414a00195f7ebf6b8600ac04
+++ b/sql/hive/src/test/resources/golden/windowing_navfn.q (deterministic)-2-1e88e0ba414a00195f7ebf6b8600ac04
@@ -3,7 +3,7 @@
65536 32.68
65536 33.45
65536 58.86
-65536 75.7
+65536 75.70
65536 83.48
65537 NULL
65537 4.49
@@ -57,9 +57,9 @@
65548 75.39
65548 77.24
65549 NULL
-65549 13.3
+65549 13.30
65549 28.93
-65549 50.6
+65549 50.60
65549 55.04
65549 64.91
65549 76.06
@@ -70,7 +70,7 @@
65550 33.01
65550 57.63
65550 91.38
-65550 96.9
+65550 96.90
65551 NULL
65551 39.43
65551 73.93
@@ -99,7 +99,7 @@
65559 29.55
65559 56.06
65559 73.94
-65559 83.5
+65559 83.50
65560 NULL
65560 16.86
65560 21.81
@@ -128,7 +128,7 @@
65565 NULL
65565 81.72
65566 NULL
-65566 7.8
+65566 7.80
65567 NULL
65568 NULL
65568 21.79
@@ -136,14 +136,14 @@
65569 NULL
65570 NULL
65570 17.09
-65570 18.2
+65570 18.20
65570 25.57
65570 45.23
-65570 76.8
+65570 76.80
65571 NULL
65571 26.64
65571 40.68
-65571 82.5
+65571 82.50
65572 NULL
65572 22.64
65572 43.49
@@ -156,9 +156,9 @@
65574 31.28
65574 38.54
65575 NULL
-65575 17
+65575 17.00
65575 32.85
-65575 83.4
+65575 83.40
65576 NULL
65576 2.04
65576 4.88
@@ -166,7 +166,7 @@
65577 NULL
65578 NULL
65578 16.01
-65578 41.1
+65578 41.10
65578 51.36
65578 54.35
65578 58.78
@@ -188,7 +188,7 @@
65582 NULL
65582 1.23
65582 9.35
-65582 96.6
+65582 96.60
65583 NULL
65583 28.07
65583 50.57
@@ -218,7 +218,7 @@
65588 98.33
65589 NULL
65589 49.49
-65589 72.3
+65589 72.30
65589 74.83
65589 94.73
65590 NULL
@@ -240,8 +240,8 @@
65595 NULL
65595 8.76
65595 67.56
-65595 72.7
-65595 89.6
+65595 72.70
+65595 89.60
65595 90.24
65596 NULL
65596 12.72
@@ -252,7 +252,7 @@
65597 37.41
65597 69.05
65598 NULL
-65598 63.3
+65598 63.30
65599 NULL
65599 0.56
65599 4.93
@@ -283,7 +283,7 @@
65605 NULL
65606 NULL
65606 7.51
-65606 24.8
+65606 24.80
65606 57.69
65606 67.94
65606 87.16
@@ -294,9 +294,9 @@
65607 75.86
65607 91.52
65608 NULL
-65608 48.9
+65608 48.90
65608 69.42
-65608 87.9
+65608 87.90
65609 NULL
65610 NULL
65610 7.59
@@ -309,7 +309,7 @@
65611 64.89
65612 NULL
65612 16.05
-65612 25.1
+65612 25.10
65612 52.64
65613 NULL
65614 NULL
@@ -317,17 +317,17 @@
65614 94.47
65615 NULL
65615 10.79
-65615 39.4
+65615 39.40
65615 99.88
65616 NULL
-65616 75.2
+65616 75.20
65617 NULL
65617 18.51
65617 47.45
-65617 64.9
+65617 64.90
65618 NULL
65618 10.06
-65618 16.6
+65618 16.60
65618 81.99
65618 88.38
65619 NULL
@@ -348,20 +348,20 @@
65622 28.37
65622 50.08
65622 74.31
-65622 88.6
-65622 93.7
+65622 88.60
+65622 93.70
65623 NULL
65623 30.83
65623 31.22
65623 39.74
65623 48.51
65623 95.58
-65623 97.2
+65623 97.20
65624 NULL
65624 58.02
65624 65.31
65624 70.08
-65624 93.3
+65624 93.30
65625 NULL
65625 20.61
65625 42.86
@@ -377,13 +377,13 @@
65628 NULL
65628 14.83
65628 30.43
-65628 37.8
+65628 37.80
65628 74.31
65628 83.26
65629 NULL
65629 19.33
65629 58.81
-65629 72.9
+65629 72.90
65630 NULL
65630 72.13
65631 NULL
@@ -412,7 +412,7 @@
65637 48.88
65637 93.41
65638 NULL
-65638 11.2
+65638 11.20
65638 19.13
65639 NULL
65640 NULL
@@ -477,20 +477,20 @@
65654 26.73
65654 29.85
65654 37.74
-65654 37.8
+65654 37.80
65654 53.55
65654 88.23
65655 NULL
65655 77.41
65656 NULL
-65656 14
+65656 14.00
65656 14.96
65656 53.27
65656 64.44
65656 82.67
65657 NULL
65657 11.93
-65657 26.4
+65657 26.40
65657 64.39
65657 65.01
65658 NULL
@@ -506,8 +506,8 @@
65659 NULL
65659 8.95
65659 46.57
-65659 53.8
-65659 94.3
+65659 53.80
+65659 94.30
65659 94.69
65659 95.71
65659 99.87
@@ -517,7 +517,7 @@
65661 NULL
65661 5.24
65661 8.06
-65661 26.8
+65661 26.80
65661 68.98
65662 NULL
65662 59.92
@@ -531,10 +531,10 @@
65663 94.16
65664 NULL
65664 11.46
-65664 27.6
+65664 27.60
65664 34.71
65664 38.42
-65664 45.4
+65664 45.40
65664 55.82
65664 97.64
65665 NULL
@@ -543,13 +543,13 @@
65666 83.95
65667 NULL
65667 13.96
-65667 63.9
+65667 63.90
65667 97.87
65668 NULL
65669 NULL
65669 1.76
65669 16.95
-65669 38.6
+65669 38.60
65669 54.25
65669 93.79
65670 NULL
@@ -561,12 +561,12 @@
65671 8.65
65671 52.05
65672 NULL
-65672 52.6
-65672 58.1
+65672 52.60
+65672 58.10
65672 64.09
65672 75.27
65673 NULL
-65673 0.9
+65673 0.90
65673 33.27
65673 43.81
65673 87.78
@@ -576,7 +576,7 @@
65675 24.19
65675 35.33
65675 35.78
-65675 79.9
+65675 79.90
65675 83.09
65675 87.36
65676 NULL
@@ -591,19 +591,19 @@
65677 87.67
65678 NULL
65678 8.72
-65678 33.9
+65678 33.90
65679 NULL
65679 64.15
65680 NULL
65680 1.01
65680 34.08
65680 54.11
-65680 55.3
+65680 55.30
65680 65.88
65681 NULL
65681 35.45
65681 41.57
-65681 61.3
+65681 61.30
65681 71.17
65681 75.85
65682 NULL
@@ -641,7 +641,7 @@
65691 28.47
65691 56.02
65691 58.01
-65691 69.8
+65691 69.80
65691 76.98
65692 NULL
65692 54.76
@@ -655,19 +655,19 @@
65694 NULL
65694 58.23
65694 82.24
-65694 88.5
+65694 88.50
65695 NULL
65695 57.33
65695 59.96
65695 77.09
65696 NULL
65696 17.35
-65696 40.3
+65696 40.30
65696 54.02
65697 NULL
65697 3.18
65697 50.01
-65697 67.9
+65697 67.90
65697 86.79
65697 90.16
65698 NULL
@@ -685,9 +685,9 @@
65701 1.81
65701 6.35
65702 NULL
-65702 37.6
+65702 37.60
65702 55.68
-65702 79.5
+65702 79.50
65703 NULL
65703 37.18
65703 40.81
@@ -708,23 +708,23 @@
65706 55.94
65706 72.87
65707 NULL
-65707 76.2
+65707 76.20
65708 NULL
65708 1.29
65709 NULL
65709 5.64
65709 49.79
65710 NULL
-65710 86.7
+65710 86.70
65711 NULL
65711 8.66
65711 50.26
65711 71.89
65711 78.69
-65711 96.1
+65711 96.10
65712 NULL
65712 30.27
-65712 34.7
+65712 34.70
65712 49.69
65712 53.65
65713 NULL
@@ -739,11 +739,11 @@
65715 39.62
65715 54.79
65715 81.28
-65715 89.4
+65715 89.40
65716 NULL
-65716 9
+65716 9.00
65716 10.07
-65716 33.4
+65716 33.40
65716 71.53
65716 85.93
65717 NULL
@@ -758,10 +758,10 @@
65719 NULL
65719 51.13
65719 66.85
-65719 82.1
+65719 82.10
65720 NULL
65720 2.72
-65720 18.8
+65720 18.80
65720 22.34
65720 62.04
65721 NULL
@@ -775,7 +775,7 @@
65722 1.76
65722 38.82
65723 NULL
-65723 39.9
+65723 39.90
65724 NULL
65724 10.52
65724 36.05
@@ -784,7 +784,7 @@
65724 85.52
65725 NULL
65726 NULL
-65726 6
+65726 6.00
65726 60.46
65727 NULL
65727 19.81
@@ -796,7 +796,7 @@
65729 NULL
65730 NULL
65730 1.35
-65730 30.6
+65730 30.60
65730 81.44
65731 NULL
65731 24.48
@@ -810,14 +810,14 @@
65733 20.72
65733 88.46
65733 93.45
-65733 99.8
+65733 99.80
65734 NULL
65734 31.71
65735 NULL
65735 12.67
65735 61.16
65736 NULL
-65736 28.9
+65736 28.90
65736 48.54
65736 86.51
65737 NULL
@@ -828,10 +828,10 @@
65738 NULL
65738 30.94
65738 82.32
-65738 95.1
+65738 95.10
65739 NULL
65739 74.77
-65739 92.4
+65739 92.40
65740 NULL
65740 7.49
65740 58.65
@@ -840,9 +840,9 @@
65742 6.61
65742 43.84
65743 NULL
-65743 26.6
+65743 26.60
65743 52.65
-65743 62
+65743 62.00
65744 NULL
65744 46.98
65745 NULL
@@ -853,11 +853,11 @@
65746 36.74
65746 93.21
65746 97.52
-65746 98.1
+65746 98.10
65747 NULL
65747 11.16
65747 15.07
-65747 21.8
+65747 21.80
65747 39.77
65747 52.77
65747 71.87
@@ -865,7 +865,7 @@
65748 29.49
65749 NULL
65749 15.14
-65749 45
+65749 45.00
65749 65.49
65749 73.24
65750 NULL
@@ -888,12 +888,12 @@
65755 NULL
65755 11.23
65755 22.44
-65755 64
+65755 64.00
65755 67.54
65755 76.75
65755 81.44
65755 90.08
-65755 96.8
+65755 96.80
65756 NULL
65756 1.45
65756 11.81
@@ -907,10 +907,10 @@
65758 25.62
65758 56.56
65758 60.88
-65758 94.9
+65758 94.90
65759 NULL
65759 10.63
-65759 14.1
+65759 14.10
65759 47.54
65759 92.81
65760 NULL
@@ -920,17 +920,17 @@
65761 NULL
65762 NULL
65762 5.49
-65762 45.7
+65762 45.70
65762 77.96
-65762 87.5
+65762 87.50
65763 NULL
65763 0.72
-65763 43.8
+65763 43.80
65763 86.43
65763 87.99
65764 NULL
65764 31.41
-65764 57.1
+65764 57.10
65765 NULL
65765 88.52
65765 88.56
@@ -938,7 +938,7 @@
65766 37.06
65766 66.34
65766 86.53
-65766 98.9
+65766 98.90
65767 NULL
65767 90.88
65767 95.57
@@ -950,14 +950,14 @@
65769 70.52
65769 91.49
65770 NULL
-65770 51.9
+65770 51.90
65771 NULL
65771 6.15
-65771 7.5
+65771 7.50
65772 NULL
65773 NULL
65773 3.81
-65773 18.2
+65773 18.20
65773 30.49
65773 47.09
65773 53.09
@@ -966,7 +966,7 @@
65774 NULL
65774 45.74
65774 45.97
-65774 48.8
+65774 48.80
65774 56.84
65774 94.77
65775 NULL
@@ -975,7 +975,7 @@
65775 66.68
65775 98.43
65776 NULL
-65776 18.7
+65776 18.70
65776 28.47
65776 49.73
65776 98.87
@@ -993,7 +993,7 @@
65778 95.69
65779 NULL
65779 11.87
-65779 28.2
+65779 28.20
65779 39.48
65779 45.61
65779 64.41
@@ -1008,15 +1008,15 @@
65782 30.24
65782 34.31
65782 76.14
-65782 81.9
+65782 81.90
65783 NULL
65783 46.34
65783 51.08
65783 52.43
65783 62.58
-65783 77.4
+65783 77.40
65784 NULL
-65784 15.7
+65784 15.70
65784 31.35
65784 68.18
65784 93.95
@@ -1032,7 +1032,7 @@
65787 31.19
65787 64.88
65788 NULL
-65788 16.1
+65788 16.10
65788 21.81
65788 25.77
65789 NULL
@@ -1041,7 +1041,7 @@
65789 52.49
65789 83.18
65789 92.74
-65789 96.9
+65789 96.90
65790 NULL
65790 46.91
65790 84.87
diff --git a/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 2-0-81bb7f49a55385878637c8aac4d08e5 b/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 2-0-81bb7f49a55385878637c8aac4d08e5
index 9091a9156134c..207dababa0a50 100644
--- a/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 2-0-81bb7f49a55385878637c8aac4d08e5
+++ b/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 2-0-81bb7f49a55385878637c8aac4d08e5
@@ -18,12 +18,12 @@
2013-03-01 09:11:58.703073 10.07 1
2013-03-01 09:11:58.703073 10.07 1
2013-03-01 09:11:58.703073 10.07 1
-2013-03-01 09:11:58.703074 37.8 1
-2013-03-01 09:11:58.703074 37.8 1
-2013-03-01 09:11:58.703074 37.8 1
-2013-03-01 09:11:58.703074 37.8 1
-2013-03-01 09:11:58.703074 37.8 1
-2013-03-01 09:11:58.703074 37.8 1
+2013-03-01 09:11:58.703074 37.80 1
+2013-03-01 09:11:58.703074 37.80 1
+2013-03-01 09:11:58.703074 37.80 1
+2013-03-01 09:11:58.703074 37.80 1
+2013-03-01 09:11:58.703074 37.80 1
+2013-03-01 09:11:58.703074 37.80 1
2013-03-01 09:11:58.703075 5.64 1
2013-03-01 09:11:58.703075 5.64 1
2013-03-01 09:11:58.703075 5.64 1
@@ -59,11 +59,11 @@
2013-03-01 09:11:58.70308 1.76 1
2013-03-01 09:11:58.70308 1.76 1
2013-03-01 09:11:58.70308 1.76 1
-2013-03-01 09:11:58.703081 67.9 1
-2013-03-01 09:11:58.703081 67.9 1
-2013-03-01 09:11:58.703081 67.9 1
-2013-03-01 09:11:58.703081 67.9 1
-2013-03-01 09:11:58.703081 67.9 1
+2013-03-01 09:11:58.703081 67.90 1
+2013-03-01 09:11:58.703081 67.90 1
+2013-03-01 09:11:58.703081 67.90 1
+2013-03-01 09:11:58.703081 67.90 1
+2013-03-01 09:11:58.703081 67.90 1
2013-03-01 09:11:58.703082 37.25 1
2013-03-01 09:11:58.703082 37.25 1
2013-03-01 09:11:58.703082 37.25 1
@@ -148,9 +148,9 @@
2013-03-01 09:11:58.703096 11.64 1
2013-03-01 09:11:58.703096 11.64 1
2013-03-01 09:11:58.703096 11.64 1
-2013-03-01 09:11:58.703097 0.9 1
-2013-03-01 09:11:58.703097 0.9 1
-2013-03-01 09:11:58.703097 0.9 1
+2013-03-01 09:11:58.703097 0.90 1
+2013-03-01 09:11:58.703097 0.90 1
+2013-03-01 09:11:58.703097 0.90 1
2013-03-01 09:11:58.703098 1.35 1
2013-03-01 09:11:58.703098 1.35 1
2013-03-01 09:11:58.703098 1.35 1
@@ -210,27 +210,27 @@
2013-03-01 09:11:58.70311 8.16 1
2013-03-01 09:11:58.70311 8.16 1
2013-03-01 09:11:58.70311 8.16 1
-2013-03-01 09:11:58.703111 18.8 1
-2013-03-01 09:11:58.703111 18.8 1
-2013-03-01 09:11:58.703111 18.8 1
-2013-03-01 09:11:58.703111 18.8 1
-2013-03-01 09:11:58.703111 18.8 1
-2013-03-01 09:11:58.703111 18.8 1
-2013-03-01 09:11:58.703111 18.8 1
+2013-03-01 09:11:58.703111 18.80 1
+2013-03-01 09:11:58.703111 18.80 1
+2013-03-01 09:11:58.703111 18.80 1
+2013-03-01 09:11:58.703111 18.80 1
+2013-03-01 09:11:58.703111 18.80 1
+2013-03-01 09:11:58.703111 18.80 1
+2013-03-01 09:11:58.703111 18.80 1
2013-03-01 09:11:58.703112 13.29 1
2013-03-01 09:11:58.703112 13.29 1
2013-03-01 09:11:58.703112 13.29 1
2013-03-01 09:11:58.703112 13.29 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
-2013-03-01 09:11:58.703113 21.8 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
+2013-03-01 09:11:58.703113 21.80 1
2013-03-01 09:11:58.703114 73.94 1
2013-03-01 09:11:58.703114 73.94 1
2013-03-01 09:11:58.703114 73.94 1
@@ -256,14 +256,14 @@
2013-03-01 09:11:58.703118 8.69 1
2013-03-01 09:11:58.703119 58.02 1
2013-03-01 09:11:58.703119 58.02 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.703121 96.9 1
-2013-03-01 09:11:58.703121 96.9 1
-2013-03-01 09:11:58.703121 96.9 1
-2013-03-01 09:11:58.703121 96.9 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.703121 96.90 1
+2013-03-01 09:11:58.703121 96.90 1
+2013-03-01 09:11:58.703121 96.90 1
+2013-03-01 09:11:58.703121 96.90 1
2013-03-01 09:11:58.703122 53.56 1
2013-03-01 09:11:58.703122 53.56 1
2013-03-01 09:11:58.703122 53.56 1
@@ -310,11 +310,11 @@
2013-03-01 09:11:58.703133 27.34 1
2013-03-01 09:11:58.703133 27.34 1
2013-03-01 09:11:58.703133 27.34 1
-2013-03-01 09:11:58.703134 98.9 1
-2013-03-01 09:11:58.703134 98.9 1
-2013-03-01 09:11:58.703134 98.9 1
-2013-03-01 09:11:58.703134 98.9 1
-2013-03-01 09:11:58.703134 98.9 1
+2013-03-01 09:11:58.703134 98.90 1
+2013-03-01 09:11:58.703134 98.90 1
+2013-03-01 09:11:58.703134 98.90 1
+2013-03-01 09:11:58.703134 98.90 1
+2013-03-01 09:11:58.703134 98.90 1
2013-03-01 09:11:58.703135 29.14 1
2013-03-01 09:11:58.703135 29.14 1
2013-03-01 09:11:58.703135 29.14 1
@@ -467,12 +467,12 @@
2013-03-01 09:11:58.703162 3.51 1
2013-03-01 09:11:58.703162 3.51 1
2013-03-01 09:11:58.703162 3.51 1
-2013-03-01 09:11:58.703163 15.7 1
-2013-03-01 09:11:58.703163 15.7 1
-2013-03-01 09:11:58.703163 15.7 1
-2013-03-01 09:11:58.703163 15.7 1
-2013-03-01 09:11:58.703163 15.7 1
-2013-03-01 09:11:58.703163 15.7 1
+2013-03-01 09:11:58.703163 15.70 1
+2013-03-01 09:11:58.703163 15.70 1
+2013-03-01 09:11:58.703163 15.70 1
+2013-03-01 09:11:58.703163 15.70 1
+2013-03-01 09:11:58.703163 15.70 1
+2013-03-01 09:11:58.703163 15.70 1
2013-03-01 09:11:58.703164 30.27 1
2013-03-01 09:11:58.703164 30.27 1
2013-03-01 09:11:58.703164 30.27 1
@@ -482,9 +482,9 @@
2013-03-01 09:11:58.703165 8.38 1
2013-03-01 09:11:58.703165 8.38 1
2013-03-01 09:11:58.703165 8.38 1
-2013-03-01 09:11:58.703166 16.6 1
-2013-03-01 09:11:58.703166 16.6 1
-2013-03-01 09:11:58.703166 16.6 1
+2013-03-01 09:11:58.703166 16.60 1
+2013-03-01 09:11:58.703166 16.60 1
+2013-03-01 09:11:58.703166 16.60 1
2013-03-01 09:11:58.703167 17.66 1
2013-03-01 09:11:58.703167 17.66 1
2013-03-01 09:11:58.703167 17.66 1
@@ -537,11 +537,11 @@
2013-03-01 09:11:58.703175 33.37 1
2013-03-01 09:11:58.703175 33.37 1
2013-03-01 09:11:58.703175 33.37 1
-2013-03-01 09:11:58.703176 28.2 1
-2013-03-01 09:11:58.703176 28.2 1
-2013-03-01 09:11:58.703176 28.2 1
-2013-03-01 09:11:58.703176 28.2 1
-2013-03-01 09:11:58.703176 28.2 1
+2013-03-01 09:11:58.703176 28.20 1
+2013-03-01 09:11:58.703176 28.20 1
+2013-03-01 09:11:58.703176 28.20 1
+2013-03-01 09:11:58.703176 28.20 1
+2013-03-01 09:11:58.703176 28.20 1
2013-03-01 09:11:58.703177 11.43 1
2013-03-01 09:11:58.703177 11.43 1
2013-03-01 09:11:58.703177 11.43 1
@@ -567,13 +567,13 @@
2013-03-01 09:11:58.70318 10.28 1
2013-03-01 09:11:58.70318 10.28 1
2013-03-01 09:11:58.70318 10.28 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
2013-03-01 09:11:58.703182 1.23 1
2013-03-01 09:11:58.703182 1.23 1
2013-03-01 09:11:58.703182 1.23 1
@@ -647,10 +647,10 @@
2013-03-01 09:11:58.703197 16.01 1
2013-03-01 09:11:58.703197 16.01 1
2013-03-01 09:11:58.703197 16.01 1
-2013-03-01 09:11:58.703198 30.6 1
-2013-03-01 09:11:58.703198 30.6 1
-2013-03-01 09:11:58.703198 30.6 1
-2013-03-01 09:11:58.703198 30.6 1
+2013-03-01 09:11:58.703198 30.60 1
+2013-03-01 09:11:58.703198 30.60 1
+2013-03-01 09:11:58.703198 30.60 1
+2013-03-01 09:11:58.703198 30.60 1
2013-03-01 09:11:58.703199 45.69 1
2013-03-01 09:11:58.703199 45.69 1
2013-03-01 09:11:58.703199 45.69 1
@@ -669,11 +669,11 @@
2013-03-01 09:11:58.703203 11.63 1
2013-03-01 09:11:58.703203 11.63 1
2013-03-01 09:11:58.703203 11.63 1
-2013-03-01 09:11:58.703205 35.8 1
-2013-03-01 09:11:58.703205 35.8 1
-2013-03-01 09:11:58.703205 35.8 1
-2013-03-01 09:11:58.703205 35.8 1
-2013-03-01 09:11:58.703205 35.8 1
+2013-03-01 09:11:58.703205 35.80 1
+2013-03-01 09:11:58.703205 35.80 1
+2013-03-01 09:11:58.703205 35.80 1
+2013-03-01 09:11:58.703205 35.80 1
+2013-03-01 09:11:58.703205 35.80 1
2013-03-01 09:11:58.703206 6.61 1
2013-03-01 09:11:58.703206 6.61 1
2013-03-01 09:11:58.703206 6.61 1
@@ -824,9 +824,9 @@
2013-03-01 09:11:58.703233 40.81 1
2013-03-01 09:11:58.703233 40.81 1
2013-03-01 09:11:58.703233 40.81 1
-2013-03-01 09:11:58.703234 44.1 1
-2013-03-01 09:11:58.703234 44.1 1
-2013-03-01 09:11:58.703234 44.1 1
+2013-03-01 09:11:58.703234 44.10 1
+2013-03-01 09:11:58.703234 44.10 1
+2013-03-01 09:11:58.703234 44.10 1
2013-03-01 09:11:58.703235 6.35 1
2013-03-01 09:11:58.703235 6.35 1
2013-03-01 09:11:58.703235 6.35 1
@@ -834,11 +834,11 @@
2013-03-01 09:11:58.703235 6.35 1
2013-03-01 09:11:58.703235 6.35 1
2013-03-01 09:11:58.703235 6.35 1
-2013-03-01 09:11:58.703236 37.8 1
-2013-03-01 09:11:58.703236 37.8 1
-2013-03-01 09:11:58.703236 37.8 1
-2013-03-01 09:11:58.703236 37.8 1
-2013-03-01 09:11:58.703236 37.8 1
+2013-03-01 09:11:58.703236 37.80 1
+2013-03-01 09:11:58.703236 37.80 1
+2013-03-01 09:11:58.703236 37.80 1
+2013-03-01 09:11:58.703236 37.80 1
+2013-03-01 09:11:58.703236 37.80 1
2013-03-01 09:11:58.703237 0.24 1
2013-03-01 09:11:58.703237 0.24 1
2013-03-01 09:11:58.703237 0.24 1
@@ -847,17 +847,17 @@
2013-03-01 09:11:58.703237 0.24 1
2013-03-01 09:11:58.703237 0.24 1
2013-03-01 09:11:58.703237 0.24 1
-2013-03-01 09:11:58.703238 6 1
-2013-03-01 09:11:58.703238 6 1
-2013-03-01 09:11:58.703238 6 1
-2013-03-01 09:11:58.703238 6 1
-2013-03-01 09:11:58.703239 24.8 1
-2013-03-01 09:11:58.703239 24.8 1
-2013-03-01 09:11:58.703239 24.8 1
-2013-03-01 09:11:58.703239 24.8 1
-2013-03-01 09:11:58.703239 24.8 1
-2013-03-01 09:11:58.70324 5.1 1
-2013-03-01 09:11:58.70324 5.1 1
+2013-03-01 09:11:58.703238 6.00 1
+2013-03-01 09:11:58.703238 6.00 1
+2013-03-01 09:11:58.703238 6.00 1
+2013-03-01 09:11:58.703238 6.00 1
+2013-03-01 09:11:58.703239 24.80 1
+2013-03-01 09:11:58.703239 24.80 1
+2013-03-01 09:11:58.703239 24.80 1
+2013-03-01 09:11:58.703239 24.80 1
+2013-03-01 09:11:58.703239 24.80 1
+2013-03-01 09:11:58.70324 5.10 1
+2013-03-01 09:11:58.70324 5.10 1
2013-03-01 09:11:58.703241 19.33 1
2013-03-01 09:11:58.703241 19.33 1
2013-03-01 09:11:58.703241 19.33 1
@@ -973,16 +973,16 @@
2013-03-01 09:11:58.703262 1.81 1
2013-03-01 09:11:58.703262 1.81 1
2013-03-01 09:11:58.703262 1.81 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
2013-03-01 09:11:58.703264 52.49 1
2013-03-01 09:11:58.703264 52.49 1
2013-03-01 09:11:58.703264 52.49 1
@@ -1068,12 +1068,12 @@
2013-03-01 09:11:58.703281 19.95 1
2013-03-01 09:11:58.703281 19.95 1
2013-03-01 09:11:58.703281 19.95 1
-2013-03-01 09:11:58.703282 7.5 1
-2013-03-01 09:11:58.703282 7.5 1
-2013-03-01 09:11:58.703282 7.5 1
-2013-03-01 09:11:58.703282 7.5 1
-2013-03-01 09:11:58.703282 7.5 1
-2013-03-01 09:11:58.703282 7.5 1
+2013-03-01 09:11:58.703282 7.50 1
+2013-03-01 09:11:58.703282 7.50 1
+2013-03-01 09:11:58.703282 7.50 1
+2013-03-01 09:11:58.703282 7.50 1
+2013-03-01 09:11:58.703282 7.50 1
+2013-03-01 09:11:58.703282 7.50 1
2013-03-01 09:11:58.703283 17.62 1
2013-03-01 09:11:58.703283 17.62 1
2013-03-01 09:11:58.703283 17.62 1
@@ -1153,12 +1153,12 @@
2013-03-01 09:11:58.703297 25.67 1
2013-03-01 09:11:58.703297 25.67 1
2013-03-01 09:11:58.703297 25.67 1
-2013-03-01 09:11:58.703298 8.8 1
-2013-03-01 09:11:58.703298 8.8 1
-2013-03-01 09:11:58.703298 8.8 1
-2013-03-01 09:11:58.703298 8.8 1
-2013-03-01 09:11:58.703299 9 1
-2013-03-01 09:11:58.703299 9 1
+2013-03-01 09:11:58.703298 8.80 1
+2013-03-01 09:11:58.703298 8.80 1
+2013-03-01 09:11:58.703298 8.80 1
+2013-03-01 09:11:58.703298 8.80 1
+2013-03-01 09:11:58.703299 9.00 1
+2013-03-01 09:11:58.703299 9.00 1
2013-03-01 09:11:58.7033 7.51 1
2013-03-01 09:11:58.7033 7.51 1
2013-03-01 09:11:58.7033 7.51 1
@@ -1217,12 +1217,12 @@
2013-03-01 09:11:58.703311 7.38 1
2013-03-01 09:11:58.703311 7.38 1
2013-03-01 09:11:58.703311 7.38 1
-2013-03-01 09:11:58.703312 18.2 1
-2013-03-01 09:11:58.703312 18.2 1
-2013-03-01 09:11:58.703312 18.2 1
-2013-03-01 09:11:58.703312 18.2 1
-2013-03-01 09:11:58.703312 18.2 1
-2013-03-01 09:11:58.703312 18.2 1
+2013-03-01 09:11:58.703312 18.20 1
+2013-03-01 09:11:58.703312 18.20 1
+2013-03-01 09:11:58.703312 18.20 1
+2013-03-01 09:11:58.703312 18.20 1
+2013-03-01 09:11:58.703312 18.20 1
+2013-03-01 09:11:58.703312 18.20 1
2013-03-01 09:11:58.703313 9.35 1
2013-03-01 09:11:58.703313 9.35 1
2013-03-01 09:11:58.703313 9.35 1
diff --git a/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 4-0-12cc78f3953c3e6b5411ddc729541bf0 b/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 4-0-12cc78f3953c3e6b5411ddc729541bf0
index d02ca48857b5f..a1628c7e1c0c5 100644
--- a/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 4-0-12cc78f3953c3e6b5411ddc729541bf0
+++ b/sql/hive/src/test/resources/golden/windowing_rank.q (deterministic) 4-0-12cc78f3953c3e6b5411ddc729541bf0
@@ -46,9 +46,9 @@
2013-03-01 09:11:58.703092 54.02 1
2013-03-01 09:11:58.703092 54.02 1
2013-03-01 09:11:58.703096 87.84 1
-2013-03-01 09:11:58.703097 0.9 1
-2013-03-01 09:11:58.703097 0.9 1
-2013-03-01 09:11:58.703097 0.9 1
+2013-03-01 09:11:58.703097 0.90 1
+2013-03-01 09:11:58.703097 0.90 1
+2013-03-01 09:11:58.703097 0.90 1
2013-03-01 09:11:58.703098 21.29 1
2013-03-01 09:11:58.703098 21.29 1
2013-03-01 09:11:58.703098 21.29 1
@@ -88,10 +88,10 @@
2013-03-01 09:11:58.703113 58.65 1
2013-03-01 09:11:58.703118 8.69 1
2013-03-01 09:11:58.703118 8.69 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.70312 52.6 1
-2013-03-01 09:11:58.70312 52.6 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.70312 52.60 1
+2013-03-01 09:11:58.70312 52.60 1
2013-03-01 09:11:58.703125 78.52 1
2013-03-01 09:11:58.703125 78.52 1
2013-03-01 09:11:58.703125 78.52 1
@@ -119,11 +119,11 @@
2013-03-01 09:11:58.703136 27.89 1
2013-03-01 09:11:58.703136 27.89 1
2013-03-01 09:11:58.703136 27.89 1
-2013-03-01 09:11:58.703138 86.7 1
-2013-03-01 09:11:58.703138 86.7 1
-2013-03-01 09:11:58.703138 86.7 1
-2013-03-01 09:11:58.703138 86.7 1
-2013-03-01 09:11:58.703138 86.7 1
+2013-03-01 09:11:58.703138 86.70 1
+2013-03-01 09:11:58.703138 86.70 1
+2013-03-01 09:11:58.703138 86.70 1
+2013-03-01 09:11:58.703138 86.70 1
+2013-03-01 09:11:58.703138 86.70 1
2013-03-01 09:11:58.703139 43.53 1
2013-03-01 09:11:58.703139 43.53 1
2013-03-01 09:11:58.703139 43.53 1
@@ -167,13 +167,13 @@
2013-03-01 09:11:58.703179 60.94 1
2013-03-01 09:11:58.703179 60.94 1
2013-03-01 09:11:58.703179 60.94 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
-2013-03-01 09:11:58.703181 26.6 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
+2013-03-01 09:11:58.703181 26.60 1
2013-03-01 09:11:58.703184 73.93 1
2013-03-01 09:11:58.703184 73.93 1
2013-03-01 09:11:58.703184 73.93 1
@@ -202,12 +202,12 @@
2013-03-01 09:11:58.703189 37.74 1
2013-03-01 09:11:58.703189 37.74 1
2013-03-01 09:11:58.703189 37.74 1
-2013-03-01 09:11:58.703195 82.5 1
-2013-03-01 09:11:58.703195 82.5 1
-2013-03-01 09:11:58.703195 82.5 1
-2013-03-01 09:11:58.703195 82.5 1
-2013-03-01 09:11:58.703195 82.5 1
-2013-03-01 09:11:58.703195 82.5 1
+2013-03-01 09:11:58.703195 82.50 1
+2013-03-01 09:11:58.703195 82.50 1
+2013-03-01 09:11:58.703195 82.50 1
+2013-03-01 09:11:58.703195 82.50 1
+2013-03-01 09:11:58.703195 82.50 1
+2013-03-01 09:11:58.703195 82.50 1
2013-03-01 09:11:58.703198 97.18 1
2013-03-01 09:11:58.703198 97.18 1
2013-03-01 09:11:58.703198 97.18 1
@@ -233,10 +233,10 @@
2013-03-01 09:11:58.70321 37.12 1
2013-03-01 09:11:58.70321 37.12 1
2013-03-01 09:11:58.70321 37.12 1
-2013-03-01 09:11:58.703213 48.8 1
-2013-03-01 09:11:58.703213 48.8 1
-2013-03-01 09:11:58.703213 48.8 1
-2013-03-01 09:11:58.703213 48.8 1
+2013-03-01 09:11:58.703213 48.80 1
+2013-03-01 09:11:58.703213 48.80 1
+2013-03-01 09:11:58.703213 48.80 1
+2013-03-01 09:11:58.703213 48.80 1
2013-03-01 09:11:58.703219 32.73 1
2013-03-01 09:11:58.703219 32.73 1
2013-03-01 09:11:58.703219 32.73 1
@@ -253,30 +253,30 @@
2013-03-01 09:11:58.703221 26.64 1
2013-03-01 09:11:58.703221 26.64 1
2013-03-01 09:11:58.703221 26.64 1
-2013-03-01 09:11:58.703223 57.1 1
-2013-03-01 09:11:58.703223 57.1 1
-2013-03-01 09:11:58.703223 57.1 1
-2013-03-01 09:11:58.703223 57.1 1
-2013-03-01 09:11:58.703223 57.1 1
-2013-03-01 09:11:58.703223 57.1 1
-2013-03-01 09:11:58.703223 57.1 1
+2013-03-01 09:11:58.703223 57.10 1
+2013-03-01 09:11:58.703223 57.10 1
+2013-03-01 09:11:58.703223 57.10 1
+2013-03-01 09:11:58.703223 57.10 1
+2013-03-01 09:11:58.703223 57.10 1
+2013-03-01 09:11:58.703223 57.10 1
+2013-03-01 09:11:58.703223 57.10 1
2013-03-01 09:11:58.703224 42.93 1
2013-03-01 09:11:58.703224 42.93 1
2013-03-01 09:11:58.703224 42.93 1
2013-03-01 09:11:58.703224 42.93 1
-2013-03-01 09:11:58.703226 68.3 1
-2013-03-01 09:11:58.703226 68.3 1
-2013-03-01 09:11:58.703226 68.3 1
-2013-03-01 09:11:58.703226 68.3 1
-2013-03-01 09:11:58.703226 68.3 1
-2013-03-01 09:11:58.703226 68.3 1
-2013-03-01 09:11:58.703231 18.7 1
-2013-03-01 09:11:58.703231 18.7 1
-2013-03-01 09:11:58.703231 18.7 1
-2013-03-01 09:11:58.703231 18.7 1
-2013-03-01 09:11:58.703231 18.7 1
-2013-03-01 09:11:58.703231 18.7 1
-2013-03-01 09:11:58.703231 18.7 1
+2013-03-01 09:11:58.703226 68.30 1
+2013-03-01 09:11:58.703226 68.30 1
+2013-03-01 09:11:58.703226 68.30 1
+2013-03-01 09:11:58.703226 68.30 1
+2013-03-01 09:11:58.703226 68.30 1
+2013-03-01 09:11:58.703226 68.30 1
+2013-03-01 09:11:58.703231 18.70 1
+2013-03-01 09:11:58.703231 18.70 1
+2013-03-01 09:11:58.703231 18.70 1
+2013-03-01 09:11:58.703231 18.70 1
+2013-03-01 09:11:58.703231 18.70 1
+2013-03-01 09:11:58.703231 18.70 1
+2013-03-01 09:11:58.703231 18.70 1
2013-03-01 09:11:58.703233 40.81 1
2013-03-01 09:11:58.703233 40.81 1
2013-03-01 09:11:58.703233 40.81 1
@@ -295,24 +295,24 @@
2013-03-01 09:11:58.703244 25.67 1
2013-03-01 09:11:58.703244 25.67 1
2013-03-01 09:11:58.703244 25.67 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
-2013-03-01 09:11:58.703245 32.3 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
+2013-03-01 09:11:58.703245 32.30 1
2013-03-01 09:11:58.703246 72.87 1
2013-03-01 09:11:58.703246 72.87 1
2013-03-01 09:11:58.703248 81.28 1
2013-03-01 09:11:58.703248 81.28 1
2013-03-01 09:11:58.703248 81.28 1
-2013-03-01 09:11:58.703249 93.3 1
-2013-03-01 09:11:58.703249 93.3 1
-2013-03-01 09:11:58.703249 93.3 1
-2013-03-01 09:11:58.703249 93.3 1
+2013-03-01 09:11:58.703249 93.30 1
+2013-03-01 09:11:58.703249 93.30 1
+2013-03-01 09:11:58.703249 93.30 1
+2013-03-01 09:11:58.703249 93.30 1
2013-03-01 09:11:58.70325 93.79 1
2013-03-01 09:11:58.70325 93.79 1
2013-03-01 09:11:58.70325 93.79 1
@@ -324,12 +324,12 @@
2013-03-01 09:11:58.703254 0.32 1
2013-03-01 09:11:58.703254 0.32 1
2013-03-01 09:11:58.703254 0.32 1
-2013-03-01 09:11:58.703256 43.8 1
-2013-03-01 09:11:58.703256 43.8 1
-2013-03-01 09:11:58.703256 43.8 1
-2013-03-01 09:11:58.703256 43.8 1
-2013-03-01 09:11:58.703256 43.8 1
-2013-03-01 09:11:58.703256 43.8 1
+2013-03-01 09:11:58.703256 43.80 1
+2013-03-01 09:11:58.703256 43.80 1
+2013-03-01 09:11:58.703256 43.80 1
+2013-03-01 09:11:58.703256 43.80 1
+2013-03-01 09:11:58.703256 43.80 1
+2013-03-01 09:11:58.703256 43.80 1
2013-03-01 09:11:58.703258 21.21 1
2013-03-01 09:11:58.703258 21.21 1
2013-03-01 09:11:58.703258 21.21 1
@@ -342,16 +342,16 @@
2013-03-01 09:11:58.703262 78.56 1
2013-03-01 09:11:58.703262 78.56 1
2013-03-01 09:11:58.703262 78.56 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
-2013-03-01 09:11:58.703263 14.4 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
+2013-03-01 09:11:58.703263 14.40 1
2013-03-01 09:11:58.703264 52.49 1
2013-03-01 09:11:58.703264 52.49 1
2013-03-01 09:11:58.703264 52.49 1
@@ -438,10 +438,10 @@
2013-03-01 09:11:58.703299 23.19 1
2013-03-01 09:11:58.703299 23.19 1
2013-03-01 09:11:58.703299 23.19 1
-2013-03-01 09:11:58.703309 89.4 1
-2013-03-01 09:11:58.703309 89.4 1
-2013-03-01 09:11:58.703309 89.4 1
-2013-03-01 09:11:58.703309 89.4 1
+2013-03-01 09:11:58.703309 89.40 1
+2013-03-01 09:11:58.703309 89.40 1
+2013-03-01 09:11:58.703309 89.40 1
+2013-03-01 09:11:58.703309 89.40 1
2013-03-01 09:11:58.70331 69.26 1
2013-03-01 09:11:58.70331 69.26 1
2013-03-01 09:11:58.70331 69.26 1