You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/08/17 06:15:59 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #29448: [SPARK-32018][SQL][3.0][FOLLOWUP] Fix a test failure in DataFrameSuite
cloud-fan commented on a change in pull request #29448:
URL: https://github.com/apache/spark/pull/29448#discussion_r471252206
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -192,23 +192,19 @@ class DataFrameSuite extends QueryTest
structDf.select(xxhash64($"a", $"record.*")))
}
- test("SPARK-28224: Aggregate sum big decimal overflow") {
+ test("SPARK-28224,SPARK-32018: Aggregate sum big decimal overflow") {
val largeDecimals = spark.sparkContext.parallelize(
DecimalData(BigDecimal("1"* 20 + ".123"), BigDecimal("1"* 20 + ".123")) ::
DecimalData(BigDecimal("9"* 20 + ".123"), BigDecimal("9"* 20 + ".123")) :: Nil).toDF()
Seq(true, false).foreach { ansiEnabled =>
withSQLConf((SQLConf.ANSI_ENABLED.key, ansiEnabled.toString)) {
val structDf = largeDecimals.select("a").agg(sum("a"))
- if (!ansiEnabled) {
- checkAnswer(structDf, Row(null))
- } else {
- val e = intercept[SparkException] {
- structDf.collect
- }
- assert(e.getCause.getClass.equals(classOf[ArithmeticException]))
- assert(e.getCause.getMessage.contains("cannot be represented as Decimal"))
+ val e = intercept[SparkException] {
+ structDf.collect
Review comment:
Can we add a comment to say that we have to fail overflow with non-ansi mode as well, and link the related JIRA tickets?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org