tree: f9c9e84132d4baaedafee14c5956d5d53e5da4e7
  1. src/
  2. DESIGN.md
  3. pom.xml
  4. README.md
pinot-sql-ddl/README.md

pinot-sql-ddl

Pinot SQL DDL compiler and reverse-emitter. Translates CREATE TABLE, DROP TABLE, SHOW TABLES, and SHOW CREATE TABLE into the existing Schema + TableConfig model and back.

Quick example

CREATE TABLE events (
  id    INT NOT NULL DIMENSION,
  city  STRING DIMENSION,
  amount DOUBLE METRIC,
  ts    TIMESTAMP DATETIME FORMAT 'TIMESTAMP' GRANULARITY '1:MILLISECONDS'
)
TABLE_TYPE = OFFLINE
PROPERTIES (
  'timeColumnName' = 'ts',
  'replication' = '3'
);

POST the SQL to /sql/ddl on the controller (see DESIGN.md §6 and the PR description for the full REST contract and more examples).

Module layout

Sub-packageResponsibility
compile/Forward path: AST → (Schema, TableConfig). Entry point DdlCompiler.
resolved/Typed intermediate representation between AST and final config.
reverse/Reverse path: stored (Schema, TableConfig) → canonical DDL string. Entry point CanonicalDdlEmitter.

Where to read more