dianfu commented on a change in pull request #15790:
URL: https://github.com/apache/flink/pull/15790#discussion_r621771601



##########
File path: docs/content.zh/docs/dev/python/table/udfs/python_udfs.md
##########
@@ -554,3 +554,11 @@ class 
ListViewConcatTableAggregateFunction(TableAggregateFunction):
     def get_result_type(self):
         return DataTypes.ROW([DataTypes.FIELD("a", DataTypes.STRING())])
 ```
+
+## 打包 UDFs
+
+To run Python UDFs (as well as Pandas UDFs) in any non-local mode, it is 
strongly recommended to bundle your Python UDF definitions using the config 
option [`python-files`]({{< ref "docs/dev/python/python_config" 
>}}#python-files), if your Python UDFs live outside of the file where the 
`main()` function is defined.

Review comment:
       It's not necessary to keep the English version if you have already 
translated it to Chinese. The paragraph should be removed.

##########
File path: docs/content.zh/docs/dev/python/table/udfs/python_udfs.md
##########
@@ -554,3 +554,11 @@ class 
ListViewConcatTableAggregateFunction(TableAggregateFunction):
     def get_result_type(self):
         return DataTypes.ROW([DataTypes.FIELD("a", DataTypes.STRING())])
 ```
+
+## 打包 UDFs
+
+To run Python UDFs (as well as Pandas UDFs) in any non-local mode, it is 
strongly recommended to bundle your Python UDF definitions using the config 
option [`python-files`]({{< ref "docs/dev/python/python_config" 
>}}#python-files), if your Python UDFs live outside of the file where the 
`main()` function is defined.
+Otherwise, you may run into `ModuleNotFoundError: No module named 'my_udf'` if 
you define Python UDFs in a file called `my_udf.py`.
+
+如果你在非 local 模式下运行 Python UDFs 和 Pandas UDFs,且 Python UDFs 没有定义在含 `main()` 入口的 
Python 主文件中,我们强烈建议你通过 [`python-files`]({{< ref "docs/dev/python/python_config" 
>}}#python-files) 配置项将 Python UDF 的定义打包起来。

Review comment:
       ```suggestion
   如果你在非 local 模式下运行 Python UDFs 和 Pandas UDFs,且 Python UDFs 没有定义在含 `main()` 
入口的 Python 主文件中,强烈建议你通过 [`python-files`]({{< ref 
"docs/dev/python/python_config" >}}#python-files) 配置项指定 Python UDF 的定义。
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to