UNLOAD Statements

UNLOAD statements are used to unload a built-in or user-defined module.

Run a UNLOAD statement

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.

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.

Python

UNLOAD statements can be executed with the execute_sql() method of the TableEnvironment. The execute_sql() 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.

SQL CLI

UNLOAD statements can be executed in SQL CLI.

The following examples show how to run a UNLOAD statement in SQL CLI.

Java

  1. StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
  2. StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
  3. // unload a core module
  4. tEnv.executeSql("UNLOAD MODULE core");
  5. tEnv.executeSql("SHOW MODULES").print();
  6. // Empty set

Scala

  1. val env = StreamExecutionEnvironment.getExecutionEnvironment()
  2. val tEnv = StreamTableEnvironment.create(env)
  3. // unload a core module
  4. tEnv.executeSql("UNLOAD MODULE core")
  5. tEnv.executeSql("SHOW MODULES").print()
  6. // Empty set

Python

  1. table_env = StreamTableEnvironment.create(...)
  2. # unload a core module
  3. table_env.execute_sql("UNLOAD MODULE core")
  4. table_env.execute_sql("SHOW MODULES").print()
  5. # Empty set

SQL CLI

  1. Flink SQL> UNLOAD MODULE core;
  2. [INFO] Unload module succeeded!
  3. Flink SQL> SHOW MODULES;
  4. Empty set

Back to top

UNLOAD MODULE

The following grammar gives an overview of the available syntax:

  1. UNLOAD MODULE module_name