Hequn Cheng created FLINK-12217: ----------------------------------- Summary: OperationTreeBuilder.map() should perform ExpressionResolver.resolve() Key: FLINK-12217 URL: https://issues.apache.org/jira/browse/FLINK-12217 Project: Flink Issue Type: Bug Components: Table SQL / API Reporter: Hequn Cheng Assignee: Hequn Cheng
In {{OperationTreeBuilder.map()}}, we should resolve all LookupCallExpression for the case of java, otherwise, exceptions will be thrown. The following test case can reproduce the problem. {code:java} @Test def testMap(): Unit = { val util = streamTestUtil() val t = util.addTable[(Int, Long, String)]("Table3",'a, 'b, 'c) util.tableEnv.registerFunction("func", Func23) val t1 = t.map("func(a, b, c)") val t2 = t.map(Func23('a, 'b, 'c)) verifyTableEquals(t1, t2) } {code} {code:java} org.apache.flink.table.api.ValidationException: Only ScalarFunction can be used in the map operator. at org.apache.flink.table.operations.OperationTreeBuilder.map(OperationTreeBuilder.scala:355) at org.apache.flink.table.api.TableImpl.map(tableImpl.scala:461) at org.apache.flink.table.api.TableImpl.map(tableImpl.scala:457) at org.apache.flink.table.api.stream.table.stringexpr.CalcStringExpressionTest.testMap(CalcStringExpressionTest.scala:178) {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)