SET Statement

The SET statement specifies values for query options that control the runtime behavior of other statements within the same session.

When issued in impala-shell, the SET command is interpreted as an impala-shell command that has differences from the SQL SET statement. See impala-shell Command Reference for the information about the SET command in impala-shell.

Syntax:

SET
SET ALL
SET query_option=option_value
SET query_option=""

SET and SET ALL with no arguments return a result set consisting of all the applicable query options and their current values.

The query_option and option_value are case-insensitive.

Unlike the impala-shell command version of SET, when used as a SQL statement, the string values for option_value need to be quoted, e.g. SET option="new_value".

The SET query_option = "" statement unsets the value of the query_option in the current session, reverting it to the default state. In impala-shell, use the UNSET command to set a query option to it default.

Each query option has a specific allowed notation for its arguments.

Usage notes:

In Impala 2.11 and higher, the outputs of the SET and SET ALL statements were reorganized as below:

Added in: Impala 2.0.0

SET has always been available as an impala-shell command. Promoting it to a SQL statement lets you use this feature in client applications through the JDBC and ODBC APIs.

HDFS permissions: This statement does not touch any HDFS files or directories, therefore no HDFS permissions are required.

Query Options for the SET Statement:

You can specify the following options using the SET statement, and those settings affect all queries issued from that session.

Some query options are useful in day-to-day operations for improving usability, performance, or flexibility.

Other query options control special-purpose aspects of Impala operation and are intended primarily for advanced debugging or troubleshooting.

Options with Boolean parameters can be set to 1 or true to enable, or 0 or false to turn off.

Note:

In Impala 2.0 and later, you can set query options directly through the JDBC and ODBC interfaces by using the SET statement. Formerly, SET was only available as a command within the impala-shell interpreter.

In Impala 2.11 and later, you can set query options for an impala-shell session by specifying one or more command-line arguments of the form --query_option=option=value. See impala-shell Configuration Options for details.

Related information:

SET Statement