srowen commented on a change in pull request #34086:
URL: https://github.com/apache/spark/pull/34086#discussion_r716357417



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/hash.scala
##########
@@ -111,8 +112,10 @@ case class Sha2(left: Expression, right: Expression)
         // DigestUtils doesn't support SHA-224 now
         try {
           val md = MessageDigest.getInstance("SHA-224")
-          md.update(input)
-          UTF8String.fromBytes(md.digest())
+          val messageDigest = md.digest(input);

Review comment:
       Actually, hm, now that I look at it - looks like commons-codec (now?) 
supports SHA-224 too:
   
https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/digest/MessageDigestAlgorithms.html
   
   I wonder if we can just use that now, but also, if its implementation has 
the same issue? your test would probably help tell.




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