1
0
forked from docs/doc-exports
Yang, Tong 6182f91ba8 MRS component operation guide_normal 2.0.38.SP20 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2022-12-09 14:55:21 +00:00

4.7 KiB

CREATE TABLE As SELECT

Function

This command is used to create a CarbonData table by specifying the list of fields along with the table properties.

Syntax

CREATE TABLE [IF NOT EXISTS] [db_name.]table_name STORED AS carbondata [TBLPROPERTIES (key1=val1, key2=val2, ...)] AS select_statement;

Parameter Description

Table 1 CREATE TABLE parameters

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.

Precautions

N/A

Examples

CREATE TABLE ctas_select_parquet STORED AS carbondata as select * from parquet_ctas_test;

System Response

This example will create a Carbon table from any Parquet table and load all the records from the Parquet table.