Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-36888

Sha2 with bit_length 512 not being tested

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • SQL
    • None

    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
       

      Attachments

        Activity

          People

            richardc-db Richard Chen
            h-vetinari H. Vetinari
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: