You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/01/05 12:38:00 UTC
[jira] [Updated] (FLINK-15478) FROM_BASE64 code gen type wrong
[ https://issues.apache.org/jira/browse/FLINK-15478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated FLINK-15478:
-----------------------------------
Labels: pull-request-available (was: )
> FROM_BASE64 code gen type wrong
> -------------------------------
>
> Key: FLINK-15478
> URL: https://issues.apache.org/jira/browse/FLINK-15478
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 1.9.1, 1.10.0
> Reporter: Benchao Li
> Priority: Major
> Labels: pull-request-available
>
> `FROM_BASE64` should return *String* instead of *byte[]*
> If ** we use FROM_BASE64 in sql, will result in a exception:
>
> {code:java}
> org.apache.flink.table.planner.codegen.CodeGenException: Incompatible types of expression and result type. Expression[GeneratedExpression(result$2,isNull$1,isNull$1 = false;
> result$2 = null;
> if (!isNull$1) {
>
> result$2 = org.apache.flink.table.runtime.functions.SqlFunctionUtils.fromBase64(((org.apache.flink.table.dataformat.BinaryString) str$0));
> isNull$1 = (result$2 == null);
> }
> ,BYTES,None)] type is [BYTES], result type is [STRING NOT NULL]
> {code}
>
> Why ScalarFunctionsTest.testFromBase64 passed?
> Because we assume the result should be string in ExpressionTestBase, then add a cast operator to the result of FROM_BASE64.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)