This is an automated email from the ASF dual-hosted git repository. dianfu pushed a commit to branch release-1.11 in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.11 by this push: new 4203965 [FLINK-18926][python][docs] Add a "Environment Variables" document under the "Python API" -> "User Guide" -> "Table API" section 4203965 is described below commit 42039658a832d7cc22e9aa3fb2427c765469b8e7 Author: Wei Zhong <weizhong0...@gmail.com> AuthorDate: Thu Nov 5 15:31:57 2020 +0800 [FLINK-18926][python][docs] Add a "Environment Variables" document under the "Python API" -> "User Guide" -> "Table API" section This closes #13935. --- docs/_includes/generated/python_configuration.html | 2 +- .../table-api-users-guide/environment_variables.md | 62 ++++++++++++++++++++++ .../environment_variables.zh.md | 62 ++++++++++++++++++++++ .../org/apache/flink/python/PythonOptions.java | 14 +++-- 4 files changed, 134 insertions(+), 6 deletions(-) diff --git a/docs/_includes/generated/python_configuration.html b/docs/_includes/generated/python_configuration.html index 890d025..81e340c 100644 --- a/docs/_includes/generated/python_configuration.html +++ b/docs/_includes/generated/python_configuration.html @@ -18,7 +18,7 @@ <td><h5>python.client.executable</h5></td> <td style="word-wrap: break-word;">"python"</td> <td>String</td> - <td>The python interpreter used to launch the python process when compiling the jobs containing Python UDFs. Equivalent to the environment variable PYFLINK_EXECUTABLE. The priority is as following: 1. the configuration 'python.client.executable' defined in the source code; 2. the environment variable PYFLINK_EXECUTABLE; 3. the configuration 'python.client.executable' defined in flink-conf.yaml</td> + <td>The path of the Python interpreter used to launch the Python process when submitting the Python jobs via "flink run" or compiling the Java/Scala jobs containing Python UDFs. Equivalent to the environment variable PYFLINK_CLIENT_EXECUTABLE. The priority is as following: <br />1. the configuration 'python.client.executable' defined in the source code;<br />2. the environment variable PYFLINK_CLIENT_EXECUTABLE;<br />3. the configuration 'python.client.executable' defined in [...] </tr> <tr> <td><h5>python.executable</h5></td> diff --git a/docs/dev/python/table-api-users-guide/environment_variables.md b/docs/dev/python/table-api-users-guide/environment_variables.md new file mode 100644 index 0000000..91d3019 --- /dev/null +++ b/docs/dev/python/table-api-users-guide/environment_variables.md @@ -0,0 +1,62 @@ +--- +title: "Environment Variables" +nav-parent_id: python_tableapi +nav-pos: 140 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +These environment variables will affect the behavior of PyFlink: + +<table class="table table-bordered"> + <thead> + <tr> + <th class="text-left" style="width: 30%">Environment Variable</th> + <th class="text-center">Description</th> + </tr> + </thead> + <tbody> + <tr> + <td> + <strong>FLINK_HOME</strong> + </td> + <td> + PyFlink job will be compiled before submitting and it requires Flink's distribution to compile the job. + PyFlink's installation package already contains Flink's distribution and it's used by default. + This environment allows you to specify a custom Flink's distribution. + </td> + </tr> + <tr> + <td> + <strong>PYFLINK_CLIENT_EXECUTABLE</strong> + </td> + <td> + The path of the Python interpreter used to launch the Python process when submitting the Python jobs via + "flink run" or compiling the Java/Scala jobs containing Python UDFs. + Equivalent to the configuration option 'python.client.executable'. The priority is as following: + <ol> + <li>The configuration 'python.client.executable' defined in the source code; </li> + <li>The environment variable PYFLINK_CLIENT_EXECUTABLE; </li> + <li>The configuration 'python.client.executable' defined in flink-conf.yaml</li> + </ol> + If none of above is set, the default Python interpreter 'python' will be used. + </td> + </tr> + </tbody> +</table> diff --git a/docs/dev/python/table-api-users-guide/environment_variables.zh.md b/docs/dev/python/table-api-users-guide/environment_variables.zh.md new file mode 100644 index 0000000..ec55eb3 --- /dev/null +++ b/docs/dev/python/table-api-users-guide/environment_variables.zh.md @@ -0,0 +1,62 @@ +--- +title: "环境变量" +nav-parent_id: python_tableapi +nav-pos: 140 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +These environment variables will affect the behavior of PyFlink: + +<table class="table table-bordered"> + <thead> + <tr> + <th class="text-left" style="width: 30%">Environment Variable</th> + <th class="text-center">Description</th> + </tr> + </thead> + <tbody> + <tr> + <td> + <strong>FLINK_HOME</strong> + </td> + <td> + PyFlink job will be compiled before submitting and it requires Flink's distribution to compile the job. + PyFlink's installation package already contains Flink's distribution and it's used by default. + This environment allows you to specify a custom Flink's distribution. + </td> + </tr> + <tr> + <td> + <strong>PYFLINK_CLIENT_EXECUTABLE</strong> + </td> + <td> + The path of the Python interpreter used to launch the Python process when submitting the Python jobs via + "flink run" or compiling the Java/Scala jobs containing Python UDFs. + Equivalent to the configuration option 'python.client.executable'. The priority is as following: + <ol> + <li>The configuration 'python.client.executable' defined in the source code; </li> + <li>The environment variable PYFLINK_CLIENT_EXECUTABLE; </li> + <li>The configuration 'python.client.executable' defined in flink-conf.yaml</li> + </ol> + If none of above is set, the default Python interpreter 'python' will be used. + </td> + </tr> + </tbody> +</table> diff --git a/flink-python/src/main/java/org/apache/flink/python/PythonOptions.java b/flink-python/src/main/java/org/apache/flink/python/PythonOptions.java index 791c9d4..c771f4e 100644 --- a/flink-python/src/main/java/org/apache/flink/python/PythonOptions.java +++ b/flink-python/src/main/java/org/apache/flink/python/PythonOptions.java @@ -22,6 +22,7 @@ import org.apache.flink.annotation.PublicEvolving; import org.apache.flink.configuration.ConfigOption; import org.apache.flink.configuration.ConfigOptions; import org.apache.flink.configuration.TaskManagerOptions; +import org.apache.flink.configuration.description.Description; /** * Configuration options for the Python API. @@ -144,11 +145,14 @@ public class PythonOptions { .key("python.client.executable") .stringType() .defaultValue("python") - .withDescription("The python interpreter used to launch the python process when compiling " + - "the jobs containing Python UDFs. Equivalent to the environment variable PYFLINK_EXECUTABLE. " + - "The priority is as following: 1. the configuration 'python.client.executable' defined in " + - "the source code; 2. the environment variable PYFLINK_EXECUTABLE; 3. the configuration " + - "'python.client.executable' defined in flink-conf.yaml"); + .withDescription(Description.builder() + .text("The path of the Python interpreter used to launch the Python process when submitting the " + + "Python jobs via \"flink run\" or compiling the Java/Scala jobs containing Python UDFs. " + + "Equivalent to the environment variable PYFLINK_CLIENT_EXECUTABLE. " + + "The priority is as following: ").linebreak() + .text("1. the configuration 'python.client.executable' defined in the source code;").linebreak() + .text("2. the environment variable PYFLINK_CLIENT_EXECUTABLE;").linebreak() + .text("3. the configuration 'python.client.executable' defined in flink-conf.yaml").build()); /** * Whether the memory used by the Python framework is managed memory.