Impala statement types
Lists the SQL statement types for workloads that use Apache Impala. You can find the statement types on the Impala Queries page in the Type list. For more detailed information about these types of SQL statements, click the Related Information link below.
Statement Type | Description |
---|---|
ALTER TABLE | Changes the structure or properties of an existing table. For example,
|
ALTER VIEW | Changes the characteristics of a view. For example, |
COMPUTE STATS | Collects information about volume and distribution data in a table and all
associated columns and partitions. For example, |
CREATE DATABASE | Creates a new database. For example, |
CREATE FUNCTION | Creates a user-defined function (UDF), which you can use to implement custom
logic during SELECT or INSERT operations. For
example, |
CREATE ROLE | Creates a role to which privileges can be granted. After privileges are granted
to the role, then the role can be assigned to users. A user who has been assigned a
role is only able to exercise the privileges of that role. For example,
|
CREATE TABLE | Creates a new table and specifies its characteristics. For example,
|
CREATE TABLE AS SELECT | Creates a new table with the output from a SELECT statement. For example,
|
CREATE TABLE LIKE | Creates a new table by cloning an existing table. For example, |
CREATE VIEW | Creates a shorthand abbreviation (alias) for a query. A view is a purely logical
construct with no physical data behind it. For example, |
DDL | The Data Definition Language, whose SQL statements change the structure of the
database by creating, deleting, or modifying schema objects, such as databases,
tables, and views. For example, |
DESCRIBE DB | Displays metadata about a database. For example, |
DESCRIBE TABLE | Displays metadata about a table. For example, |
DML | The Data Manipulation Language, whose SQL statements modify the data stored in
tables. For example, |
DROP DATABASE | Removes a database from the system. For example, |
DROP FUNCTION | Removes a user-defined function (UDF) so that it is not available for execution
during Impala SELECT or INSERT operations. For example, |
DROP STATS | Removes the specified statistics from a table or a partition. For example,
|
DROP TABLE | Removes a table and its underlying HDFS data files for internal tables, although
not for external tables. For example, |
DROP VIEW | Removes the specified view. Because a view is purely a logical construct with no
physical data behind it, DROP VIEW only involves changes to metadata in the metastore
database, not any data files in HDFS. For example, |
EXPLAIN | Generates a query execution plan for a specific query. For example,
|
GRANT PRIVILEGE | Grants privileges on specified objects to groups. For example, |
GRANT ROLE | Grants roles on specified objects to groups. For example, |
LOAD | Loads data from an external data source into a table. For example,
|
N/A | These queries failed due to syntax errors and Impala is not able to identify a query type for them. |
REFRESH | Reloads the metadata for a table from the metastore database, performs an
incremental reload of the file, and blocks the metadata from the HDFS NameNode.
REFRESH is used to avoid inconsistencies between Impala and
external metadata sources, specifically the Hive Metastore and the NameNode. For
example, |
REVOKE PRIVILEGE | Revokes privileges on a specified object from groups. For example,
|
REVOKE ROLE | Revokes roles on a specified object from groups. For example, |
SELECT | Requests data from a data source. For example, |
SET | Sets configuration properties or session parameters. For example, |
SHOW COLUMN STATS | Displays the column statistics for a specified table. For example,
|
SHOW CREATE TABLE | Displays the CREATE TABLE statement used to reproduce the current structure of a
table. For example, |
SHOW DATABASES | Displays all available databases. For example, |
SHOW FILES | Displays the files that constitute a specified table or a partition within a
partitioned table. For example, |
SHOW FUNCTIONS | Displays user-defined functions (UDFs) or user-defined aggregate functions
(UDAFs) that are associated with a particular database. For example, |
SHOW GRANT ROLE | Lists all the grants for the specified role name. For example, |
SHOW ROLES | Displays all available roles. For example, |
SHOW TABLES | Displays the names of tables. For example, |
SHOW TABLE STATS | Displays the statistics for a table. For example, |
TRUNCATE TABLE | Removes the data from an Impala table, while keeping the table. For example,
|
USE | Switches the current session to a specified database. For example, |