srowen commented on a change in pull request #27354: [SPARK-30633][SQL] Append 
L to seed when type is LongType
URL: https://github.com/apache/spark/pull/27354#discussion_r371006331
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/hash.scala
 ##########
 @@ -282,6 +282,7 @@ abstract class HashExpression[E] extends Expression {
     }
 
     val hashResultType = CodeGenerator.javaType(dataType)
+    val typedSeed = if (dataType.sameType(LongType)) s"${seed}L" else s"$seed"
 
 Review comment:
   Yeah I think the concern was something like: a 4-byte int seed isn't the 
same as an 8-byte long seed when it comes to hashing, even if they have the 
same integer value. But here, this should only affect `HashExpression[Long]`s 
like `XxHash64`, which already would have promoted any int seed value to long 
in generated code.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to