You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "H. Vetinari (Jira)" <ji...@apache.org> on 2021/09/29 04:39:00 UTC

[jira] [Created] (SPARK-36888) Sha2 with bit_length 512 not being tested

H. Vetinari created SPARK-36888:
-----------------------------------

             Summary: Sha2 with bit_length 512 not being tested
                 Key: SPARK-36888
                 URL: https://issues.apache.org/jira/browse/SPARK-36888
             Project: Spark
          Issue Type: Task
          Components: SQL
    Affects Versions: 3.2.0
            Reporter: H. Vetinari


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) => }}{{{}}
 {{  }}{{s"""}}
 {{    }}{{[...]}}
 {{    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]
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org