title: “JAR Statements” weight: 16 type: docs aliases:

  • /dev/table/sql/jar.html

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]({{< ref “docs/dev/table/sqlClient” >}}).

Run a JAR statement

{{< tabs “add jar statement” >}} {{< tab “SQL CLI” >}}

The following examples show how to run JAR statements in [SQL CLI]({{< ref “docs/dev/table/sqlClient” >}}).

{{< /tab >}} {{< /tabs >}}

{{< tabs “add jar” >}} {{< tab “SQL CLI” >}}

Flink SQL> ADD JAR '/path/hello.jar';
[INFO] The specified jar is added into session classloader.

Flink SQL> SHOW JARS;
/path/hello.jar

Flink SQL> REMOVE JAR '/path/hello.jar';
[INFO] The specified jar is removed from session classloader.

{{< /tab >}} {{< /tabs >}}

ADD JAR

ADD JAR '<path_to_filename>.jar'

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

REMOVE JAR

REMOVE JAR '<path_to_filename>.jar'

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

SHOW JARS

SHOW JARS

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

{{< top >}}