Impala Shell Configuration File
You can store a set of default settings for impala-shell in the impala-shell configuration file.
The global impala-shell configuration file is located
The user-level impala-shell configuration file is
Note that the global-level file name is different from the user-level file name. The global-level file name does not include a dot (.) in the file name.
The default path of the global configuration file can be changed by
To specify a different file name or path for the user-level configuration
file, start impala-shell with the
impala-shell option set to the path of the
Typically, an administrator creates the global configuration file for the impala-shell, and if the user-level configuration file exists, the options set in the user configuration file take precedence over those in the global configuration file.
In turn, any options you specify on the impala-shell command line override any corresponding options within the configuration file.
The impala-shell configuration file (global or user)
must contain a header label
[impala], followed by the
options specific to impala-shell.
The impala-shell configuration file consists of
key-value pairs, one option per line. Everything after the
# character on a line is treated as a comment and
The names of the options in the configuration file are similar (although not necessarily identical) to the long-form command-line arguments to the impala-shell command. For the supported options in the configuration file, see Impala Shell Configuration Options.
You can specify key-value pair options using
similar to the
--var command-line option. For example,
The query options specified in the
override the options specified in the
The following example shows a configuration file that you might use
during benchmarking tests. It sets verbose mode, so that the output from
each SQL query is followed by timing information.
impala-shell starts inside the database containing
the tables with the benchmark data, avoiding the need to issue a
USE statement or use fully qualified table names.
In this example, the query output is formatted as delimited text rather
than enclosed in ASCII art boxes, and is stored in a file rather than
printed to the screen. Those options are appropriate for benchmark
situations, so that the overhead of impala-shell
formatting and printing the result set does not factor into the timing
measurements. It also enables the
That option prints detailed performance information after each query,
which might be valuable in understanding the performance of benchmark
[impala] verbose=true default_db=tpc_benchmarking write_delimited=true output_delimiter=, output_file=/home/tester1/benchmark_results.csv show_profiles=true keyval=msg1=hello,keyval=msg2=world
The following example shows a configuration
file that connects to a specific remote Impala node, runs a single query
within a particular database, then exits. Any query options predefined
[impala.query_options] section in the
configuration file take effect during the session.
You would typically use this kind of single-purpose configuration
setting with the impala-shell command-line option
to easily select between many predefined queries that could be run against
different databases, hosts, or even different clusters. To run a sequence
of statements instead of a single query, specify the configuration option
[impala] impalad=impala-test-node1.example.com default_db=site_stats # Issue a predefined query and immediately exit. query=select count(*) from web_traffic where event_date = trunc(now(),'dd') [impala.query_options] mem_limit=32g