Skip to content
Pivot is in early development and is not production ready. See Project status.

CREATE SCHEMA

CREATE SCHEMA adds a namespace for tables to a datastore.

CREATE SCHEMA analytics;
CREATE TABLE analytics.events (id BIGINT, region VARCHAR);
CREATE SCHEMA [IF NOT EXISTS] [datastore.]schema;

schema is the new namespace. Qualify it with a configured datastore name to create it there; otherwise Pivot uses the default datastore.

IF NOT EXISTS leaves an existing schema in place.

Given a datastore named lake:

CREATE SCHEMA IF NOT EXISTS lake.analytics;

CREATE OR REPLACE SCHEMA is not supported.