Hi everyone, I'd like to share a proposal for adding constraint support to Iceberg. Phase 1 focuses on CHECK constraints with Spark DSv2 as the first integration, plus informational PRIMARY KEY/UNIQUE constraints.
Proposal: Constraint Support in Iceberg <https://docs.google.com/document/d/1re65fx3uqC7I_tJuS79IxLiB7HEN2Grt5qRIDjd3p-4/edit?tab=t.0#heading=h.o38ny2ndrd79> Highlights: - CHECK: persisted by Iceberg, may be enforced on writes by engines. Expression stored as an Iceberg Expression object (aligned with the Extending Iceberg Expressions <https://docs.google.com/document/d/1VthBz0S2I39TeQM8oiF9_gSPQu_gHAjWXvdFpv0QqDk/edit?tab=t.0#heading=h.v6qkdf8ytmqo> proposal), not SQL strings. - PK/UNIQUE: informational with optional RELY/NORELY. FOREIGN KEY deferred as a catalog-level concern. - Snapshot-level validation: constraint validity is tracked per-snapshot, not on the constraint itself. - Binding: constraints bound by field IDs, stable across renames/reorders. Looking forward to feedback. Thanks, Huaxin
