Github user yijieshen commented on a diff in the pull request:
https://github.com/apache/spark/pull/6938#discussion_r33115774
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathFunctionsSuite.scala
---
@@ -252,4 +254,33 @@ class MathFunctionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
null,
create_row(null))
}
+
+ test("round test") {
+ val domain = -16 to 16
+ val doublePi = math.Pi
+ val stringPi = "3.141592653589793"
+ val intPi = 314159265
+ val bdPi = BigDecimal(31415926535897932L, 10)
+
+ domain.foreach { scale =>
+ checkEvaluation(Round(doublePi, scale),
+ BigDecimal.valueOf(doublePi).setScale(scale,
RoundingMode.HALF_UP).toDouble, EmptyRow)
--- End diff --
I think we are not comparing with itself, rather, checking the `Round` to
see if it is branching to the right logic and run as expected.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]