Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Catalog schema versions

Every GeoParquet artifact written by geocatalog carries a reserved _schema_version column. Readers (from_geoparquet, DuckDBGeoCatalog.open) check it on load and dispatch on three cases:

CaseBehaviour
v_artifact == v_currentLoad directly.
v_artifact < v_currentChain forward migrations (in-memory backend only).
v_artifact > v_currentRaise [CatalogSchemaError][geocatalog.backends.CatalogSchemaError].

The current reader version is [SCHEMA_VERSION_CURRENT][geocatalog.storage.SCHEMA_VERSION_CURRENT]. Bump it whenever the on-disk schema changes substantively (new required column, renamed reserved column, changed semantics of an existing field). Bumping also requires registering a forward migration in the _MIGRATIONS table next to the GeoParquet reader.

Why bother

Without _schema_version, an artifact written by tomorrow’s library loads silently in today’s library — the columns line up by name but the meaning may have shifted. The Delta Lake protocol-versioning model (reference) catches that explicitly: writers stamp the version; readers refuse versions newer than they understand.

Migration policy

CLI

$ geocatalog migrate v0_artifact.parquet
wrote v0_artifact.parquet (v0 -> v1)

$ geocatalog migrate v0_artifact.parquet
v0_artifact.parquet already at v1

--to-version defaults to the reader’s current version. The command exits with status 2 if the artifact is newer than the reader (you need to upgrade geocatalog).

Version history

VersionReleasedChange
0initialFirst versioned schema. filepath / geometry / start_time / end_time columns; reserved _backend / _schema_version.
1state catalogReserves the model-state columns kind (string: analysis / forecast / reanalysis), run_time (timestamp[us], naive UTC), member (string), producer (string) and parents (list<string>). A state catalog is one with a run_time column, and it carries all five; elsewhere the names are ordinary extras (a kind of "L2" is left alone). Migration v0 → v1: a catalog without run_time is unchanged (DuckDB opens it without migrate); one whose extras were filled by hand is typed (member 0 becomes "0"), its kind checked, and the missing columns added as nulls. append_files writes new shards at the archive’s own version, so a v0 archive stays at one version. See Model states.

This table grows as the schema evolves.