You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/01/05 13:17:00 UTC

[jira] [Assigned] (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 ]

Jark Wu reassigned FLINK-15478:
-------------------------------

    Assignee: Benchao Li

> 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
>            Assignee: Benchao Li
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> `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)