Impala Shell Command Reference

Use the following commands within impala-shell to pass requests to the impalad daemon that the shell is connected to. You can enter a command interactively at the prompt or pass it as the argument to the -q option of impala-shell.

Command Explanation

Impala SQL statements

You can issue valid SQL statements to be executed.

connect

Connects to the specified instance of impalad. The default port of 21050 is assumed unless you provide another value. You can connect to any host in your cluster that is running impalad. If you connect to an instance of impalad that was started with an alternate port specified by the --fe_port flag, you must provide that alternate port.

help

Help provides a list of all available commands and options.

history

Maintains an enumerated cross-session command history. This history is stored in the ~/.impalahistory file.

profile

Displays low-level information about the most recent query. Used for performance diagnosis and tuning. The report starts with the same information as produced by the EXPLAIN statement and the SUMMARY command.

quit

Exits the shell. Remember to include the final semicolon so that the shell recognizes the end of the command.

rerun or @

Executes a previous impala-shell command again, from the list of commands displayed by the history command. These could be SQL statements, or commands specific to impala-shell such as quit or profile.

Specify an integer argument. A positive integer N represents the command labelled N in the output of the HISTORY command. A negative integer -N represents the Nth command from the end of the list, such as -1 for the most recent command. Commands that are executed again do not produce new entries in the HISTORY output list.

set

Manages query options for an impala-shell session. These options are used for query tuning and troubleshooting. Issue SET with no arguments to see the current query options, either based on the impalad defaults, as specified by you at impalad startup, or based on earlier SET statements in the same session. To modify option values, issue commands with the syntax set option=value. To restore an option to its default, use the unset command.

shell

Executes the specified command in the operating system shell without exiting impala-shell. You can use the ! character as shorthand for the shell command.

source or src

Executes one or more statements residing in a specified file from the local filesystem. Allows you to perform the same kinds of batch operations as with the -f option, but interactively within the interpreter. The file can contain SQL statements and other impala-shell commands, including additional SOURCE commands to perform a flexible sequence of actions. Each command or statement, except the last one in the file, must end with a semicolon.

summary

Summarizes the work performed in various stages of a query. It provides a higher-level view of the information displayed by the EXPLAIN command. Added in Impala 1.4.0.

The time, memory usage, and so on reported by SUMMARY only include the portions of the statement that read data, not when data is written. Therefore, the PROFILE command is better for checking the performance and scalability of INSERT statements.

You can see a continuously updated report of the summary information while a query is in progress.

unset

Removes any user-specified value for a query option and returns the option to its default value.

You can also use it to remove user-specified substitution variables using the notation UNSET VAR:variable_name.

use

Indicates the database against which to execute subsequent commands. Lets you avoid using fully qualified names when referring to tables in databases other than default. Not effective with the -q option, because that option only allows a single statement in the argument.

version

Returns Impala version information.