Description
Looking at https://github.com/apache/spark/commit/6c6291b3f6ac13b8415b87b2b741a9cd95bc6c3b for https://issues.apache.org/jira/browse/SPARK-36836, it's clear that 512 bits are supported
bitLength match {
[...]
case 512 =>
UTF8String.fromString(DigestUtils.sha512Hex(input))
resp.
nullSafeCodeGen(ctx, ev, (eval1, eval2) => {
[...]
else if ($eval2 == 512) {
${ev.value} =
UTF8String.fromString($digestUtils.sha512Hex($eval1));
but the test claims it is unsupported:
// unsupported bit length
checkEvaluation(Sha2(Literal.create(null, BinaryType), Literal(1024)), null)
checkEvaluation(Sha2(Literal.create(null, BinaryType), Literal(512)), null)
To avoid a similar fate as SPARK-36836, tests should be added.
CC richardc-db