+1 for this direction. I just wanted to add that we should provide a way to retrieve or materialize the metadata.json file via the REST Catalog API for those who still need it. Whether this is done through a dedicated endpoint or by embedding the capability into existing ones like loadTable or unregisterTable, API support for this would be very helpful.
Best, Gang On Thu, Dec 3, 2026 at 2:14 AM Amogh Jahagirdar <[email protected]> wrote: > Hi Kevin, > > Thanks for starting this thread. I'm +1 on making metadata.json optional > in storage. > > My position on this has changed. Almost three years ago, in an earlier > thread on the REST spec and the table spec ( > http://www.mail-archive.com/[email protected]/msg05674.html), I was > against this, mostly because of interoperability and lock-in concerns. Back > then the metadata file in storage was the most reliable way to move a table > between catalogs. Since then there are a lot more IRC options, both OSS and > from vendors, so users have real choice in catalogs that speak the same > protocol. The protocol is now the mechanism that makes tables portable, and > I think the spec should reflect that. > > To Kevin's point, this further improves write latencies, and it also > addresses other cases of bloated metadata, like wide schemas that went > through many evolutions, where catalogs can manage that without adding > complexity to the format. > > Peter, I understand the concerns, but I think we can address them: > > 1. On unregisterTable, we can't force every implementation to support it. > But portability is a big reason people pick an open table format in the > first place, so catalogs have a strong reason to offer a way to move tables > out. I think that works better than anything we could enforce in the spec. > > 2. Even without unregisterTable, the loadTable response has the full table > metadata, so anyone who needs a metadata.json file can write one from it. > > 3. On catalog load from distributed workers, I looked at the Spark and > Flink integrations in the Java reference implementation, and I'd appreciate > input from others on what other engines do. The dominant case is that > workers get a SerializableTable, a read-only copy of the table with a > subset of its metadata, like the schema, specs and FileIO. That's all Spark > reads and writes and Flink sink writers and source readers need, so they > never read the metadata file or call the catalog. The rarer case is a > worker that needs the full metadata. Flink operators that need the latest > state, like committers, split enumerators and maintenance tasks, already > load the table from the catalog for that. The one case I found that reads > the full metadata file from storage instead is Flink's data file rewrite in > table maintenance. Without the file, that case has the same choice as any > other: broadcast the full metadata or load it from the catalog. > > 4. I don't think current implementations should dictate how we change the > spec, and these assumptions are easy to fix without much of a tradeoff. For > REST tables, these are the places in the Java implementation that still > expect a metadata file: > - RESTTableOperations skips applying new metadata on refresh and commit > when there's no metadata location, so it would need a different way to > compare. > - SerializableTable reads the metadata file in that Flink rewrite case. It > could carry the already loaded TableMetadata instead (StaticTableOperations > already supports this), or the rewrite could load from the catalog. > - The history, snapshots, refs, metadata_log_entries and partitions > metadata tables don't read the file, but use its path to name their scan > task, so they'd simply just need a different name as far as I can tell. > - Spark purgeTable, DeleteReachableFiles, RewriteTablePath and orphan file > removal start from or walk metadata file paths. The metadata file part of > these is mostly moot if the catalog isn't producing metadata files on write. > > Thanks, > Amogh > > On Wed, Dec 2, 2026 at 4:08 PM Renjie Liu <[email protected]> wrote: > >> Hi, Kevin: >> >> Thanks for raising this. +1 for this direction. >> >> On Wed, Dec 2, 2026 at 1:57 PM Péter Váry <[email protected]> >> wrote: >> >> Hi Kevin, >> >> Is unregisterTable mandatory? Do we enforce interoperability? Or we will >> rely on well informed users who will migrate only to catalogs where this >> function is available if portability is a concern for them? >> >> Non-destructive fetch of full metadata json would be useful for cases >> where algorithmic processing of table data is needed. >> >> I would definitely go through the cases in our codebase where metadata >> json is used today, and find a solution for them before changing the spec. >> There are some legitimate cases where we want to share the exact, current >> state of the table between multiple executors and we don't want to add more >> load on the catalogs to serve these requests. >> >> Thanks, >> Peter >> >> >> >> On Tue, Dec 1, 2026, 22:29 Xander Bailey <[email protected]> wrote: >> >> Hi Kevin, >> >> +1, and I'd like to push harder on the encryption point. I think it's a >> core reason to do this. >> >> Encrypted tables still keep metadata.json in plaintext, which leaks >> things like column names (diagnosis_code, salary, ...). >> >> Looking further ahead, catalog-owned metadata could also open the door to >> things like branch or version-level permissions. I don't want to sidetrack >> this thread with that, but it could be worth exploring later if we go this >> way. >> >> Best, >> Xander >> >> >> On Tue, 1Dec 2026 at 12:33, Kevin Liu via dev <[email protected]> >> wrote: >> >> Hi everyone, >> >> I want to continue the discussion on making the `metadata.json` file in >> storage optional and relying on the REST catalog response instead. This has >> come up in a few past threads [1][2][3], and it recently came up again in >> the `loadTableV2` discussion in PR #17642 [4], so I think it warrants its >> own discussion thread. >> >> My main motivation is speeding up streaming and high-frequency writes, >> especially combined with v4 single-file commits. Today the commit protocol >> requires writing a new `metadata.json` file to object storage on every >> commit. Making it optional removes that extra storage I/O from the commit >> path. There are other benefits too, like cheaper commit retries (on a >> conflict, the catalog no longer has to write and discard a `metadata.json` >> file), avoiding plaintext metadata files for encrypted tables, and letting >> catalogs control access to table metadata (for example, redacting sensitive >> metadata) instead of clients reading it directly from storage. >> >> The main concern from past discussions is interoperability and catalog >> lock-in. The `unregisterTable` endpoint [5] helps address migration since a >> catalog can materialize and return the final `metadata.json` and >> `metadata-location` when moving a table to another catalog. One gap is that >> `unregisterTable` is destructive, so it doesn't cover non-destructive >> export for backup, DR, or debugging. `loadTable?snapshots=all` covers part >> of that, and we could also consider a dedicated export endpoint. >> >> If we move forward, here is the work I think we need to get there: >> >> 1. Update the table spec [6] so commits no longer require writing a new >> `metadata.json` file to storage on every commit, as long as the catalog >> guarantees atomic commits and a linear history. >> 2. Update the REST spec to clarify optional `metadata-location` across >> `LoadTableResult` [7] (currently optional for staged creates) and >> `CommitTableResponse` [8] (currently required), and clarify the portability >> contract for `unregisterTable` and `loadTable?snapshots=all`. >> 3. Remove hard dependencies on `metadata.json` in storage across clients >> and engines, such as `RESTTableOperations`, `SerializableTable`, >> `StaticTableOperations`, static metadata tables, and maintenance actions >> (Yufei started tracking these in [9]). >> >> I'd like to use this thread to build consensus on making `metadata.json` >> optional in storage. One open question is scope: should this apply to v4 >> tables only, or to any table loaded through `loadTableV2`? Existing clients >> expect `metadata-location` in `CommitTableResponse`, which is part of why >> scope matters. >> >> Let me know what you think! >> >> Best, >> Kevin Liu >> >> [1] https://lists.apache.org/thread/clfpm1spd0k6rrvwm3nbt1cs3so7tsjt >> [2] https://lists.apache.org/thread/l1onvv5p5cq2vtql9g8w5fbxc1hhd65l >> [3] https://lists.apache.org/thread/5g6zfo0yyw8k5lzdd266sb270rxh7tnn >> [4] https://github.com/apache/iceberg/pull/17642 >> [5] >> https://github.com/apache/iceberg/blob/121c73fcdcdc7d851ce65634e92fd2a5dc6c3254/open-api/rest-catalog-open-api.yaml#L1374-L1388 >> [6] >> https://github.com/apache/iceberg/blob/121c73fcdcdc7d851ce65634e92fd2a5dc6c3254/format/spec.md?plain=1#L1476-L1480 >> [7] >> https://github.com/apache/iceberg/blob/121c73fcdcdc7d851ce65634e92fd2a5dc6c3254/open-api/rest-catalog-open-api.yaml#L4280-L4336 >> [8] >> https://github.com/apache/iceberg/blob/121c73fcdcdc7d851ce65634e92fd2a5dc6c3254/open-api/rest-catalog-open-api.yaml#L5367-L5376 >> [9] >> https://docs.google.com/document/d/17PBhJ0IBxHxMKvCW6CstGOp7cZnboMDdpO6BCPO2kmA/edit?usp=sharing >> >>
