How can impala create a temporary table?

In Impala, you can use the CREATE TABLE statement to create a temporary table. The syntax for creating a temporary table is as follows:

Table creation statement:
CREATE [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.]table_name
[(col_name data_type [COMMENT ‘col_comment’] [col_constraint_spec] [,…])]
[COMMENT ‘table_comment’]
[PARTITIONED BY (col_name data_type [COMMENT ‘col_comment’] [col_constraint_spec] [,…])]
[CLUSTERED BY (col_name,…) [SORTED BY (col_name [ASC|DESC],…)] INTO num_buckets BUCKETS]
[STORED AS file_format]
[LOCATION ‘hdfs_path’]
[TBLPROPERTIES (‘key1’=‘value1’, ‘key2’=‘value2’, …)]
[AS select_statement]

The temporary table created by the CREATE TEMPORARY TABLE statement will be automatically deleted when the Impala session ends. If you need to share a temporary table between multiple Impala sessions, you can create a regular table using the CREATE TABLE statement and manually delete it after use.

bannerAds