[
https://issues.apache.org/jira/browse/FLINK-10973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698383#comment-16698383
]
ASF GitHub Bot commented on FLINK-10973:
----------------------------------------
hequn8128 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_r236103235
##########
File path: docs/dev/table/tableApi.md
##########
@@ -1682,6 +1682,34 @@ The `OverWindow` defines a range of rows over which
aggregates are computed. `Ov
{% top %}
+### Map
+
+Map performs a map operation with an user-defined function. The output will be
flattened
+if the output type is composite type.
+
+<div class="codetabs" markdown="1">
+<div data-lang="java" markdown="1">
+{% highlight java %}
+ScalarFunction func = new MyMapFunction();
+tableEnv.registerFunction("func", func);
+
+Table table = input
+ .map(func("c")).as("a, b")
+{% endhighlight %}
+</div>
+
+<div data-lang="scala" markdown="1">
+{% highlight scala %}
+val func = new MyMapFunction()
Review comment:
val func = new MyMapFunction() => val func: ScalarFunction = new
MyMapFunction() ?
To tell user that func is a `ScalarFunction`.
----------------------------------------------------------------
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:
[email protected]
> 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)