Skip to content

OpenAI: IRC spec changes for v4 [WIP][Discuss] - #17543

Draft
dhruvarya-db wants to merge 4 commits into
apache:mainfrom
dhruvarya-db:rest-spec-v4-support
Draft

OpenAI: IRC spec changes for v4 [WIP][Discuss]#17543
dhruvarya-db wants to merge 4 commits into
apache:mainfrom
dhruvarya-db:rest-spec-v4-support

Conversation

@dhruvarya-db

@dhruvarya-db dhruvarya-db commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

[WIP] PR to drive discussion around the changes needed in the IRC spec for V4 tables.

These changes are needed because:

  1. A V4 table has an Adaptive Metadata node at the root instead of the manifest-list. The Snapshot must contain one of manifest-list or content-root now.
  2. metadata-location is now optional because it won't be set for catalog-managed tables
  3. table-location -- metadata can contain relative paths now, this field will be used to specify the absolute path of the table.

Opening this to drive discussion on what the REST catalog spec needs for
format version 4. It is a proposal rather than a merge candidate: parts of it
depend on table spec changes that are still in review, and one change is
deliberately breaking. Details and open questions below.

Format version 4 restructures table metadata, and three constraints in the
current spec prevent a catalog from serving a v4 table at all: format-version
is capped at 3, Snapshot requires manifest-list, and CommitTableResponse
requires metadata-location.

Changes:

- TableMetadata: raise the format-version maximum to 4, and document that
  location is optional in v4, where it may be supplied by the catalog rather
  than carried in metadata.

- Snapshot: add root-manifest and make manifest-list optional, with a oneOf
  requiring exactly one of the two. A snapshot with neither is invalid and must
  not be read as a snapshot with no files. Which of the two applies is
  determined by format-version, which cannot be expressed here because that
  field lives in the enclosing TableMetadata, so it is stated normatively.

- LoadTableResult and CommitTableResponse: add table-location, which carries the
  table's base location for resolving relative paths. Format version 4 makes
  TableMetadata.location optional while allowing relative paths, so a table can
  have metadata that is unreadable without a catalog-supplied base.
  CommitTableResponse no longer requires metadata-location, and both responses
  document that it may be absent when the catalog is the source of truth for
  table state and no client-visible metadata pointer exists.

- UnregisterTableResult: add table-location, so the endpoint that hands back a
  metadata location cannot return metadata with no base to resolve against.

- Move the table endpoints to /v2. Every path whose response can carry table
  metadata moves: tables, tables/{table}, register, and tables/{table}/unregister.

Open questions:

- root-manifest is not in the ratified spec. It comes from the adaptive metadata
  tree proposal (apache#16025), which is still open, so the field name and shape may
  change. Note also that SnapshotParser currently writes manifest-list for v4
  tables, so the oneOf as written would reject snapshots this repository
  produces today. Whether to keep the field, defer it, or make it purely
  additive is the main thing worth discussing.

- Moving the table endpoints to /v2 rather than adding /v2 alongside /v1 is a
  breaking change, and assumes v1 is no longer supported. An additive version
  that leaves /v1 in place is the obvious alternative if that assumption does
  not hold.

- Whether path versioning is the right mechanism at all, versus a header or a
  content-type parameter.

- Relative path support and the typed content stats are already in the spec for
  v4; snapshot offloading is not yet, and would interact with the snapshots
  query parameter on loadTable if it lands later.

make lint and make generate both pass.
Renames the field from root-manifest to content-root, and follows the name in
the surrounding descriptions so the prose matches ("the snapshot's content
root" rather than "the snapshot's root manifest").

make lint and make generate both pass, and the generated model picks up the
rename in both oneOf branches.
@dhruvarya-db dhruvarya-db changed the title OpenAPI: REST catalog support for table format version 4 [WIP][Discuss] IRC spec changes for v4 Aug 7, 2026
@dhruvarya-db dhruvarya-db changed the title [WIP][Discuss] IRC spec changes for v4 OpenAI: IRC spec changes for v4 [WIP][Discuss] Aug 7, 2026
…ield

Reworks the change so v1 endpoints stay in place unchanged, and the format
version 4 behavior lives on parallel v2 endpoints, rather than moving the table
endpoints to v2 wholesale.

Naming follows the convention that the canonical name is the new (v4-capable)
variant, edited in place, and the frozen original gets a V1 suffix. A V1 twin is
created only where the canonical schema relaxes a required field to optional, so
that v1 keeps the original required-ness:

- Snapshot relaxes manifest-list -> SnapshotV1 keeps it required.
- CommitTableResponse relaxes metadata-location -> CommitTableResponseV1 keeps
  it required.

Because Snapshot is reached only through TableMetadata.snapshots, isolating the
v1 chain requires frozen copies of the containers as well, so v1 endpoints route
through LoadTableResultV1 / TableMetadataV1 / UnregisterTableResultV1 and the
corresponding V1 response wrappers. These containers are not themselves relaxing
anything; they exist only to carry the frozen SnapshotV1 and keep the v1 wire
contract byte-identical. TableMetadataV1 keeps format-version max 3, so v1
responses cannot represent a v4 table at all.

Schemas that only add an optional field (LoadTableResult, UnregisterTableResult
gain table-location; TableMetadata raises the format-version max) are shared:
adding an optional field does not change the v1 contract, so no twin is needed
there beyond the container copies required for Snapshot isolation.

Review note: the v1-side additions (the *V1 schemas, response wrappers, and the
re-added /v1 paths) are verbatim copies of the current definitions and can be
read as "unchanged from before" -- verified that each generated *V1 model is
byte-identical to its upstream original, and each /v1 path is byte-identical to
upstream modulo the response ref. The v2 side carries the incremental diff worth
reviewing: content-root, the manifest-list/root-manifest oneOf, table-location,
the metadata-location relaxation, and format-version max 4.

v2 operations are suffixed (loadTableV2 etc.) so the v1 operationIds stay
unchanged. make lint and make generate both pass.
Removes meta-commentary about the spec document from the descriptions added for
v4 -- phrases describing the schema mechanism rather than the API behavior
("enforced by the oneOf below", "stated normatively", "this is stated
explicitly", "cannot be expressed here because...") and a couple of redundant
justification tails. The normative rules and design rationale are unchanged;
only the wrapping prose is trimmed to match the terser style of the surrounding
spec. No schema or field semantics change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant