Ad hoc Iceberg metadata updates

Use SQL Studio to make supported metadata changes to an existing Foundry Iceberg table managed by another pipeline. You can create a branch or tag, or change selected write-layout and compression properties, without replacing the producing pipeline.

Each update runs once and does not save a SQL definition. You must have permission to write to the table.

Run a metadata update

  1. Open SQL Studio in data mode and create or open a worksheet.

  2. Enter one supported ALTER TABLE statement with the adhoc hint. For example, create a branch named audit:

    Copied!
    1 2 /*+ adhoc */ ALTER TABLE `/path/to/table` CREATE BRANCH audit
  3. Select Run and wait for the build to succeed before using the new branch.

  4. Run the following query to inspect the table's branches and tags:

    Copied!
    1 SELECT name, type, snapshot_id FROM `/path/to/table`.refs

Run each metadata update individually. Metadata updates cannot run together in a multi-statement query or as part of a transaction block.

Supported statements

OperationSupported options
CREATE BRANCHOptional IF NOT EXISTS or AS OF VERSION, without replacement or retention options
CREATE TAGOptional IF NOT EXISTS or AS OF VERSION, without replacement or retention options
SET TBLPROPERTIESOnly the property keys listed below
UNSET TBLPROPERTIESOnly the property keys listed below

Supported property keys are case-sensitive:

Property groupAllowed keys
File formatwrite.format.default, write.delete.format.default
Target file sizewrite.target-file-size-bytes, write.delete.target-file-size-bytes
Distributionwrite.distribution-mode, write.delete.distribution-mode, write.update.distribution-mode, write.merge.distribution-mode
Parquet compressionwrite.parquet.compression-codec, write.delete.parquet.compression-codec, write.parquet.compression-level, write.delete.parquet.compression-level
Avro compressionwrite.avro.compression-codec, write.delete.avro.compression-codec, write.avro.compression-level, write.delete.avro.compression-level
ORC compressionwrite.orc.compression-codec, write.delete.orc.compression-codec, write.orc.compression-strategy, write.delete.orc.compression-strategy
Metadata compressionwrite.metadata.compression-codec

For example, run this statement in SQL Studio to change compression for future Parquet writes without rewriting existing data files:

Copied!
1 2 /*+ adhoc */ ALTER TABLE `/path/to/table` SET TBLPROPERTIES ('write.parquet.compression-codec'='zstd')

Table properties are shared across branches. Changing a write property can affect future writes by the producing pipeline, not just writes on one branch.

A pipeline that replaces the table can reset property changes on its next build. Configure the properties in the producing pipeline when they must be reapplied on every build.

Unsupported operations

Ad hoc metadata updates on tables managed by another pipeline do not support:

  • Data changes such as INSERT, UPDATE, DELETE, or MERGE
  • Schema changes
  • Branch or tag deletion or replacement
  • Retention options on branches or tags
  • Maintenance procedures
  • Properties outside the list above, including format-version, retention, encryption, and storage-location settings

For compaction, snapshot expiration, and other maintenance procedures, use the table's Maintenance tab. To change the table's data or schema, update its producing pipeline.