[ https://issues.apache.org/jira/browse/FLINK-10973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701452#comment-16701452 ]
ASF GitHub Bot commented on FLINK-10973: ---------------------------------------- sunjincheng121 commented on a change in pull request #7167: [FLINK-10973] [table] Add support for map to table API URL: https://github.com/apache/flink/pull/7167#discussion_r236950983 ########## File path: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/utils/userDefinedScalarFunctions.scala ########## @@ -330,6 +332,38 @@ object Func22 extends ScalarFunction { } } +object MapFunc1 extends ScalarFunction { + def eval(a: Integer, b: JLong, c: String): Row = { + Row.of("star", a, b, c) + } + + override def getResultType(signature: Array[Class[_]]): TypeInformation[_] = + Types.ROW(Types.STRING, Types.INT, Types.LONG, Types.STRING) +} + +object MapFunc2 extends ScalarFunction { + def eval(a: String, b: Integer, c: JLong, d: String): Row = { + Row.of(a, Integer.valueOf(b + 1), c, d) + } + + override def getResultType(signature: Array[Class[_]]): TypeInformation[_] = + Types.ROW(Types.STRING, Types.INT, Types.LONG, Types.STRING) +} + +object MapFunc3 extends ScalarFunction { Review comment: MapFunc1 -> Func23 MapFunc2 -> Func24 MapFunc3 -> Func25 Because the all of those are scalar functions, and the defined of MapFuncX also can be using in other calc test case. What do you think? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Add Map operator to Table API > ----------------------------- > > Key: FLINK-10973 > URL: https://issues.apache.org/jira/browse/FLINK-10973 > Project: Flink > Issue Type: Sub-task > Components: Table API & SQL > Reporter: sunjincheng > Assignee: Dian Fu > Priority: Major > Labels: pull-request-available > Fix For: 1.8.0 > > > Add Map operator to Table API as described in [Google > doc|https://docs.google.com/document/d/1tnpxg31EQz2-MEzSotwFzqatsB4rNLz0I-l_vPa5H4Q/edit#heading=h.q23rny2iglsr] > The usageļ¼ > {code:java} > val res = tab > .map(fun: ScalarFunction) // output has columns 'a, 'b, 'c > .select('a, 'c) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)