Skip to content

docs: data-driven system-catalog reference, phase 3 (document mz_introspection per_worker variants) - #185

Draft
antiguru wants to merge 4 commits into
catalog-docs-data-phase2from
catalog-docs-data-phase3
Draft

antiguru wants to merge 4 commits into
catalog-docs-data-phase2from
catalog-docs-data-phase3

Conversation

@antiguru

Copy link
Copy Markdown
Owner

Motivation

Phase 3 of the system-catalog docs data migration.
Stacked on phase 2 (base branch catalog-docs-data-phase2); retarget down the stack as earlier phases land.

Description

Documents the 22 mz_introspection _per_worker relations whose parent is already documented, by adding each as a variant on its parent's YAML entry and removing its RELATION_SPEC_UNDOCUMENTED marker.
Refines the variants model: a variant carries its own full column list (name and type) sourced from the catalog, rendered as a 2-column table and lint-checked name-sorted.
This is necessary because an aggregating global view changes column types relative to its per-worker sibling (for example count is numeric in the global but bigint per worker), so a variant cannot reuse the base column types.
Variant columns are extracted from the live catalog, and bin/sqllogictest on the regenerated file proves every declared column name and type matches.
Three per-worker relations whose parent is undocumented or lives in mz_internal stay as RELATION_SPEC_UNDOCUMENTED markers, pending phases 4 and 5.

Verification

ci/test/lint-docs-catalog.sh passes, bin/sqllogictest passes on the regenerated test/sqllogictest/autogenerated/mz_introspection.slt (54/54), and hugo + link checks are clean. The generator has unit tests (ci/test/test_gen_per_worker_variants.py).

antiguru added 4 commits July 15, 2026 11:05
An aggregating global view can change a column's type relative to its
per-worker sibling (e.g. a numeric SUM(...) global count vs a bigint
per-worker count), so a per-worker variant is not safely derived as
base columns plus worker_id. A variant now carries its own full
column list (name and type, no meaning), rendered as a 2-column table
and lint-checked name-sorted against the catalog.
Per-worker variant descriptions claimed "the same data ... but reported
per worker," which is wrong for aggregating globals (many parents do
SUM/MIN/COUNT GROUP BY worker, so the per-worker relation is the
un-aggregated source, not the same data per worker). Reword to an
umbrella description that covers both filter- and aggregate-derived
globals, and apply it to the 23 existing per_worker variants.

Also fix the generator's marker removal to consume an adjacent blank
line when the marker sits alone between two blanks, and collapse the
resulting doubled blank lines already committed to mz_introspection.md.

Add add_variants coverage for the existing-variant (no duplication) and
orphan (no parent) skip paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant