[ https://issues.apache.org/jira/browse/FLINK-15478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jark Wu resolved FLINK-15478. ----------------------------- Resolution: Fixed 1.11.0: f0fe3650791486a44762dc008da0d1acc22227cd 1.10.0: e99a929a9b9da7eb56fbf63fda7de386f27f4844 1.9.2: c016086df43069b1c1b10199a48597fc444804ab > 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 > Fix For: 1.9.2, 1.10.0 > > Time Spent: 20m > 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)