cloud-fan commented on code in PR #51521:
URL: https://github.com/apache/spark/pull/51521#discussion_r2212799812


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/hash.scala:
##########
@@ -429,14 +434,43 @@ abstract class HashExpression[E] extends Expression {
       val numBytes = s"$input.numBytes()"
       s"$result = $hasherClassName.hashUnsafeBytes($baseObject, $baseOffset, 
$numBytes, $result);"
     } else {
-      val stringHash = ctx.freshName("stringHash")
-      s"""
-        long $stringHash = 
CollationFactory.fetchCollation(${stringType.collationId})
-          .hashFunction.applyAsLong($input);
-        $result = $hasherClassName.hashLong($stringHash, $result);
-      """
+      if (isAlwaysCollationAwareBug && !isCollationAware) {

Review Comment:
   to make the branching logic clearer, how about
   ```
   if (collationAware) {
     ...
   } else if (legacyEnabled) {
     ...
   } else {
     ...
   }
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to