SET [query_option=option_value]
+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.
+ 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 name and any string argument values are case-insensitive.
+ The query_option and option_value are
+ case-insensitive.
- Each query option has a specific allowed notation for its arguments. Boolean options can be enabled and
- disabled by assigning values of either true and false, or
- 1 and 0. Some numeric options accept a final character signifying the unit,
- such as 2g for 2 gigabytes or 100m for 100 megabytes. See
- for the details of each query option.
+ 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".
- Setting query options during impala-shell invocation:
-
-
-
- In and higher, you can use one or more command-line options
- of the form --query_option=option=value
- when running the impala-shell command. The corresponding query option settings
- take effect for that impala-shell session.
+ 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.
- User-specified substitution variables:
-
-
-
- In and higher, you can specify your own names and string substitution values
- within the impala-shell interpreter. Once a substitution variable is set up,
- its value is inserted into any SQL statement in that same impala-shell session
- that contains the notation ${var:varname}.
- Using SET in an interactive impala-shell session overrides
- any value for that same variable passed in through the --var=varname=value
- command-line option.
-
-
-
- For example, to set up some default parameters for report queries, but then override those default
- within an impala-shell session, you might issue commands and statements such as
- the following:
-
-
-
--- Initial setup for this example.
-create table staging_table (s string);
-insert into staging_table values ('foo'), ('bar'), ('bletch');
-
-create table production_table (s string);
-insert into production_table values ('North America'), ('EMEA'), ('Asia');
-quit;
-
--- Start impala-shell with user-specified substitution variables,
--- run a query, then override the variables with SET and run the query again.
-$ impala-shell --var=table_name=staging_table --var=cutoff=2
-... banner message ...
-[localhost:21000] > select s from ${var:table_name} order by s limit ${var:cutoff};
-Query: select s from staging_table order by s limit 2
-+--------+
-| s |
-+--------+
-| bar |
-| bletch |
-+--------+
-Fetched 2 row(s) in 1.06s
-
-[localhost:21000] > set var:table_name=production_table;
-Variable TABLE_NAME set to production_table
-[localhost:21000] > set var:cutoff=3;
-Variable CUTOFF set to 3
-
-[localhost:21000] > select s from ${var:table_name} order by s limit ${var:cutoff};
-Query: select s from production_table order by s limit 3
-+---------------+
-| s |
-+---------------+
-| Asia |
-| EMEA |
-| North America |
-+---------------+
-
-
-
- The following example shows how SET ALL with no parameters displays
- all user-specified substitution variables, and how UNSET removes
- the substitution variable entirely:
-
-
-
-[localhost:21000] > set all;
-Query options (defaults shown in []):
-ABORT_ON_ERROR: [0]
-COMPRESSION_CODEC: []
-DISABLE_CODEGEN: [0]
-...
-
-Advanced Query Options:
-APPX_COUNT_DISTINCT: [0]
-BUFFER_POOL_LIMIT: []
-DEFAULT_JOIN_DISTRIBUTION_MODE: [0]
-...
-
-Development Query Options:
-BATCH_SIZE: [0]
-DEBUG_ACTION: []
-DECIMAL_V2: [0]
-...
-
-Deprecated Query Options:
-ABORT_ON_DEFAULT_LIMIT_EXCEEDED: [0]
-ALLOW_UNSUPPORTED_FORMATS: [0]
-DEFAULT_ORDER_BY_LIMIT: [-1]
-...
-
-Shell Options
- LIVE_PROGRESS: False
- LIVE_SUMMARY: False
-
-Variables:
- CUTOFF: 3
- TABLE_NAME: staging_table
-
-[localhost:21000] > unset var:cutoff;
-Unsetting variable CUTOFF
-[localhost:21000] > select s from ${var:table_name} order by s limit ${var:cutoff};
-Error: Unknown variable CUTOFF
-
-
-
- See for more examples of using the
- --var, SET, and ${var:varname}
- substitution technique in impala-shell.
+ Each query option has a specific allowed notation for its arguments. See
+ for the details of each query
+ option.
- MEM_LIMIT is probably the most commonly used query option. You can specify a high value to
- allow a resource-intensive query to complete. For testing how queries would work on memory-constrained
- systems, you might specify an artificially low value.
+ In and higher, the outputs of the SET
+ and SET ALL statements were reorganized as below:
-
+
+ -
+
+ The options are divided into groups: Regular Query Options,
+ Advanced Query Options, Development Query Options,
+ and Deprecated Query Options.
+
+
+ -
+
+ The advanced options are intended for use in specific kinds of performance tuning
+ and debugging scenarios.
+
+
-
+ -
+
+ The development options are related to internal development of Impala or features
+ that are not yet finalized. These options might be changed or removed without
+ notice.
+
+
-
- The following example sets some numeric and some Boolean query options to control usage of memory, disk
- space, and timeout periods, then runs a query whose success could depend on the options in effect:
-
+ -
+
+ The deprecated options are related to features that are removed or changed so that
+ the options no longer have any purpose. These options might be removed in future
+ versions.
+
+
+
+
-set mem_limit=64g;
-set DISABLE_UNSAFE_SPILLS=true;
-set parquet_file_size=400m;
-set RESERVATION_REQUEST_TIMEOUT=900000;
-insert overwrite parquet_table select c1, c2, count(c3) from text_table group by c1, c2, c3;
-
+ -
+
+ By default, only the first two groups, regular and advanced, are displayed by the
+ SET command. Use SET ALL to see all groups of
+ options.
+
+
+
+ -
+
+ impala-shell options and user-specified variables are always
+ displayed at the end of the list of query options, after all appropriate option
+ groups.
+
+
+
- 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.
+ 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.
-
-
-
-
- See for the query options you can adjust using this
- statement.
+ See for the query options you can
+ adjust using this statement.
+