Skip to content

Commit 2da2b49

Browse files
committed
update
1 parent f15b7c9 commit 2da2b49

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -905,21 +905,4 @@ class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter
905905
}
906906
}
907907
}
908-
909-
test("SPARK-37196: HiveDecimal enforcePrecisionScala failed return null") {
910-
withTempDir { dir =>
911-
withSQLConf(HiveUtils.CONVERT_METASTORE_PARQUET.key -> "false") {
912-
withTable("test_precision") {
913-
val df = sql("SELECT 'dummy' AS name, 1000000000000000000010.7000000000000010 AS value")
914-
df.write.mode("Overwrite").parquet(dir.getAbsolutePath)
915-
sql(
916-
s"""
917-
|CREATE EXTERNAL TABLE test_precision(name STRING, value DECIMAL(18,6))
918-
|STORED AS PARQUET LOCATION '${dir.getAbsolutePath}'
919-
|""".stripMargin)
920-
checkAnswer(sql("SELECT * FROM test_precision"), Row("dummy", null))
921-
}
922-
}
923-
}
924-
}
925908
}

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,23 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi
26422642
}
26432643
}
26442644
}
2645+
2646+
test("SPARK-37196: HiveDecimal Precision Scale match failed should return null") {
2647+
withTempDir { dir =>
2648+
withSQLConf(HiveUtils.CONVERT_METASTORE_PARQUET.key -> "false") {
2649+
withTable("test_precision") {
2650+
val df = sql("SELECT 'dummy' AS name, 1000000000000000000010.7000000000000010 AS value")
2651+
df.write.mode("Overwrite").parquet(dir.getAbsolutePath)
2652+
sql(
2653+
s"""
2654+
|CREATE EXTERNAL TABLE test_precision(name STRING, value DECIMAL(18,6))
2655+
|STORED AS PARQUET LOCATION '${dir.getAbsolutePath}'
2656+
|""".stripMargin)
2657+
checkAnswer(sql("SELECT * FROM test_precision"), Row("dummy", null))
2658+
}
2659+
}
2660+
}
2661+
}
26452662
}
26462663

26472664
@SlowHiveTest

0 commit comments

Comments
 (0)