From b9bac89223fd94ac3f06bf3e114e6241e691de94 Mon Sep 17 00:00:00 2001 From: Kazuyuki Tanimura Date: Wed, 24 Apr 2024 13:54:21 -0700 Subject: [PATCH] test: Suppress decimal random number tests for 3.2 and 3.3 --- .../test/scala/org/apache/comet/CometExpressionSuite.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala index ce9a7cd95..376baa378 100644 --- a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala +++ b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala @@ -1290,6 +1290,7 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { } test("Decimal random number tests") { + assume(isSpark34Plus) // Only Spark 3.4+ has the fix for SPARK-45786 val rand = scala.util.Random def makeNum(p: Int, s: Int): String = { val int1 = rand.nextLong() @@ -1316,11 +1317,7 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { "spark.sql.decimalOperations.allowPrecisionLoss" -> allowPrecisionLoss.toString) { val a = makeNum(p1, s1) val b = makeNum(p2, s2) - var ops = Seq("+", "-") - if (isSpark34Plus) { - // These operations are only supported in Spark 3.4+ - ops = ops ++ Seq("*", "/", "%") - } + var ops = Seq("+", "-", "*", "/", "%") for (op <- ops) { checkSparkAnswerAndOperator(s"select a, b, a $op b from $table") checkSparkAnswerAndOperator(s"select $a, b, $a $op b from $table")