Impala shell commands
You can use the commands described below to pass requests to an impalad daemon. It is possible to enter a command to the prompt, or pass it as the argument to the -q
option of impala-shell. Most of these commands are passed to the Impala daemon as SQL statements. Refer to the corresponding sections of the Impala SQL Statements article for syntax details.
Name | Description |
---|---|
alter |
Changes the structure or settings of an Impala table, or a table shared between Impala and Hive. See ALTER TABLE and ALTER VIEW statements for details |
compute stats |
Displays performance-related information for a table. Impala uses it to optimize queries. See COMPUTE STATS Statement |
connect |
Connects to an instance of impalad. The command uses the default port |
describe |
Shows the column names, data types, and comments for a specified table. Also, the |
drop |
Removes an object, and in some cases its associated data files. See DROP TABLE, DROP VIEW, DROP DATABASE, and DROP FUNCTION statements for more information |
explain |
Provides the execution plan for a query. |
help |
Displays a list of all available commands and options |
history |
Shows an enumerated command history list from recent sessions. The history is stored in the ~/.impalahistory file |
insert |
Writes a query result to a specified table. This statement either overwrites table data or appends data to the existing table content. See INSERT Statement |
invalidate metadata |
Updates impalad metadata for tables. Use this command after creating, dropping, or altering databases, tables, or partitions in Hive. See INVALIDATE METADATA Statement |
profile |
Displays low-level information about the most recent query. It is used for performance diagnosis and tuning. The report starts with the same information as the |
quit |
Exits the impala-shell. It is necessary to add a final semicolon to the command so that the shell recognizes the end of the command |
refresh |
Refreshes impalad metadata of the HDFS block locations corresponding to Impala data files. Utilize this command after loading new data files into an Impala table through Hive or through HDFS commands. See REFRESH Statement |
rerun or @ |
Executes a previous impala-shell command from the list of commands displayed by the history command. It can be an SQL statement, or a command specific to impala-shell ( The command accepts an integer argument. A positive integer number represents the command number from the |
select |
Selects data from a database. The returned result-set can be sent to the console output, or a file, or can be a part of another query. See SELECT Statement |
set |
Specifies query options for an impala-shell session. The available options are listed at Query Options for the SET Statement. These options are used for query tuning and troubleshooting. The command syntax is |
shell |
Allows you to execute a command in the operating system shell without exiting from impala-shell. You can use the |
show |
Displays metastore data for objects (databases, tables, and functions) created and accessed through Impala or Hive. See SHOW Statement |
source or src |
The command accepts as a parameter the path to a file on the local file system and executes statements from this file. The file can contain SQL statements and impala-shell commands, including other The |
summary |
Displays a summary of the operations performed at different stages of the query. It provides a higher-level view of the information displayed by the |
unset |
Removes any user-specified value for a query option and returns the option to its default value. For information about the options for which this command is available, refer to Query Options for the SET Statement. You can also remove substitution variables. For this, use the following notation: |
use |
Specifies the database against which to execute subsequent commands. The |
version |
Displays Impala version information |