CREATE TABLE … USING iceberg
The one word that makes a table an Iceberg table is USING iceberg. Everything else is ordinary SQL — column names, types, and an optional PARTITIONED BY and TBLPROPERTIES.
CREATE TABLE [catalog.]db.name (
col1 type [NOT NULL] [COMMENT '...'],
col2 type, ...
)
USING iceberg
[PARTITIONED BY (col | transform(col))]
[TBLPROPERTIES ('key'='value', ...)];Here we declare a db.sales Iceberg table with a fixed schema. The runnable cell shows the same thing in the in-browser engine (minus the Iceberg-only clauses, which SQLite doesn't parse) so you can see it succeed — edit a type and run again:
CREATE TABLE db.sales (
order_id BIGINT,
product STRING,
category STRING,
amount DOUBLE,
order_date DATE
)
USING iceberg
PARTITIONED BY (category)
TBLPROPERTIES ('format-version'='2');
SELECT * FROM db.sales; -- empty, ready for writesformat-version'='2' opts into row-level deletes (needed for efficient MERGE/UPDATE/DELETE); v1 is append-only. The PARTITIONED BY (category) is a logical declaration — Iceberg lays the files out and prunes on it automatically, with no category= folder you have to filter on. We go deep on that in Module 5.