[ 
https://issues.apache.org/jira/browse/SPARK-43802?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dongjoon Hyun updated SPARK-43802:
----------------------------------
    Fix Version/s: 3.4.1

> unbase64 and unhex codegen are invalid with failOnError
> -------------------------------------------------------
>
>                 Key: SPARK-43802
>                 URL: https://issues.apache.org/jira/browse/SPARK-43802
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Adam Binford
>            Assignee: Adam Binford
>            Priority: Major
>             Fix For: 3.4.1, 3.5.0
>
>
> 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 */         }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to