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_r371006421
########## File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/HashExpressionsSuite.scala ########## @@ -684,6 +684,21 @@ class HashExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { assert(murmur3HashPlan(wideRow).getInt(0) == murmursHashEval) } + test("SPARK-30633: Use Long seeds for xxHash") { + val literal = Literal.create(42L, LongType) + val seeds = Seq( + Long.MinValue, + Integer.MIN_VALUE.toLong - 1L, + 0L, + Integer.MAX_VALUE.toLong + 1L, + Long.MaxValue + ) + + for (seed <- seeds) { + checkEvaluation(XxHash64(Seq(literal), seed), XxHash64(Seq(literal), seed).eval()) Review comment: Like do you get the same result with seed 100 vs 100L? You should, as "100" was already promoted to long in the generated code. Meh, if it's simple, might be worth a line to test, but shouldn't be a difference. ---------------------------------------------------------------- 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