Skip to content

SQL DDL Schema Examples

Ravi Kiran Pagidi edited this page Jun 28, 2026 · 1 revision

SQL DDL Schema Examples

Status

Partially supported. Compact column DDL works. Full CREATE TABLE statements and dialect-specific constraints are planned.

What it is and when to use it

Compact DDL is useful when your schema is already written as column/type pairs or a Spark struct<...> string.

Supported example

from great_generator import generate_from_schema

ddl = "customer_id string, customer_name string, age int, balance decimal(12,2), created_at timestamp"
df = generate_from_schema(ddl, rows=1000)
print(df.head())
df.to_parquet("customers.parquet", index=False)

Sample output

customer_id  customer_name  age  balance  created_at
CUST000001   Ava Johnson    34   4812.37  2024-08-19

Planned full SQL example

CREATE TABLE customers (
    customer_id VARCHAR(50),
    customer_name VARCHAR(100),
    age INT,
    balance DECIMAL(12,2),
    created_at TIMESTAMP
);

The full statement above is not accepted by the current parser. Remove the CREATE TABLE wrapper and constraints, or use a mapping.

Notes and limitations

Current parsing is dialect-neutral and intentionally compact. It does not inspect SQL Server, Oracle, PostgreSQL, Snowflake, BigQuery, Redshift, or Databricks DDL dialects.

Clone this wiki locally