Creates a new table.
Syntax
CREATE TABLE [schema_name.]table_name ( column_name <data_type> [PRIMARY KEY] [,...] ) [PARTITION BY RANGE(column_name) EVERY (<part_interval>)] <Data_type> ::= { INT | BIGINT | FLOAT | DOUBLE | STRING | TIMESTAMP } <part_interval> ::= { n | VALUE | INTERVAL 'n' {month | day | hour} } CREATE TABLE [schema_name.]table_name MERGE FROM [schema_name.]source-table1, [schema_name.]source-table2[,...]
Description
Create a new table object. Table name and column names must be a valid identifier. For more details on Jethro data types attributes, see Data Types. A table can have one primary key column. Primary keys must contain unique values and cannot contain NULL values.
Parameter Details
Parameter | Mandatory? | Details |
---|---|---|
PARTITION BY | OPTIONAL | The clause defines range partitioning. Unlike Hive and Impala, in Jethro the partition column name must be one of the columns previously defined in the table column list. Partitioning interval specification depends on the data type of the partitioning column:
*The valid range for 'n' is: 0<n<(2^32-1), integer values only. |
Merged Table
Table can also be created via vertical merge of two or more tables using the MERGE FROM clause. Merged table will hold all the columns from all it's source tables.