You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/05/13 07:30:40 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #32496: [SPARK-35207][SQL] Normalize hash function behavior with negative zero
cloud-fan commented on a change in pull request #32496:
URL: https://github.com/apache/spark/pull/32496#discussion_r631622732
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/hash.scala
##########
@@ -369,11 +369,25 @@ abstract class HashExpression[E] extends Expression {
protected def genHashBoolean(input: String, result: String): String =
genHashInt(s"$input ? 1 : 0", result)
- protected def genHashFloat(input: String, result: String): String =
- genHashInt(s"Float.floatToIntBits($input)", result)
+ protected def genHashFloat(input: String, result: String): String = {
+ s"""
+ |if(Float.floatToIntBits($input) == Float.floatToIntBits(-0.0f)) {
Review comment:
+1
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org