[FLINK-16763][python][docs] Replace BatchTableEnvironment with StreamTableEnvironment for Python UDF examples (#11816)
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 @@
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 @@
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 @@
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 @@
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()))