JAR Statements

JAR statements are used to add user jars into the classpath or remove user jars from the classpath or show added jars in the classpath in the runtime.

Flink SQL supports the following JAR statements for now:

  • ADD JAR
  • REMOVE JAR
  • SHOW JARS

Attention JAR statements only work in the SQL CLI.

Run a JAR statement

SQL CLI

The following examples show how to run JAR statements in SQL CLI.

SQL CLI

  1. Flink SQL> ADD JAR '/path/hello.jar';
  2. [INFO] The specified jar is added into session classloader.
  3. Flink SQL> SHOW JARS;
  4. /path/hello.jar
  5. Flink SQL> REMOVE JAR '/path/hello.jar';
  6. [INFO] The specified jar is removed from session classloader.

ADD JAR

  1. ADD JAR '<path_to_filename>.jar'

Currently it only supports to add the local jar into the session classloader.

REMOVE JAR

  1. REMOVE JAR '<path_to_filename>.jar'

Currently it only supports to remove the jar that is added by the ADD JAR statements.

SHOW JARS

  1. SHOW JARS

Show all added jars in the session classloader which are added by ADD JAR statements.

Back to top