CREATE TABLE
Basic syntax
Basic syntax:
|
|
Column definition syntax:
|
|
Partition options syntax:
|
|
Table options syntax are key-value pairs. Value should be quoted with quotation marks ('
). E.g.:
|
|
IF NOT EXISTS
Add IF NOT EXISTS
to tell HoraeDB to ignore errors if the table name already exists.
Define Column
A column’s definition should at least contains the name and type parts. All supported types are listed here.
Column is default be nullable. i.e. NULL
keyword is implied. Adding NOT NULL
constrains to make it required.
|
|
A column can be marked as special column with related keyword.
For string tag column, we recommend to define it as dictionary to reduce memory consumption:
|
|
Engine
Specifies which engine this table belongs to. HoraeDB current support Analytic
engine type. This attribute is immutable.
Partition Options
Note: This feature is only supported in distributed version.
|
|
Example below creates a table with 8 partitions, and partitioned by name
:
|
|