From 29067bbe845d58d5e3eb7f994057bc907b2a955f Mon Sep 17 00:00:00 2001 From: KAZUYUKI TANIMURA Date: Thu, 25 Apr 2024 11:11:49 -0700 Subject: [PATCH] test: Suppress decimal random number tests for 3.2 and 3.3 (#319) --- .../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 ce9a7cd950..376baa378a 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")