[
https://issues.apache.org/jira/browse/FLINK-5794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15890685#comment-15890685
]
ASF GitHub Bot commented on FLINK-5794:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3450#discussion_r103747440
--- Diff: docs/dev/table_api.md ---
@@ -4819,7 +4826,7 @@ object TimestampModifier extends ScalarFunction {
Similar to a user-defined scalar function, a user-defined table function
takes zero, one, or multiple scalar values as input parameters. However in
contrast to a scalar function, it can return an arbitrary number of rows as
output instead of a single value. The returned rows may consist of one or more
columns.
-In order to define a table function one has to extend the base class
`TableFunction` in `org.apache.flink.table.functions` and implement (one or
more) evaluation methods. The behavior of a table function is determined by its
evaluation methods. An evaluation method must be declared `public` and named
`eval`. The `TableFunction` can be overloaded by implementing multiple methods
named `eval`. The parameter types of the evaluation methods determine all valid
parameters of the table function. The type of the returned table is determined
by the generic type of `TableFunction`. Evaluation methods emit output rows
using the protected `collect(T)` method.
+In order to define a table function one has to extend the base class
`TableFunction` in `org.apache.flink.table.functions` and implement (one or
more) evaluation methods. Moreover constructor of the user-defined table
function can contain constructor arguments. The behavior of a table function is
determined by its evaluation methods. An evaluation method must be declared
`public` and named `eval`. The `TableFunction` can be overloaded by
implementing multiple methods named `eval`. The parameter types of the
evaluation methods determine all valid parameters of the table function. The
type of the returned table is determined by the generic type of
`TableFunction`. Evaluation methods emit output rows using the protected
`collect(T)` method.
In the Table API, a table function is used with `.join(Expression)` or
`.leftOuterJoin(Expression)` for Scala users and `.join(String)` or
`.leftOuterJoin(String)` for Java users. The `join` operator (cross) joins each
row from the outer table (table on the left of the operator) with all rows
produced by the table-valued function (which is on the right side of the
operator). The `leftOuterJoin` operator joins each row from the outer table
(table on the left of the operator) with all rows produced by the table-valued
function (which is on the right side of the operator) and preserves outer rows
for which the table function returns an empty table. In SQL use `LATERAL
TABLE(<TableFunction>)` with CROSS JOIN and LEFT JOIN with an ON TRUE join
condition (see examples below).
--- End diff --
Change to:
> The following example shows how to define table-valued function, register
it in the `TableEnvironment`, and call it in a query. Note that you can
configure your table function via a constructor before it is registered.
> update the documentation about “UDF/UDTF" support have parameters
> constructor.
> --------------------------------------------------------------------------------
>
> Key: FLINK-5794
> URL: https://issues.apache.org/jira/browse/FLINK-5794
> Project: Flink
> Issue Type: Sub-task
> Reporter: sunjincheng
> Assignee: sunjincheng
>
> Depends on FLINK-5792 .
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)