Skip to content

Commit ee2a87b

Browse files
HyukjinKwondongjoon-hyun
authored andcommitted
[SPARK-40876][SQL][TESTS][FOLLOW-UP] Remove invalid decimal test case when ANSI mode is on
### What changes were proposed in this pull request? This PR is a followup of apache#44513 that excludes `Decimal(5, 4)` for `10.34` that cannot be represented with ANSI mode on. ### Why are the changes needed? ANSI build is broken (https://github.com/apache/spark/actions/runs/7455394893/job/20284415710): ``` org.apache.spark.SparkArithmeticException: [NUMERIC_VALUE_OUT_OF_RANGE] 10.34 cannot be represented as Decimal(5, 4). If necessary set "spark.sql.ansi.enabled" to "false" to bypass this error, and return NULL instead. SQLSTATE: 22003 == DataFrame == "cast" was called from org.apache.spark.sql.execution.datasources.parquet.ParquetTypeWideningSuite.writeParquetFiles(ParquetTypeWideningSuite.scala:113) at org.apache.spark.sql.errors.QueryExecutionErrors$.cannotChangeDecimalPrecisionError(QueryExecutionErrors.scala:116) at org.apache.spark.sql.errors.QueryExecutionErrors.cannotChangeDecimalPrecisionError(QueryExecutionErrors.scala) at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(Unknown Source) ``` ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test cases should cover. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#44632 from HyukjinKwon/SPARK-40876-followup. Lead-authored-by: Hyukjin Kwon <[email protected]> Co-authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent f4c8dd6 commit ee2a87b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetTypeWideningSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ class ParquetTypeWideningSuite
226226
Seq((7, 4) -> (5, 2), (10, 7) -> (5, 2), (20, 17) -> (5, 2), (12, 4) -> (10, 2),
227227
(20, 17) -> (10, 2), (22, 4) -> (20, 2)) ++
228228
// Increasing precision and decreasing scale.
229-
Seq((5, 4) -> (7, 2), (10, 6) -> (12, 4), (20, 7) -> (22, 5)) ++
229+
Seq((10, 6) -> (12, 4), (20, 7) -> (22, 5)) ++
230230
// Decreasing precision and increasing scale.
231-
Seq((7, 2) -> (5, 4), (12, 4) -> (10, 6), (22, 5) -> (20, 7)) ++
231+
Seq((12, 4) -> (10, 6), (22, 5) -> (20, 7)) ++
232232
// Increasing precision by a smaller amount than scale.
233233
Seq((5, 2) -> (6, 4), (10, 4) -> (12, 7), (20, 5) -> (22, 8))
234234
}

0 commit comments

Comments
 (0)