wuchong commented on a change in pull request #15230:
URL: https://github.com/apache/flink/pull/15230#discussion_r598126455



##########
File path: docs/content.zh/docs/dev/table/sql/unload.md
##########
@@ -0,0 +1,115 @@
+---
+title: "UNLOAD 语句"
+weight: 13
+type: docs
+aliases:
+  - /zh/dev/table/sql/unload.html
+---
+<!--
+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.
+-->
+
+# UNLOAD Statements
+
+UNLOAD statements are used to unload a built-in or user-defined module.
+
+## Run a UNLOAD statement
+
+{{< tabs "unload statement" >}}
+{{< tab "Java" >}}
+
+UNLOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise it will throw an exception.
+
+The following examples show how to run a UNLOAD statement in 
`TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+UNLOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise it will throw an exception.
+
+The following examples show how to run a UNLOAD statement in 
`TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+UNLOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise it will throw an exception.
+
+The following examples show how to run a UNLOAD statement in 
`TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+UNLOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a UNLOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "unload modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// unload a core module
+tEnv.executeSql("UNLOAD MODULE core");
+tEnv.executeSql("SHOW MODULES").print();
+// Empty set
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// unload a core module
+tEnv.executeSql("UNLOAD MODULE core")
+tEnv.executeSql("SHOW MODULES").print()
+// Empty set
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# unload a core module
+table_env.execute_sql("UNLOAD MODULE core")
+table_env.execute_sql("SHOW MODULES").print()
+# Empty set
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> UNLOAD MODULE core;
+[INFO] Unload module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- Empty set
+```
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< top >}}
+
+## UNLOAD MODULE
+
+The following grammar gives an overview of the available syntax:
+```sql
+UNLOAD MODULE `module_name`

Review comment:
       Users don't need always escape the module_name. `UNLOAD MODULE 
module_name` is fine. 

##########
File path: docs/content.zh/docs/dev/table/sql/unload.md
##########
@@ -0,0 +1,115 @@
+---
+title: "UNLOAD 语句"
+weight: 13
+type: docs
+aliases:
+  - /zh/dev/table/sql/unload.html
+---
+<!--
+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.
+-->
+
+# UNLOAD Statements
+
+UNLOAD statements are used to unload a built-in or user-defined module.
+
+## Run a UNLOAD statement
+
+{{< tabs "unload statement" >}}
+{{< tab "Java" >}}
+
+UNLOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise it will throw an exception.
+
+The following examples show how to run a UNLOAD statement in 
`TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+UNLOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise it will throw an exception.
+
+The following examples show how to run a UNLOAD statement in 
`TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+UNLOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise it will throw an exception.
+
+The following examples show how to run a UNLOAD statement in 
`TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+UNLOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a UNLOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "unload modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// unload a core module
+tEnv.executeSql("UNLOAD MODULE core");
+tEnv.executeSql("SHOW MODULES").print();
+// Empty set
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// unload a core module
+tEnv.executeSql("UNLOAD MODULE core")
+tEnv.executeSql("SHOW MODULES").print()
+// Empty set
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# unload a core module
+table_env.execute_sql("UNLOAD MODULE core")
+table_env.execute_sql("SHOW MODULES").print()
+# Empty set
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> UNLOAD MODULE core;
+[INFO] Unload module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- Empty set

Review comment:
       ditto.

##########
File path: docs/content/docs/dev/table/sql/load.md
##########
@@ -0,0 +1,142 @@
+---
+title: "LOAD Statements"
+weight: 12
+type: docs
+aliases:
+  - /dev/table/sql/load.html
+---
+<!--
+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.
+-->
+
+# LOAD Statements
+
+LOAD statements are used to load a built-in or user-defined module.
+
+## Run a LOAD statement
+
+{{< tabs "load statement" >}}
+{{< tab "Java" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+LOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a LOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "load modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')");
+tEnv.executeSql("SHOW MODULES").print();
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+tEnv.executeSql("SHOW MODULES").print()
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# load a hive module
+table_env.execute_sql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+table_env.execute_sql("SHOW MODULES").print()
+# +-------------+
+# | module name |
+# +-------------+
+# |        core |
+# |        hive |
+# +-------------+
+
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> LOAD MODULE hive WITH ('hive-version' = '3.1.2');
+[INFO] Load module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- +-------------+
+-- | module name |
+-- +-------------+
+-- |        core |
+-- |        hive |
+-- +-------------+

Review comment:
       There is no `--` prefix printed in SQL Client. 

##########
File path: docs/content.zh/docs/dev/table/sql/use.md
##########
@@ -215,6 +251,11 @@ USE CATALOG catalog_name
 
 设置当前的 catalog。所有后续命令未显式指定 catalog 的将使用此 catalog。如果指定的的 catalog 不存在,则抛出异常。默认的当前 
catalog 是 `default_catalog`。
 
+## USE MODULES
+```sql
+USE MODULES `module_name1`[, `module_name2`, ...]

Review comment:
       ditto.

##########
File path: docs/content.zh/docs/dev/table/sql/show.md
##########
@@ -376,3 +446,21 @@ SHOW [USER] FUNCTIONS
 
 **USER**
 仅仅展示当前 catalog 和当前 database 中用户定义的 function。
+
+## SHOW MODULES
+
+```sql
+SHOW MODULES
+```
+
+展示当前环境激活的所有 module。
+
+## SHOW FULL MODULES

Review comment:
       I suggest to merge `SHOW FULL MODUELS` into `SHOW MODULES`, just like 
what we do for `SHOW [USER] FUNCTIONS`.

##########
File path: docs/content/docs/dev/table/sql/load.md
##########
@@ -0,0 +1,142 @@
+---
+title: "LOAD Statements"
+weight: 12
+type: docs
+aliases:
+  - /dev/table/sql/load.html
+---
+<!--
+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.
+-->
+
+# LOAD Statements
+
+LOAD statements are used to load a built-in or user-defined module.
+
+## Run a LOAD statement
+
+{{< tabs "load statement" >}}
+{{< tab "Java" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+LOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a LOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "load modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')");
+tEnv.executeSql("SHOW MODULES").print();
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+tEnv.executeSql("SHOW MODULES").print()
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# load a hive module
+table_env.execute_sql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+table_env.execute_sql("SHOW MODULES").print()
+# +-------------+
+# | module name |
+# +-------------+
+# |        core |
+# |        hive |
+# +-------------+
+
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> LOAD MODULE hive WITH ('hive-version' = '3.1.2');
+[INFO] Load module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- +-------------+
+-- | module name |
+-- +-------------+
+-- |        core |
+-- |        hive |
+-- +-------------+
+
+```
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< top >}}
+
+## LOAD MODULE
+
+The following grammar gives an overview of the available syntax:
+```sql
+LOAD MODULE `module_name` [WITH ('key1' = 'val1', 'key2' = 'val2', ...)]

Review comment:
       nit: should we explain what's the key1 val1 properties?

##########
File path: docs/content.zh/docs/dev/table/sql/load.md
##########
@@ -0,0 +1,142 @@
+---
+title: "LOAD 语句"
+weight: 12
+type: docs
+aliases:
+  - /zh/dev/table/sql/load.html
+---
+<!--
+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.
+-->
+
+# LOAD Statements
+
+LOAD statements are used to load a built-in or user-defined module.
+
+## Run a LOAD statement
+
+{{< tabs "load statement" >}}
+{{< tab "Java" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+LOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a LOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "load modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')");
+tEnv.executeSql("SHOW MODULES").print();
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+tEnv.executeSql("SHOW MODULES").print()
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# load a hive module
+table_env.execute_sql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+table_env.execute_sql("SHOW MODULES").print()
+# +-------------+
+# | module name |
+# +-------------+
+# |        core |
+# |        hive |
+# +-------------+
+
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> LOAD MODULE hive WITH ('hive-version' = '3.1.2');
+[INFO] Load module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- +-------------+
+-- | module name |
+-- +-------------+
+-- |        core |
+-- |        hive |
+-- +-------------+

Review comment:
       ditto.

##########
File path: docs/content/docs/dev/table/sql/load.md
##########
@@ -0,0 +1,142 @@
+---
+title: "LOAD Statements"
+weight: 12
+type: docs
+aliases:
+  - /dev/table/sql/load.html
+---
+<!--
+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.
+-->
+
+# LOAD Statements
+
+LOAD statements are used to load a built-in or user-defined module.
+
+## Run a LOAD statement
+
+{{< tabs "load statement" >}}
+{{< tab "Java" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+LOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a LOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "load modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')");
+tEnv.executeSql("SHOW MODULES").print();
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+tEnv.executeSql("SHOW MODULES").print()
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# load a hive module
+table_env.execute_sql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+table_env.execute_sql("SHOW MODULES").print()
+# +-------------+
+# | module name |
+# +-------------+
+# |        core |
+# |        hive |
+# +-------------+
+
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> LOAD MODULE hive WITH ('hive-version' = '3.1.2');
+[INFO] Load module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- +-------------+
+-- | module name |
+-- +-------------+
+-- |        core |
+-- |        hive |
+-- +-------------+
+
+```
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< top >}}
+
+## LOAD MODULE
+
+The following grammar gives an overview of the available syntax:
+```sql
+LOAD MODULE `module_name` [WITH ('key1' = 'val1', 'key2' = 'val2', ...)]

Review comment:
       Besides, users don't need always escape the module_name.

##########
File path: docs/content.zh/docs/dev/table/sql/load.md
##########
@@ -0,0 +1,142 @@
+---
+title: "LOAD 语句"
+weight: 12
+type: docs
+aliases:
+  - /zh/dev/table/sql/load.html
+---
+<!--
+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.
+-->
+
+# LOAD Statements
+
+LOAD statements are used to load a built-in or user-defined module.
+
+## Run a LOAD statement
+
+{{< tabs "load statement" >}}
+{{< tab "Java" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "Scala" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+{{< /tab >}}
+{{< tab "Python" >}}
+
+LOAD statements can be executed with the `executeSql()` method of the 
`TableEnvironment`. The `executeSql()` method returns 'OK' for a successful 
LOAD operation; otherwise, it will throw an exception.
+
+The following examples show how to run a LOAD statement in `TableEnvironment`.
+
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+
+LOAD statements can be executed in [SQL CLI]({{< ref 
"docs/dev/table/sqlClient" >}}).
+
+The following examples show how to run a LOAD statement in SQL CLI.
+
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< tabs "load modules" >}}
+{{< tab "Java" >}}
+```java
+StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')");
+tEnv.executeSql("SHOW MODULES").print();
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Scala" >}}
+```scala
+val env = StreamExecutionEnvironment.getExecutionEnvironment()
+val tEnv = StreamTableEnvironment.create(env)
+
+// load a hive module
+tEnv.executeSql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+tEnv.executeSql("SHOW MODULES").print()
+// +-------------+
+// | module name |
+// +-------------+
+// |        core |
+// |        hive |
+// +-------------+
+
+```
+{{< /tab >}}
+{{< tab "Python" >}}
+```python
+settings = EnvironmentSettings.new_instance()...
+table_env = StreamTableEnvironment.create(env, settings)
+
+# load a hive module
+table_env.execute_sql("LOAD MODULE hive WITH ('hive-version' = '3.1.2')")
+table_env.execute_sql("SHOW MODULES").print()
+# +-------------+
+# | module name |
+# +-------------+
+# |        core |
+# |        hive |
+# +-------------+
+
+```
+{{< /tab >}}
+{{< tab "SQL CLI" >}}
+```sql
+Flink SQL> LOAD MODULE hive WITH ('hive-version' = '3.1.2');
+[INFO] Load module succeeded!
+
+Flink SQL> SHOW MODULES;
+-- +-------------+
+-- | module name |
+-- +-------------+
+-- |        core |
+-- |        hive |
+-- +-------------+
+
+```
+{{< /tab >}}
+{{< /tabs >}}
+
+{{< top >}}
+
+## LOAD MODULE
+
+The following grammar gives an overview of the available syntax:
+```sql
+LOAD MODULE `module_name` [WITH ('key1' = 'val1', 'key2' = 'val2', ...)]

Review comment:
       ditto.

##########
File path: docs/content.zh/docs/dev/table/modules.md
##########
@@ -55,25 +55,358 @@ the `ModuleFactory` interface.
 A module factory defines a set of properties for configuring the module when 
the SQL CLI bootstraps.
 Properties are passed to a discovery service where the service tries to match 
the properties to
  a `ModuleFactory` and instantiate a corresponding module instance.
- 
 
-## Namespace and Resolution Order
+##  Module Lifecycle and Resolution Order
 
-Objects provided by modules are considered part of Flink's system (built-in) 
objects; thus, they don't have any namespaces.
+A module can be loaded, enabled, disabled and unloaded. When TableEnvironment 
loads a module initially, it enables the module by default. Flink supports 
multiple modules and keeps track of the loading order to resolve metadata. 
*E.g.*, when there are two functions of the same name residing in two modules, 
Flink always resolves the function reference to the one in the 1st enabled 
module.

Review comment:
       > to the one in the 1st enabled module.
   This sounds we always resolve function by only looking up the first module 
which is incorrect. 

##########
File path: docs/content.zh/docs/dev/table/sql/show.md
##########
@@ -38,6 +38,8 @@ SHOW 语句用于列出所有的 catalog,或者列出当前 catalog 中所有
 - SHOW TABLES
 - SHOW VIEWS
 - SHOW FUNCTIONS
+- SHOW MODULES
+- SHOW FULL MODULES

Review comment:
       ditto. 




-- 
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