planga82 commented on a change in pull request #32496:
URL: https://github.com/apache/spark/pull/32496#discussion_r632047996
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/HashExpressionsSuite.scala
##########
@@ -708,6 +708,16 @@ class HashExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
checkEvaluation(HiveHash(Seq(yearMonth)), 1234)
}
+ test("SPARK-35207: Compute hash consistent between -0.0 and 0.0") {
+ def checkResult(exprs1: Expression, exprs2: Expression): Unit = {
+ assert(Murmur3Hash(Seq(exprs1), 42).eval() == Murmur3Hash(Seq(exprs2),
42).eval())
+ assert(XxHash64(Seq(exprs1), 42).eval() == XxHash64(Seq(exprs2),
42).eval())
+ assert(HiveHash(Seq(exprs1)).eval() == HiveHash(Seq(exprs2)).eval())
+ }
+ checkResult(Literal.create(0D, DoubleType), Literal.create(-0D,
DoubleType))
Review comment:
Oh! thanks, I pretend to put float instead long
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]