Skip to content

Commit a9aacdf

Browse files
ueshincloud-fan
authored andcommitted
[SPARK-25208][SQL] Loosen Cast.forceNullable for DecimalType.
## What changes were proposed in this pull request? Casting to `DecimalType` is not always needed to force nullable. If the decimal type to cast is wider than original type, or only truncating or precision loss, the casted value won't be `null`. ## How was this patch tested? Added and modified tests. Closes #22200 from ueshin/issues/SPARK-25208/cast_nullable_decimal. Authored-by: Takuya UESHIN <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
1 parent 5d572fc commit a9aacdf

File tree

10 files changed

+145
-33
lines changed

10 files changed

+145
-33
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ object Cast {
154154
fromPrecedence >= 0 && fromPrecedence < toPrecedence
155155
}
156156

157+
def canNullSafeCastToDecimal(from: DataType, to: DecimalType): Boolean = from match {
158+
case from: BooleanType if to.isWiderThan(DecimalType.BooleanDecimal) => true
159+
case from: NumericType if to.isWiderThan(from) => true
160+
case from: DecimalType =>
161+
// truncating or precision lose
162+
(to.precision - to.scale) > (from.precision - from.scale)
163+
case _ => false // overflow
164+
}
165+
157166
def forceNullable(from: DataType, to: DataType): Boolean = (from, to) match {
158167
case (NullType, _) => true
159168
case (_, _) if from == to => false
@@ -169,7 +178,7 @@ object Cast {
169178
case (DateType, _) => true
170179
case (_, CalendarIntervalType) => true
171180

172-
case (_, _: DecimalType) => true // overflow
181+
case (_, to: DecimalType) if !canNullSafeCastToDecimal(from, to) => true
173182
case (_: FractionalType, _: IntegralType) => true // NaN, infinity
174183
case _ => false
175184
}

sql/catalyst/src/main/scala/org/apache/spark/sql/types/DecimalType.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ object DecimalType extends AbstractDataType {
121121
val MINIMUM_ADJUSTED_SCALE = 6
122122

123123
// The decimal types compatible with other numeric types
124+
private[sql] val BooleanDecimal = DecimalType(1, 0)
124125
private[sql] val ByteDecimal = DecimalType(3, 0)
125126
private[sql] val ShortDecimal = DecimalType(5, 0)
126127
private[sql] val IntDecimal = DecimalType(10, 0)

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,11 @@ class TypeCoercionSuite extends AnalysisTest {
502502
widenTestWithStringPromotion(
503503
ArrayType(IntegerType, containsNull = false),
504504
ArrayType(DecimalType.IntDecimal, containsNull = false),
505-
Some(ArrayType(DecimalType.IntDecimal, containsNull = true)))
505+
Some(ArrayType(DecimalType.IntDecimal, containsNull = false)))
506+
widenTestWithStringPromotion(
507+
ArrayType(DecimalType(36, 0), containsNull = false),
508+
ArrayType(DecimalType(36, 35), containsNull = false),
509+
Some(ArrayType(DecimalType(38, 35), containsNull = true)))
506510

507511
// MapType
508512
widenTestWithStringPromotion(
@@ -524,10 +528,18 @@ class TypeCoercionSuite extends AnalysisTest {
524528
widenTestWithStringPromotion(
525529
MapType(StringType, IntegerType, valueContainsNull = false),
526530
MapType(StringType, DecimalType.IntDecimal, valueContainsNull = false),
527-
Some(MapType(StringType, DecimalType.IntDecimal, valueContainsNull = true)))
531+
Some(MapType(StringType, DecimalType.IntDecimal, valueContainsNull = false)))
532+
widenTestWithStringPromotion(
533+
MapType(StringType, DecimalType(36, 0), valueContainsNull = false),
534+
MapType(StringType, DecimalType(36, 35), valueContainsNull = false),
535+
Some(MapType(StringType, DecimalType(38, 35), valueContainsNull = true)))
528536
widenTestWithStringPromotion(
529537
MapType(IntegerType, StringType, valueContainsNull = false),
530538
MapType(DecimalType.IntDecimal, StringType, valueContainsNull = false),
539+
Some(MapType(DecimalType.IntDecimal, StringType, valueContainsNull = false)))
540+
widenTestWithStringPromotion(
541+
MapType(DecimalType(36, 0), StringType, valueContainsNull = false),
542+
MapType(DecimalType(36, 35), StringType, valueContainsNull = false),
531543
None)
532544

533545
// StructType
@@ -555,7 +567,11 @@ class TypeCoercionSuite extends AnalysisTest {
555567
widenTestWithStringPromotion(
556568
new StructType().add("num", IntegerType, nullable = false),
557569
new StructType().add("num", DecimalType.IntDecimal, nullable = false),
558-
Some(new StructType().add("num", DecimalType.IntDecimal, nullable = true)))
570+
Some(new StructType().add("num", DecimalType.IntDecimal, nullable = false)))
571+
widenTestWithStringPromotion(
572+
new StructType().add("num", DecimalType(36, 0), nullable = false),
573+
new StructType().add("num", DecimalType(36, 35), nullable = false),
574+
Some(new StructType().add("num", DecimalType(38, 35), nullable = true)))
559575

560576
widenTestWithStringPromotion(
561577
new StructType().add("num", IntegerType),

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +399,35 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
399399
}
400400

401401
test("casting to fixed-precision decimals") {
402-
// Overflow and rounding for casting to fixed-precision decimals:
403-
// - Values should round with HALF_UP mode by default when you lower scale
404-
// - Values that would overflow the target precision should turn into null
405-
// - Because of this, casts to fixed-precision decimals should be nullable
406-
407-
assert(cast(123, DecimalType.USER_DEFAULT).nullable === true)
402+
assert(cast(123, DecimalType.USER_DEFAULT).nullable === false)
408403
assert(cast(10.03f, DecimalType.SYSTEM_DEFAULT).nullable === true)
409404
assert(cast(10.03, DecimalType.SYSTEM_DEFAULT).nullable === true)
410-
assert(cast(Decimal(10.03), DecimalType.SYSTEM_DEFAULT).nullable === true)
405+
assert(cast(Decimal(10.03), DecimalType.SYSTEM_DEFAULT).nullable === false)
411406

412407
assert(cast(123, DecimalType(2, 1)).nullable === true)
413408
assert(cast(10.03f, DecimalType(2, 1)).nullable === true)
414409
assert(cast(10.03, DecimalType(2, 1)).nullable === true)
415410
assert(cast(Decimal(10.03), DecimalType(2, 1)).nullable === true)
416411

412+
assert(cast(123, DecimalType.IntDecimal).nullable === false)
413+
assert(cast(10.03f, DecimalType.FloatDecimal).nullable === true)
414+
assert(cast(10.03, DecimalType.DoubleDecimal).nullable === true)
415+
assert(cast(Decimal(10.03), DecimalType(4, 2)).nullable === false)
416+
assert(cast(Decimal(10.03), DecimalType(5, 3)).nullable === false)
417+
418+
assert(cast(Decimal(10.03), DecimalType(3, 1)).nullable === true)
419+
assert(cast(Decimal(10.03), DecimalType(4, 1)).nullable === false)
420+
assert(cast(Decimal(9.95), DecimalType(2, 1)).nullable === true)
421+
assert(cast(Decimal(9.95), DecimalType(3, 1)).nullable === false)
422+
423+
assert(cast(Decimal("1003"), DecimalType(3, -1)).nullable === true)
424+
assert(cast(Decimal("1003"), DecimalType(4, -1)).nullable === false)
425+
assert(cast(Decimal("995"), DecimalType(2, -1)).nullable === true)
426+
assert(cast(Decimal("995"), DecimalType(3, -1)).nullable === false)
427+
428+
assert(cast(true, DecimalType.SYSTEM_DEFAULT).nullable === false)
429+
assert(cast(true, DecimalType(1, 1)).nullable === true)
430+
417431

418432
checkEvaluation(cast(10.03, DecimalType.SYSTEM_DEFAULT), Decimal(10.03))
419433
checkEvaluation(cast(10.03, DecimalType(4, 2)), Decimal(10.03))
@@ -451,6 +465,20 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
451465
checkEvaluation(cast(Decimal(-9.95), DecimalType(3, 1)), Decimal(-10.0))
452466
checkEvaluation(cast(Decimal(-9.95), DecimalType(1, 0)), null)
453467

468+
checkEvaluation(cast(Decimal("1003"), DecimalType.SYSTEM_DEFAULT), Decimal(1003))
469+
checkEvaluation(cast(Decimal("1003"), DecimalType(4, 0)), Decimal(1003))
470+
checkEvaluation(cast(Decimal("1003"), DecimalType(3, -1)), Decimal(1000))
471+
checkEvaluation(cast(Decimal("1003"), DecimalType(2, -2)), Decimal(1000))
472+
checkEvaluation(cast(Decimal("1003"), DecimalType(1, -2)), null)
473+
checkEvaluation(cast(Decimal("1003"), DecimalType(2, -1)), null)
474+
checkEvaluation(cast(Decimal("1003"), DecimalType(3, 0)), null)
475+
476+
checkEvaluation(cast(Decimal("995"), DecimalType(3, 0)), Decimal(995))
477+
checkEvaluation(cast(Decimal("995"), DecimalType(3, -1)), Decimal(1000))
478+
checkEvaluation(cast(Decimal("995"), DecimalType(2, -2)), Decimal(1000))
479+
checkEvaluation(cast(Decimal("995"), DecimalType(2, -1)), null)
480+
checkEvaluation(cast(Decimal("995"), DecimalType(1, -2)), null)
481+
454482
checkEvaluation(cast(Double.NaN, DecimalType.SYSTEM_DEFAULT), null)
455483
checkEvaluation(cast(1.0 / 0.0, DecimalType.SYSTEM_DEFAULT), null)
456484
checkEvaluation(cast(Float.NaN, DecimalType.SYSTEM_DEFAULT), null)
@@ -460,6 +488,9 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
460488
checkEvaluation(cast(1.0 / 0.0, DecimalType(2, 1)), null)
461489
checkEvaluation(cast(Float.NaN, DecimalType(2, 1)), null)
462490
checkEvaluation(cast(1.0f / 0.0f, DecimalType(2, 1)), null)
491+
492+
checkEvaluation(cast(true, DecimalType(2, 1)), Decimal(1))
493+
checkEvaluation(cast(true, DecimalType(1, 1)), null)
463494
}
464495

465496
test("cast from date") {

sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/concat.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ SELECT
148148
(tinyint_array1 || smallint_array2) ts_array,
149149
(smallint_array1 || int_array2) si_array,
150150
(int_array1 || bigint_array2) ib_array,
151+
(bigint_array1 || decimal_array2) bd_array,
152+
(decimal_array1 || double_array2) dd_array,
151153
(double_array1 || float_array2) df_array,
152154
(string_array1 || data_array2) std_array,
153155
(timestamp_array1 || string_array2) tst_array,

sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/mapZipWith.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ FROM various_maps;
4747
SELECT map_zip_with(decimal_map1, decimal_map2, (k, v1, v2) -> struct(k, v1, v2)) m
4848
FROM various_maps;
4949

50+
SELECT map_zip_with(decimal_map1, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
51+
FROM various_maps;
52+
53+
SELECT map_zip_with(decimal_map1, double_map, (k, v1, v2) -> struct(k, v1, v2)) m
54+
FROM various_maps;
55+
56+
SELECT map_zip_with(decimal_map2, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
57+
FROM various_maps;
58+
59+
SELECT map_zip_with(decimal_map2, double_map, (k, v1, v2) -> struct(k, v1, v2)) m
60+
FROM various_maps;
61+
5062
SELECT map_zip_with(string_map1, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
5163
FROM various_maps;
5264

sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/mapconcat.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ SELECT
6161
map_concat(tinyint_map1, smallint_map2) ts_map,
6262
map_concat(smallint_map1, int_map2) si_map,
6363
map_concat(int_map1, bigint_map2) ib_map,
64+
map_concat(bigint_map1, decimal_map2) bd_map,
6465
map_concat(decimal_map1, float_map2) df_map,
6566
map_concat(string_map1, date_map2) std_map,
6667
map_concat(timestamp_map1, string_map2) tst_map,

sql/core/src/test/resources/sql-tests/results/typeCoercion/native/concat.sql.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,14 @@ SELECT
306306
(tinyint_array1 || smallint_array2) ts_array,
307307
(smallint_array1 || int_array2) si_array,
308308
(int_array1 || bigint_array2) ib_array,
309+
(bigint_array1 || decimal_array2) bd_array,
310+
(decimal_array1 || double_array2) dd_array,
309311
(double_array1 || float_array2) df_array,
310312
(string_array1 || data_array2) std_array,
311313
(timestamp_array1 || string_array2) tst_array,
312314
(string_array1 || int_array2) sti_array
313315
FROM various_arrays
314316
-- !query 13 schema
315-
struct<ts_array:array<smallint>,si_array:array<int>,ib_array:array<bigint>,df_array:array<double>,std_array:array<string>,tst_array:array<string>,sti_array:array<string>>
317+
struct<ts_array:array<smallint>,si_array:array<int>,ib_array:array<bigint>,bd_array:array<decimal(20,0)>,dd_array:array<double>,df_array:array<double>,std_array:array<string>,tst_array:array<string>,sti_array:array<string>>
316318
-- !query 13 output
317-
[2,1,3,4] [2,1,3,4] [2,1,3,4] [2.0,1.0,3.0,4.0] ["a","b","2016-03-12","2016-03-11"] ["2016-11-15 20:54:00","2016-11-12 20:54:00","c","d"] ["a","b","3","4"]
319+
[2,1,3,4] [2,1,3,4] [2,1,3,4] [2,1,9223372036854775808,9223372036854775809] [9.223372036854776E18,9.223372036854776E18,3.0,4.0] [2.0,1.0,3.0,4.0] ["a","b","2016-03-12","2016-03-11"] ["2016-11-15 20:54:00","2016-11-12 20:54:00","c","d"] ["a","b","3","4"]

sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapZipWith.sql.out

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Automatically generated by SQLQueryTestSuite
2-
-- Number of queries: 12
2+
-- Number of queries: 16
33

44

55
-- !query 0
@@ -89,54 +89,91 @@ cannot resolve 'map_zip_with(various_maps.`decimal_map1`, various_maps.`decimal_
8989

9090

9191
-- !query 6
92-
SELECT map_zip_with(string_map1, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
92+
SELECT map_zip_with(decimal_map1, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
9393
FROM various_maps
9494
-- !query 6 schema
95-
struct<m:map<string,struct<k:string,v1:string,v2:int>>>
95+
struct<m:map<decimal(36,0),struct<k:decimal(36,0),v1:decimal(36,0),v2:int>>>
9696
-- !query 6 output
97-
{"2":{"k":"2","v1":"1","v2":1},"true":{"k":"true","v1":"false","v2":null}}
97+
{2:{"k":2,"v1":null,"v2":1},922337203685477897945456575809789456:{"k":922337203685477897945456575809789456,"v1":922337203685477897945456575809789456,"v2":null}}
9898

9999

100100
-- !query 7
101-
SELECT map_zip_with(string_map2, date_map, (k, v1, v2) -> struct(k, v1, v2)) m
101+
SELECT map_zip_with(decimal_map1, double_map, (k, v1, v2) -> struct(k, v1, v2)) m
102102
FROM various_maps
103103
-- !query 7 schema
104-
struct<m:map<string,struct<k:string,v1:string,v2:date>>>
104+
struct<m:map<double,struct<k:double,v1:decimal(36,0),v2:double>>>
105105
-- !query 7 output
106-
{"2016-03-14":{"k":"2016-03-14","v1":"2016-03-13","v2":2016-03-13}}
106+
{2.0:{"k":2.0,"v1":null,"v2":1.0},9.223372036854779E35:{"k":9.223372036854779E35,"v1":922337203685477897945456575809789456,"v2":null}}
107107

108108

109109
-- !query 8
110-
SELECT map_zip_with(timestamp_map, string_map3, (k, v1, v2) -> struct(k, v1, v2)) m
110+
SELECT map_zip_with(decimal_map2, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
111111
FROM various_maps
112112
-- !query 8 schema
113-
struct<m:map<string,struct<k:string,v1:timestamp,v2:string>>>
113+
struct<>
114114
-- !query 8 output
115-
{"2016-11-15 20:54:00":{"k":"2016-11-15 20:54:00","v1":2016-11-12 20:54:00.0,"v2":null},"2016-11-15 20:54:00.000":{"k":"2016-11-15 20:54:00.000","v1":null,"v2":"2016-11-12 20:54:00.000"}}
115+
org.apache.spark.sql.AnalysisException
116+
cannot resolve 'map_zip_with(various_maps.`decimal_map2`, various_maps.`int_map`, lambdafunction(named_struct(NamePlaceholder(), `k`, NamePlaceholder(), `v1`, NamePlaceholder(), `v2`), `k`, `v1`, `v2`))' due to argument data type mismatch: The input to function map_zip_with should have been two maps with compatible key types, but the key types are [decimal(36,35), int].; line 1 pos 7
116117

117118

118119
-- !query 9
119-
SELECT map_zip_with(decimal_map1, string_map4, (k, v1, v2) -> struct(k, v1, v2)) m
120+
SELECT map_zip_with(decimal_map2, double_map, (k, v1, v2) -> struct(k, v1, v2)) m
120121
FROM various_maps
121122
-- !query 9 schema
122-
struct<m:map<string,struct<k:string,v1:decimal(36,0),v2:string>>>
123+
struct<m:map<double,struct<k:double,v1:decimal(36,35),v2:double>>>
123124
-- !query 9 output
124-
{"922337203685477897945456575809789456":{"k":"922337203685477897945456575809789456","v1":922337203685477897945456575809789456,"v2":"text"}}
125+
{2.0:{"k":2.0,"v1":null,"v2":1.0},9.223372036854778:{"k":9.223372036854778,"v1":9.22337203685477897945456575809789456,"v2":null}}
125126

126127

127128
-- !query 10
128-
SELECT map_zip_with(array_map1, array_map2, (k, v1, v2) -> struct(k, v1, v2)) m
129+
SELECT map_zip_with(string_map1, int_map, (k, v1, v2) -> struct(k, v1, v2)) m
129130
FROM various_maps
130131
-- !query 10 schema
131-
struct<m:map<array<bigint>,struct<k:array<bigint>,v1:array<bigint>,v2:array<int>>>>
132+
struct<m:map<string,struct<k:string,v1:string,v2:int>>>
132133
-- !query 10 output
133-
{[1,2]:{"k":[1,2],"v1":[1,2],"v2":[1,2]}}
134+
{"2":{"k":"2","v1":"1","v2":1},"true":{"k":"true","v1":"false","v2":null}}
134135

135136

136137
-- !query 11
137-
SELECT map_zip_with(struct_map1, struct_map2, (k, v1, v2) -> struct(k, v1, v2)) m
138+
SELECT map_zip_with(string_map2, date_map, (k, v1, v2) -> struct(k, v1, v2)) m
138139
FROM various_maps
139140
-- !query 11 schema
140-
struct<m:map<struct<col1:int,col2:bigint>,struct<k:struct<col1:int,col2:bigint>,v1:struct<col1:smallint,col2:bigint>,v2:struct<col1:int,col2:int>>>>
141+
struct<m:map<string,struct<k:string,v1:string,v2:date>>>
141142
-- !query 11 output
143+
{"2016-03-14":{"k":"2016-03-14","v1":"2016-03-13","v2":2016-03-13}}
144+
145+
146+
-- !query 12
147+
SELECT map_zip_with(timestamp_map, string_map3, (k, v1, v2) -> struct(k, v1, v2)) m
148+
FROM various_maps
149+
-- !query 12 schema
150+
struct<m:map<string,struct<k:string,v1:timestamp,v2:string>>>
151+
-- !query 12 output
152+
{"2016-11-15 20:54:00":{"k":"2016-11-15 20:54:00","v1":2016-11-12 20:54:00.0,"v2":null},"2016-11-15 20:54:00.000":{"k":"2016-11-15 20:54:00.000","v1":null,"v2":"2016-11-12 20:54:00.000"}}
153+
154+
155+
-- !query 13
156+
SELECT map_zip_with(decimal_map1, string_map4, (k, v1, v2) -> struct(k, v1, v2)) m
157+
FROM various_maps
158+
-- !query 13 schema
159+
struct<m:map<string,struct<k:string,v1:decimal(36,0),v2:string>>>
160+
-- !query 13 output
161+
{"922337203685477897945456575809789456":{"k":"922337203685477897945456575809789456","v1":922337203685477897945456575809789456,"v2":"text"}}
162+
163+
164+
-- !query 14
165+
SELECT map_zip_with(array_map1, array_map2, (k, v1, v2) -> struct(k, v1, v2)) m
166+
FROM various_maps
167+
-- !query 14 schema
168+
struct<m:map<array<bigint>,struct<k:array<bigint>,v1:array<bigint>,v2:array<int>>>>
169+
-- !query 14 output
170+
{[1,2]:{"k":[1,2],"v1":[1,2],"v2":[1,2]}}
171+
172+
173+
-- !query 15
174+
SELECT map_zip_with(struct_map1, struct_map2, (k, v1, v2) -> struct(k, v1, v2)) m
175+
FROM various_maps
176+
-- !query 15 schema
177+
struct<m:map<struct<col1:int,col2:bigint>,struct<k:struct<col1:int,col2:bigint>,v1:struct<col1:smallint,col2:bigint>,v2:struct<col1:int,col2:int>>>>
178+
-- !query 15 output
142179
{{"col1":1,"col2":2}:{"k":{"col1":1,"col2":2},"v1":{"col1":1,"col2":2},"v2":{"col1":1,"col2":2}}}

sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapconcat.sql.out

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ SELECT
7676
map_concat(tinyint_map1, smallint_map2) ts_map,
7777
map_concat(smallint_map1, int_map2) si_map,
7878
map_concat(int_map1, bigint_map2) ib_map,
79+
map_concat(bigint_map1, decimal_map2) bd_map,
7980
map_concat(decimal_map1, float_map2) df_map,
8081
map_concat(string_map1, date_map2) std_map,
8182
map_concat(timestamp_map1, string_map2) tst_map,
8283
map_concat(string_map1, int_map2) sti_map,
8384
map_concat(int_string_map1, tinyint_map2) istt_map
8485
FROM various_maps
8586
-- !query 2 schema
86-
struct<ts_map:map<smallint,smallint>,si_map:map<int,int>,ib_map:map<bigint,bigint>,df_map:map<double,double>,std_map:map<string,string>,tst_map:map<string,string>,sti_map:map<string,string>,istt_map:map<int,string>>
87+
struct<ts_map:map<smallint,smallint>,si_map:map<int,int>,ib_map:map<bigint,bigint>,bd_map:map<decimal(20,0),decimal(20,0)>,df_map:map<double,double>,std_map:map<string,string>,tst_map:map<string,string>,sti_map:map<string,string>,istt_map:map<int,string>>
8788
-- !query 2 output
88-
{1:2,3:4} {1:2,7:8} {4:6,8:9} {3.0:4.0,9.223372036854776E18:9.223372036854776E18} {"2016-03-12":"2016-03-11","a":"b"} {"2016-11-15 20:54:00":"2016-11-12 20:54:00","c":"d"} {"7":"8","a":"b"} {1:"a",3:"4"}
89+
{1:2,3:4} {1:2,7:8} {4:6,8:9} {6:7,9223372036854775808:9223372036854775809} {3.0:4.0,9.223372036854776E18:9.223372036854776E18} {"2016-03-12":"2016-03-11","a":"b"} {"2016-11-15 20:54:00":"2016-11-12 20:54:00","c":"d"} {"7":"8","a":"b"} {1:"a",3:"4"}
8990

9091

9192
-- !query 3

0 commit comments

Comments
 (0)