Skip to main content
ReferenceApplies to: Unified engine deployments
A catalog supplies object metadata. A source connector reads rows and a sink connector publishes writes. Their supported types, write modes, and maintenance operations can differ.

Table names

table, namespace.table, and catalog.namespace.table use increasingly explicit context. Unqualified names use the session’s current catalog and namespace. Examples use readable names such as demo.tpcds.item. Replace these names with your catalog and namespace.

Create and populate a table

Prepare the write lab first. This script recreates only its item_sample table, copies five source rows, and reads the result. Running it again replaces that small copy.
The example separates the schema definition from the insert. CREATE TABLE AS SELECT (CTAS) also needs the catalog to support staged creation and publication. The Iceberg REST connector requests this support from the configured server. CLUSTERED BY is rejected; supported bucket partition transforms use a different grammar. New Iceberg tables default to format v3. Add TBLPROPERTIES ('format-version' = '2') to CREATE TABLE or CTAS when native maintenance is needed. For an existing table, ALTER TABLE name SET TBLPROPERTIES ('format-version' = '3') requests a format upgrade. Format versions cannot be downgraded or unset. Native table maintenance is enabled only for v2 tables. Reads and writes support v3.

Explicit schemas

This script recreates a small empty table before inserting two rows. SQL query types and sink types can differ: a type accepted in SELECT may still be rejected by an Iceberg writer.

Alter a table

For setting, inspecting, changing, and removing saved properties, see the dedicated TBLPROPERTIES page. This example recreates a lab table, adds a nullable column, and changes a table property. Catalogs can accept a narrower set of schema changes than the SQL grammar.

Temporary views

A local temporary view belongs to its session. The following view reads the original SF1 item table. Use the same session and temporary view for the next example.
Query-backed persistent and global temporary views have separate catalog and scope requirements. Do not assume that a temporary view is visible in another session.

Drop a table

DROP removes the named table according to the catalog’s rules. IF EXISTS tolerates an absent name. This complete example creates and drops only a lab table.

File sources

CSV, TSV, JSON, and Parquet can be read through a local temporary file view with USING and an OPTIONS path. A typed column list is optional where schema inference is supported. CSV options include header and delimiter; folder filtering can use pathGlobFilter. Supported local and object-store locations require configured storage access. File views must be local temporary views; persistent/global temporary file views and IF NOT EXISTS on this form are rejected. Folder reads are bounded. The live examples use catalog-backed SF1 tables so every input already exists.

CSV options

Use USING csv with an OPTIONS path. Set header 'true' when the first row contains column names. Use delimiter to choose the field separator and pathGlobFilter '*.csv' to select files. An explicit column list keeps the types stable across input files.

Parquet options

Use USING parquet with an OPTIONS path to read Parquet files. A pathGlobFilter '*.parquet' filter selects matching files in a folder. These are read options. See Iceberg write options for compression, file sizes, and other settings used when writing Parquet.

Writes and publication

A write needs the corresponding connector capability. Row-level mutations also need target row identity and an allowed complete target read. Prepared data or delete files become visible only after the committer and catalog confirm publication. Inspect the final operation and confirmed write outcome. A read can observe a catalog snapshot newer than an earlier read. A script is a sequence of operations, not a multi-statement transaction. See Writing data.
Last modified on November 4, 2026