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

unbase64 and unhex codegen are invalid with failOnError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.1, 3.5.0
    • SQL
    • None

    Description

      to_binary with hex and base64 generate invalid codegen:

      spark.range(5).selectExpr('to_binary(base64(cast(id as binary)), "BASE64")').show()

      results in

      Caused by: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 47, Column 1: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 47, Column 1: Unknown variable or type "BASE64"

      because this is the generated code:

      /* 107 */         if (!org.apache.spark.sql.catalyst.expressions.UnBase64.isValidBase64(project_value_1))

      { /* 108 */           throw QueryExecutionErrors.invalidInputInConversionError( /* 109 */             ((org.apache.spark.sql.types.BinaryType$) references[1] /* to */), /* 110 */             project_value_1, /* 111 */             BASE64, /* 112 */             "try_to_binary"); /* 113 */         }

      Attachments

        Activity

          People

            kimahriman Adam Binford
            kimahriman Adam Binford
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: