DDL - Tables
CREATE TABLE
CREATE TABLE [IF NOT EXISTS] <table>
(<column> <type> [NOT NULL] [ENCODING <encodingSpec>],
[SHARD KEY (<column>)],
[SHARED DICTIONARY (<column>) REFERENCES <table>(<column>)], ...)
[WITH (<property> = value, ...)];
Create a table named <table>
specifying <columns>
and table properties.
<type>
Supported types:
For more information, see Datatypes and Fixed Encoding.
Example
Create a table named tweets
and specify the columns, including type, in the table.
CREATE TABLE IF NOT EXISTS tweets (
tweet_id BIGINT NOT NULL,
tweet_time TIMESTAMP NOT NULL ENCODING FIXED(32),
lat FLOAT,
lon FLOAT,
sender_id BIGINT NOT NULL,
sender_name TEXT NOT NULL ENCODING DICT,
location TEXT ENCODING DICT,
source TEXT ENCODING DICT,
reply_to_user_id BIGINT,
reply_to_tweet_id BIGINT,
lang TEXT ENCODING DICT,
followers INT,
followees INT,
tweet_count INT,
join_time TIMESTAMP ENCODING FIXED(32),
tweet_text TEXT,
state TEXT ENCODING DICT,
county TEXT ENCODING DICT,
place_name TEXT,
state_abbr TEXT ENCODING DICT,
county_state TEXT ENCODING DICT,
origin TEXT ENCODING DICT,
phone_numbers bigint);