diff --git a/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala b/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala index a0ea7d7267b4..c2a3d82e05e3 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala @@ -2078,4 +2078,12 @@ class TestOperator extends VeloxWholeStageTransformerSuite with AdaptiveSparkPla checkGlutenOperatorMatch[SortExecTransformer] } } + + // Enable the test after fixing https://github.com/apache/incubator-gluten/issues/6827 + ignore("Test round expression") { + val df1 = runQueryAndCompare("SELECT round(cast(0.5549999999999999 as double), 2)") { _ => } + checkLengthAndPlan(df1, 1) + val df2 = runQueryAndCompare("SELECT round(cast(0.19324999999999998 as double), 2)") { _ => } + checkLengthAndPlan(df2, 1) + } } diff --git a/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala b/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala index 765a64f91baf..5e58fcb621df 100644 --- a/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala +++ b/gluten-ut/spark32/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala @@ -124,6 +124,8 @@ class GlutenMathExpressionsSuite extends MathExpressionsSuite with GlutenTestsTr checkEvaluation(Round(1.12345678901234567, 8), 1.12345679) checkEvaluation(Round(-0.98765432109876543, 5), -0.98765) checkEvaluation(Round(12345.67890123456789, 6), 12345.678901) + // Enable the test after fixing https://github.com/apache/incubator-gluten/issues/6827 + // checkEvaluation(Round(0.5549999999999999, 2), 0.55) checkEvaluation(BRound(2.5, 0), 2.0) checkEvaluation(BRound(3.5, 0), 4.0) checkEvaluation(BRound(-2.5, 0), -2.0) diff --git a/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala b/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala index 122f8dc066af..7085b70ae38c 100644 --- a/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala +++ b/gluten-ut/spark33/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala @@ -252,6 +252,8 @@ class GlutenMathExpressionsSuite extends MathExpressionsSuite with GlutenTestsTr checkEvaluation(Round(1.12345678901234567, 8), 1.12345679) checkEvaluation(Round(-0.98765432109876543, 5), -0.98765) checkEvaluation(Round(12345.67890123456789, 6), 12345.678901) + // Enable the test after fixing https://github.com/apache/incubator-gluten/issues/6827 + // checkEvaluation(Round(0.5549999999999999, 2), 0.55) checkEvaluation(Round(-35, -1), -40) checkEvaluation(Round(BigDecimal("45.00"), -1), BigDecimal(50)) checkEvaluation(BRound(2.5, 0), 2.0) diff --git a/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala b/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala index e220924880c7..96c53306bde0 100644 --- a/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala +++ b/gluten-ut/spark34/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala @@ -248,6 +248,8 @@ class GlutenMathExpressionsSuite extends MathExpressionsSuite with GlutenTestsTr checkEvaluation(BRound(-3.5, 0), -4.0) checkEvaluation(BRound(-0.35, 1), -0.4) checkEvaluation(BRound(-35, -1), -40) + // Enable the test after fixing https://github.com/apache/incubator-gluten/issues/6827 + // checkEvaluation(Round(0.5549999999999999, 2), 0.55) checkEvaluation(BRound(BigDecimal("45.00"), -1), BigDecimal(40)) checkEvaluation(checkDataTypeAndCast(RoundFloor(Literal(2.5), Literal(0))), Decimal(2)) checkEvaluation(checkDataTypeAndCast(RoundFloor(Literal(3.5), Literal(0))), Decimal(3)) diff --git a/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala b/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala index 7308352e40c6..5196e760fcd0 100644 --- a/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala +++ b/gluten-ut/spark35/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenMathExpressionsSuite.scala @@ -251,6 +251,8 @@ class GlutenMathExpressionsSuite extends MathExpressionsSuite with GlutenTestsTr checkEvaluation(Round(1.12345678901234567, 8), 1.12345679) checkEvaluation(Round(-0.98765432109876543, 5), -0.98765) checkEvaluation(Round(12345.67890123456789, 6), 12345.678901) + // Enable the test after fixing https://github.com/apache/incubator-gluten/issues/6827 + // checkEvaluation(Round(0.5549999999999999, 2), 0.55) checkEvaluation(BRound(BigDecimal("45.00"), -1), BigDecimal(40)) checkEvaluation(checkDataTypeAndCast(RoundFloor(Literal(2.5), Literal(0))), Decimal(2)) checkEvaluation(checkDataTypeAndCast(RoundFloor(Literal(3.5), Literal(0))), Decimal(3))