[ https://issues.apache.org/jira/browse/SPARK-43802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726764#comment-17726764 ]
Dongjoon Hyun commented on SPARK-43802: --------------------------------------- This is backported to branch-3.4 via https://github.com/apache/spark/pull/41334 > 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