This is an automated email from the ASF dual-hosted git repository.
hongze pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 4f7ac3791 [VL] Add a new test case for Round's coverage (#6884)
4f7ac3791 is described below
commit 4f7ac37917cf7c5dfb4d1c97cf3542b823ba0714
Author: jiangjiangtian <[email protected]>
AuthorDate: Mon Aug 19 09:37:36 2024 +0800
[VL] Add a new test case for Round's coverage (#6884)
---
.../src/test/scala/org/apache/gluten/execution/TestOperator.scala | 8 ++++++++
.../sql/catalyst/expressions/GlutenMathExpressionsSuite.scala | 2 ++
.../sql/catalyst/expressions/GlutenMathExpressionsSuite.scala | 2 ++
.../sql/catalyst/expressions/GlutenMathExpressionsSuite.scala | 2 ++
.../sql/catalyst/expressions/GlutenMathExpressionsSuite.scala | 2 ++
5 files changed, 16 insertions(+)
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 a0ea7d726..c2a3d82e0 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 765a64f91..5e58fcb62 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 122f8dc06..7085b70ae 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 e22092488..96c53306b 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 7308352e4..5196e760f 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))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]