This command is used to create a CarbonData table by specifying the list of fields along with the table properties.
CREATE TABLE [IF NOT EXISTS] [db_name.]table_name STORED AS carbondata [TBLPROPERTIES (key1=val1, key2=val2, ...)] AS select_statement;
Parameter |
Description |
---|---|
db_name |
Database name that contains letters, digits, and underscores (_). |
table_name |
Table name of a database that contains letters, digits, and underscores (_). |
STORED AS |
Used to store data in CarbonData format. |
TBLPROPERTIES |
List of CarbonData table properties. For details, see Precautions. |
N/A
CREATE TABLE ctas_select_parquet STORED AS carbondata as select * from parquet_ctas_test;
This example will create a Carbon table from any Parquet table and load all the records from the Parquet table.