A vote to add table constraints to the Apache Iceberg v4 table spec passed on 27 October, according to Data Lakehouse Hub, a blog by Dremio's Alex Merced that follows the project's dev list. The spec text now defines primary key, unique and check constraints, an enforced flag on each, and a per-snapshot record of whether each constraint holds. The v4 format is still being assembled through a series of such votes and has not shipped.
The design follows a pattern already common in cloud warehouses: a primary key can be declared without being checked.
What a constraint does in an analytical system
A table constraint is a rule about what a table may hold. NOT NULL forbids missing values, and CHECK requires a Boolean expression to be true for every row. PRIMARY KEY and UNIQUE forbid duplicate values in a column or set of columns, and FOREIGN KEY requires each value to match a key in another table.
Analytical platforms split these rules into two kinds. The platform checks enforced constraints on every write and rejects a write that breaks one. It keeps informational constraints as metadata that optimizers and documentation tools can read, but nothing stops a duplicate key from landing.
Why most keys go unchecked
Enforcing uniqueness means comparing every incoming key against every key already stored. Snowflake says it does not enforce primary, unique and foreign keys on standard tables because checking them on very large, distributed, columnar tables would slow down loading and DML (Snowflake). Open table formats add a second problem. Several engines can write to the same table, so a rule is only as reliable as the least careful writer.
Iceberg made this trade explicit with identifier fields, which let a table name the columns that identify a row. The spec says uniqueness by this identifier "is not guaranteed or required by Iceberg and it is the responsibility of processing engines or data providers to enforce" (Apache Iceberg). Writers such as Flink use identifier fields to choose the columns for equality deletes, and Apache Impala maps its unenforced primary key syntax for Iceberg tables onto them (Apache Impala).
How the main platforms differ
The table reflects each vendor's documentation as of November 2026.
| Platform | Enforced on write | Declared but not enforced | |---|---|---| | Snowflake standard tables | NOT NULL, CHECK | PRIMARY KEY, UNIQUE, FOREIGN KEY | | Snowflake hybrid tables | NOT NULL, PRIMARY KEY, UNIQUE, FOREIGN KEY, CHECK | None | | BigQuery | NOT NULL | PRIMARY KEY, FOREIGN KEY | | Databricks (Delta Lake) | NOT NULL, CHECK | PRIMARY KEY, UNIQUE, FOREIGN KEY |
Snowflake documents NOT NULL and CHECK as the only constraint types it enforces on standard tables (Snowflake). CHECK reached general availability in its 10.12 release in April 2026 (Snowflake). On hybrid tables, Snowflake's table type for transactional workloads, a primary key is required and enforced, and unique and foreign keys are enforced too (Snowflake). CHECK constraints on hybrid tables reached general availability on 24 September 2026 and can be defined only when the table is created (Snowflake).
Google states that key constraints "aren't enforced in BigQuery" and that "you are responsible for maintaining the constraints at all times" (Google Cloud). dbt's documentation lists NOT NULL as enforced on BigQuery (dbt Labs).
On Databricks, a write that violates NOT NULL or CHECK fails the transaction, and adding either constraint first checks the rows already in the table (Databricks). Databricks treats primary key, foreign key and unique constraints as informational and does not enforce them (Databricks).
Where unenforced keys still change results
Informational keys are not inert. Snowflake's optimizer can use a key for join elimination when the constraint carries the RELY property, which its documentation says to set only once the data is known to comply (Snowflake). BigQuery uses declared keys to eliminate inner and outer joins and to reorder joins (Google Cloud). Databricks may rewrite queries using constraints marked RELY, but the default is NORELY, and the related optimizations need pro or serverless SQL warehouses or serverless compute (Databricks).
The vendors document the cost. BigQuery warns that queries over tables with violated constraints "might return incorrect results" (Google Cloud), and Databricks says relying on an unsatisfied constraint "may lead to incorrect query results" (Databricks). A test on the data engineering blog waitingforcode showed Databricks turning SELECT DISTINCT on a RELY primary key into a plain SELECT, which returned duplicate rows once duplicate keys were inserted.
What the Iceberg v4 design adds
The v4 constraints apply within a single table. A summary posted to the Iceberg dev list during the design discussion put foreign keys out of scope as a multi-table, catalog-level concern (Apache Iceberg dev list). The same summary said engines that cannot enforce a constraint marked as enforced should fail rather than write unchecked data.
The spec says a write that would violate an enforced constraint must fail, but an enforced constraint does not require writers to repair violations already in the table. When a table is upgraded to v4, its identifier fields become a primary key that is not enforced (Apache Iceberg).
Snowflake already blocks external writes to Iceberg tables that carry CHECK constraints (Snowflake). Merced expects most v4 constraints to start out unenforced until every engine that writes to a table supports enforcement. Until then, a v4 primary key will behave on write like a Snowflake or BigQuery key today, a declaration with no check, though each snapshot will record its status.
What to check when evaluating a platform
- Which constraints are checked on write, for each table type in use. Snowflake gives different answers for standard, hybrid and Iceberg tables.
- Whether the optimizer trusts declared keys. Snowflake and Databricks require RELY, which is off by default; BigQuery uses declared keys for join optimizations.
- Whether every ingestion path accepts the constraint. Snowflake rejects COPY INTO, pipe creation and classic Snowpipe Streaming for tables with CHECK constraints (Snowflake).
- Whether other tools can still write to the table. On Databricks, adding a constraint can upgrade a Delta table's writer protocol, which might affect compatibility with external Delta clients (Databricks).
- What the transformation layer assumes. dbt's documentation says most analytical platforms enforce NOT NULL but "either do not support or do not enforce the rest", and dbt applies constraints only to table and incremental models (dbt Labs).
What commonly goes wrong
The usual failure is treating a declared primary key as a guarantee. A pipeline retries a load, or two engines append to the same Iceberg table, and duplicates land in a table whose metadata says it has none. Nothing fails.
The damage depends on what trusts the key. If nothing does, the result is double-counted rows that a uniqueness test would catch. If the optimizer trusts it, through RELY or BigQuery's join rewrites, a query can return wrong results with no warning. The waitingforcode author recommends RELY only where the writer can guarantee the keys are clean.
The opposite mistake is switching on enforcement without checking every write path. Snowflake's restrictions on loads and pipes that target tables with CHECK constraints, or a Delta protocol upgrade that an external writer cannot handle, can turn a data quality rule into a pipeline failure.
Sources
- Data Lakehouse Hub (Alex Merced). "Primary Keys Come to Apache Iceberg V4, and Most of Them Start Out Unenforced." 28 October 2026. https://datalakehousehub.com/blog/iceberg-v4-table-constraints/
- Data Lakehouse Hub (Alex Merced). "The State of Apache Iceberg v4 in July 2026: What the Dev List Tells Us About the Format's Next Chapter." 2026. https://datalakehousehub.com/blog/iceberg-v4-state-july-2026/
- Apache Iceberg. Table spec, Identifier Field IDs and Constraints sections (main branch). Accessed November 2026. https://github.com/apache/iceberg/blob/main/format/spec.md
- Apache Iceberg dev mailing list. Constraint support sync summary. 2026. https://go.mail-archive.com/dev@iceberg.apache.org/msg13925.html
- Apache Impala. "IMPALA-12729: Allow creating primary keys for Iceberg tables." 2024. https://apache.googlesource.com/impala/+/73171cb7164573349bd53a996a51bb7058b778e0
- Snowflake. "CREATE | ALTER TABLE ... CONSTRAINT." Accessed November 2026. https://docs.snowflake.com/en/sql-reference/sql/create-table-constraint
- Snowflake. "Overview of constraints." Accessed November 2026. https://docs.snowflake.com/en/sql-reference/constraints-overview
- Snowflake. "10.12 Release Notes." April 2026. https://docs.snowflake.com/en/release-notes/2026/10_12
- Snowflake. "Sep 24, 2026: CHECK constraints on hybrid tables (General availability)." 24 September 2026. https://docs.snowflake.com/en/release-notes/2026/other/2026-09-24-hybrid-tables-check-constraints-ga
- Google Cloud. "Use primary and foreign keys." Accessed November 2026. https://docs.cloud.google.com/bigquery/docs/primary-foreign-keys
- Databricks. "Constraints on Databricks." Accessed November 2026. https://docs.databricks.com/aws/en/tables/constraints
- Databricks. "ADD CONSTRAINT clause." Accessed November 2026. https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-alter-table-add-constraint
- Databricks. "CONSTRAINT clause." Accessed November 2026. https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-table-constraint
- waitingforcode (Bartosz Konieczny). "RELY clause on keys for Databricks Unity Catalog tables." 10 February 2026. https://www.waitingforcode.com/databricks/rely-clause-keys-databricks-unity-catalog-tables/read
- dbt Labs. "constraints." Accessed November 2026. https://docs.getdbt.com/reference/resource-properties/constraints
