File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
sql/hive/src/test/scala/org/apache/spark/sql/hive Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments