Appendix: No Docker? The Filesystem Catalog, and What It Costs

Add a second catalog to the same Spark server. Don't replace hms; having both defined lets you run the same statements against each in one session:

bash — a second catalog, zero infrastructure

    --conf spark.sql.catalog.fs=org.apache.iceberg.spark.SparkCatalog \
    --conf spark.sql.catalog.fs.type=hadoop \
    --conf spark.sql.catalog.fs.warehouse=$PWD/warehouse-fs \
    --conf spark.sql.catalog.fs.cache-enabled=false

Now run the Lab: create the table part's CREATE TABLE against fs.db.orders instead. Two things behave differently before you have even inserted a row:

Namespaces become implicit. CREATE NAMESPACE is no longer required — a namespace here is a subdirectory, invented the moment you name one. HMS needs a DBS row to exist first, which is why the Lab: create the table part has that extra statement.

The pointer is a file again. Walk the metadata directory and it looks like this instead of the Walk the raw files section's listing:

bash

$ find warehouse-fs/db/orders/metadata -type f -not -name '.*'
warehouse-fs/db/orders/metadata/v1.metadata.json
warehouse-fs/db/orders/metadata/v2.metadata.json
warehouse-fs/db/orders/metadata/v3.metadata.json
warehouse-fs/db/orders/metadata/version-hint.text
...
$ cat warehouse-fs/db/orders/metadata/version-hint.text
3

Sequential, guessable filenames and a plain text file naming the current one. That is the entire catalog. It also makes the Read metadata.json straight, in Go section easier — you can read version-hint.text, build the path, and open v3.metadata.json directly, with no metadata_log_entries query needed. The convenience and the weakness are the same property.

A commit here is: write v4.metadata.json under a name you guessed, then atomically rename a new version-hint.text over the old one. Two writers guess the same name. One rename wins. The loser's HadoopTableOperations.commit() catches it, silently re-reads the v4 that just appeared, rebuilds its change as v5, and retries — all before returning control to the caller. Observed on a real run of the Lab: two writers, one table part's test against this catalog: three rounds, two writers each, all six commits succeeded and all six rows landed. From Go, both calls simply took slightly different amounts of time to come back nil.

Which is exactly why it is dangerous. It looks identical from the outside, and the retry loop is real. But nothing serialized those writers — and the whole thing rests on rename being atomic, which is true on a local POSIX filesystem and false on S3, where a rename is a copy plus a delete with no atomicity anywhere in it. Run the Push it until something actually fails section's twenty-goroutine burst against fs.db.orders and you'll exhaust the bounded retry and see a CommitFailedException come back to Go; on a laptop that is a curiosity, and on object storage with concurrent writers it is the failure mode that silently loses a snapshot.

Filesystem catalog (type=hadoop)HMS + Postgres (type=hive)
Where the pointer livesversion-hint.text, a fileTABLE_PARAMS.metadata_location, a row
How a commit swaps itAtomic filesystem renameMetastore lock, or alter_table CAS
Metadata file namingv1, v2, v3… — guessable, collidable00001-<uuid> — private per writer
Concurrent writersBounded retry, never serializedGenuinely serialized
Safe on object storageNo — S3 has no atomic renameYes — the pointer isn't on S3 at all
NamespacesImplicit, a subdirectoryExplicit, a DBS row
Other engines can attachOnly by sharing the filesystemTrino, Flink, Hive — point them at :9083
Finding the current metadatacat version-hint.textpsql, or metadata_log_entries
InfrastructureNoneTwo containers and a JDBC driver