This is an automated email from the ASF dual-hosted git repository.
twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new d3f0075 [FLINK-11119][docs] Correct Scala example for Table Function
in User-defined Functions docs.
d3f0075 is described below
commit d3f0075b041c8fd681a776b3278d12c4483a48ac
Author: wenhuitang <[email protected]>
AuthorDate: Sat Dec 29 18:50:31 2018 +0800
[FLINK-11119][docs] Correct Scala example for Table Function in
User-defined Functions docs.
This closes #7379.
---
docs/dev/table/udfs.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/dev/table/udfs.md b/docs/dev/table/udfs.md
index 44b8d43..d93b5c8 100644
--- a/docs/dev/table/udfs.md
+++ b/docs/dev/table/udfs.md
@@ -190,7 +190,7 @@ tableEnv.sqlQuery("SELECT a, word, length FROM MyTable LEFT
JOIN LATERAL TABLE(s
class Split(separator: String) extends TableFunction[(String, Int)] {
def eval(str: String): Unit = {
// use collect(...) to emit a row.
- str.split(separator).foreach(x -> collect((x, x.length))
+ str.split(separator).foreach(x => collect((x, x.length)))
}
}
@@ -210,7 +210,7 @@ tableEnv.registerFunction("split", new Split("#"))
// CROSS JOIN a table function (equivalent to "join" in Table API)
tableEnv.sqlQuery("SELECT a, word, length FROM MyTable, LATERAL
TABLE(split(a)) as T(word, length)")
// LEFT JOIN a table function (equivalent to "leftOuterJoin" in Table API)
-tableEnv.sqlQuery("SELECT a, word, length FROM MyTable LEFT JOIN
TABLE(split(a)) as T(word, length) ON TRUE")
+tableEnv.sqlQuery("SELECT a, word, length FROM MyTable LEFT JOIN LATERAL
TABLE(split(a)) as T(word, length) ON TRUE")
{% endhighlight %}
**IMPORTANT:** Do not implement TableFunction as a Scala object. Scala object
is a singleton and will cause concurrency issues.
</div>