Table Of Contents

6.1. Create table

6.1.1. Synopsis

CREATE TABLE <table_name> ( [
  { <column_name> <data_type> }
  [, ... ]
] )
[ SHARD_SIZE [=] <duration> ]

6.1.2. Description

CREATE TABLE will create a new table in a QuasarDB cluster with the specified schema. A special timestamp column is automatically created, which is what new data will be indexed on.

6.1.3. Parameters

table_name

The name of the table to be created. Can be alphanumeric, but is not allowed to start with a number.

column_name

The name of a column to be created in the new table. Can be alphanumeric, but is not allowed to start with a number.

data_type

The data type to be associated with the column. Can be any of INT64, DOUBLE, BLOB or TIMESTAMP.

duration

The size (as time duration) of a single shard (bucket). The syntax is described in section Durations.

6.1.4. Examples

Create a table with only a single column:

CREATE TABLE example (my_int INT64)

Create a table with multiple columns:

CREATE TABLE example (my_int INT64, my_double DOUBLE, my_blob BLOB, my_ts TIMESTAMP)

Create a table with a custom shard size:

CREATE TABLE example (my_double DOUBLE) SHARD_SIZE = 1hour 2min 3s
arrow_backPrevious
6. Query language
Next arrow_forward
6.2. Drop table