Skip to main content
ReferenceApplies to: Unified engine deployments
Prepare a private write namespace as described in Example data. Examples use demo.examples for its private namespace. Each script first recreates its own small table from SF1, making that example independent and repeatable. Replace the example names with your catalog, source namespace, and private write namespace. Scripts are not transactions. IRC object creation requires exact, case-sensitive names. Each script sets spark.sql.caseSensitive to true before creating its lab table.

INSERT INTO

Append rows in target-column order, or supply an explicit target column list when supported. Avoid repeating an append when the earlier commit is uncertain.
The result contains keys 1–4.

INSERT OVERWRITE

Whole-table overwrite replaces the current contents. Static partitions, dynamic partitions, and predicate overwrite have additional target capability and partition validation requirements.
The result contains keys 4 and 5.

Iceberg write options

The dedicated TBLPROPERTIES page covers the full property workflow, supported keys, defaults, and validation. Use Table maintenance to change the layout of existing files. Use TBLPROPERTIES to choose the Parquet layout for an Iceberg table. These settings stay on the table and apply to later writes. PARTITIONED BY defines how rows are split into Iceberg partitions. This example copies twelve generated items into a private table. It sets file and Parquet targets, then rewrites the table with a different compression codec.
ALTER affects later writes. It does not rewrite existing files. Use a new table or a whole-table overwrite when a benchmark needs one layout across the dataset. For CSV, create a local temporary file view with an explicit schema and INSERT from that view in the same session. Its path needs configured storage access. See File sources.

Data files and write records

New writes use data/<write-id>/part-*.parquet for unpartitioned tables. Writes that resume from individual batches add a batch directory below the write ID. Partitioned tables also add a partition directory. The write ID keeps concurrent attempts separate and stays the same when the saved attempt resumes. Recovery records such as begin.json and prepared.json are stored under metadata/_transactions/. They record write progress and prepared output so a retry can avoid publishing the same write twice. They are not table rows. New manifest files use <commit-id>-manifest-*.avro and <commit-id>-list.avro under metadata/. Existing files remain at their recorded locations. Saved writes from older versions keep their original paths when retried. Read tables through the catalog so their snapshots and delete files are applied.

Supported Parquet settings

A Parquet row group contains rows within a file. Pages hold smaller blocks of column data. A dictionary holds repeated values that pages can refer to by code. The encoder accepts uncompressed, snappy, zstd, gzip, brotli, lz4, and lz4_raw. LZO is unsupported. Compression levels must fit the chosen codec. A level with Snappy, LZ4, or uncompressed output is rejected. Sizes and row limits must be positive. Unknown write.parquet.* and write.target-* keys fail when a write is planned. Other custom table properties remain allowed. Content-defined chunking chooses page boundaries from data values before encoding and compression. It defaults to disabled. When enabled, the minimum must be positive and the maximum must be greater than the minimum. The encoder also checks their range.

Partition transforms

Several transforms can be combined. Time transforms require a compatible date or timestamp; hour partitioning requires a timestamp. Null partition values remain null. Per-write options cannot change an existing table’s partition spec.

Options for one DataFrame write

Per-write overrides are available through Spark Connect’s DataFrame API for existing tables. SQL INSERT has no per-write OPTIONS clause. The full property keys above are accepted. compression, compression-level, and target-file-size-bytes are aliases.
Per-write settings take priority over the saved table properties, then encoder defaults. They do not change catalog properties or later writes. A codec change drops an inherited level for a different codec unless the write supplies a level. Conflicting aliases and unknown per-write keys fail. Use table properties when creating a table; create-time per-write option mapping remains unsupported.

File-size limits

Files still close at input-batch boundaries. A 128 MiB target cannot combine many small batches into one 128 MiB file. File, row-group, page, and dictionary targets are capped by the runtime buffer budget. Compression, encoding, and metadata affect the final byte size. Final files in a partition can be smaller. Per-column Parquet controls, enforced write sort order, and parallel writer distribution remain unsupported in this write path.

UPDATE

SET assigns new values to rows selected by WHERE. Omitting WHERE selects all rows. Mutations require a connector that supplies row identity and supports the planned write.

DELETE

DELETE removes matching rows; without WHERE it selects the whole target. It changes the table snapshot rather than merely hiding rows in a query.

MERGE

MERGE joins target and source using ON, then applies matching clauses in order. Ensure the source does not produce multiple conflicting matches for a target row. Supported clauses include matched UPDATE/DELETE and not-matched INSERT, subject to connector capabilities.

TRUNCATE TABLE

TRUNCATE removes all rows through the target’s whole-table write path. Partition and inheritance modifiers are not accepted.
The count is zero. Acceptance, task execution, and confirmed publication are separate stages; use the execution details to inspect an uncertain outcome before starting a new write.
Last modified on November 4, 2026