You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2020/04/20 14:24:55 UTC

[flink] branch release-1.10 updated: [FLINK-16763][python][docs] Replace BatchTableEnvironment with StreamTableEnvironment for Python UDF examples (#11816)

This is an automated email from the ASF dual-hosted git repository.

dianfu pushed a commit to branch release-1.10
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.10 by this push:
     new 9b812d7  [FLINK-16763][python][docs] Replace BatchTableEnvironment with StreamTableEnvironment for Python UDF examples (#11816)
9b812d7 is described below

commit 9b812d77fa517af0cf152370b2f86c904a2c83a2
Author: Hequn Cheng <ch...@gmail.com>
AuthorDate: Mon Apr 20 22:24:24 2020 +0800

    [FLINK-16763][python][docs] Replace BatchTableEnvironment with StreamTableEnvironment for Python UDF examples (#11816)
---
 docs/dev/table/functions/udfs.md        | 3 ++-
 docs/dev/table/functions/udfs.zh.md     | 3 ++-
 docs/dev/table/python/python_udfs.md    | 3 ++-
 docs/dev/table/python/python_udfs.zh.md | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/docs/dev/table/functions/udfs.md b/docs/dev/table/functions/udfs.md
index 37cfd04..3d16f46 100644
--- a/docs/dev/table/functions/udfs.md
+++ b/docs/dev/table/functions/udfs.md
@@ -146,7 +146,8 @@ class HashCode(ScalarFunction):
   def eval(self, s):
     return hash(s) * self.factor
 
-table_env = BatchTableEnvironment.create(env)
+# use StreamTableEnvironment since Python UDF is not supported in the old planner under batch mode
+table_env = StreamTableEnvironment.create(env)
 
 # register the Python function
 table_env.register_function("hash_code", udf(HashCode(), DataTypes.BIGINT(), DataTypes.BIGINT()))
diff --git a/docs/dev/table/functions/udfs.zh.md b/docs/dev/table/functions/udfs.zh.md
index c35f56a..59c1828 100644
--- a/docs/dev/table/functions/udfs.zh.md
+++ b/docs/dev/table/functions/udfs.zh.md
@@ -146,7 +146,8 @@ class HashCode(ScalarFunction):
   def eval(self, s):
     return hash(s) * self.factor
 
-table_env = BatchTableEnvironment.create(env)
+# use StreamTableEnvironment since Python UDF is not supported in the old planner under batch mode
+table_env = StreamTableEnvironment.create(env)
 
 # register the Python function
 table_env.register_function("hash_code", udf(HashCode(), DataTypes.BIGINT(), DataTypes.BIGINT()))
diff --git a/docs/dev/table/python/python_udfs.md b/docs/dev/table/python/python_udfs.md
index 44a30ff..25e6cd7 100644
--- a/docs/dev/table/python/python_udfs.md
+++ b/docs/dev/table/python/python_udfs.md
@@ -44,7 +44,8 @@ class HashCode(ScalarFunction):
   def eval(self, s):
     return hash(s) * self.factor
 
-table_env = BatchTableEnvironment.create(env)
+# use StreamTableEnvironment since Python UDF is not supported in the old planner under batch mode
+table_env = StreamTableEnvironment.create(env)
 
 # register the Python function
 table_env.register_function("hash_code", udf(HashCode(), DataTypes.BIGINT(), DataTypes.BIGINT()))
diff --git a/docs/dev/table/python/python_udfs.zh.md b/docs/dev/table/python/python_udfs.zh.md
index 7acba1f..89b752a 100644
--- a/docs/dev/table/python/python_udfs.zh.md
+++ b/docs/dev/table/python/python_udfs.zh.md
@@ -44,7 +44,8 @@ class HashCode(ScalarFunction):
   def eval(self, s):
     return hash(s) * self.factor
 
-table_env = BatchTableEnvironment.create(env)
+# use StreamTableEnvironment since Python UDF is not supported in the old planner under batch mode
+table_env = StreamTableEnvironment.create(env)
 
 # register the Python function
 table_env.register_function("hash_code", udf(HashCode(), DataTypes.BIGINT(), DataTypes.BIGINT()))