Skip to content

Commit

Permalink
test: Suppress decimal random number tests for 3.2 and 3.3 (apache#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuyukitanimura authored and Steve Vaughan Jr committed Apr 26, 2024
1 parent d9aaff2 commit 29067bb
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
Expand Down

0 comments on commit 29067bb

Please sign in to comment.