Skip to content

clusterd-test-driver: parse s/u/t-prefixed global ids in specs#37880

Open
antiguru wants to merge 1 commit into
MaterializeInc:mainfrom
antiguru:mh/ctd-typed-global-ids
Open

clusterd-test-driver: parse s/u/t-prefixed global ids in specs#37880
antiguru wants to merge 1 commit into
MaterializeInc:mainfrom
antiguru:mh/ctd-typed-global-ids

Conversation

@antiguru

Copy link
Copy Markdown
Member

Motivation

clusterd-test-driver spec/text-format ids were raw u64s always mapped to
GlobalId::User, so a script had no way to target the system or transient
GlobalId namespaces. Some driver behavior can depend on the id's namespace,
so specs need to be able to select it explicitly.

Description

Ids now parse the same way GlobalId's own Display renders them: a bare
number (1000) defaults to the user namespace (unchanged, so every existing
.spec fixture keeps working as-is), and an explicit s/si/u/t prefix
(s42, u1000, t7) selects the namespace directly, via a new parse_id
helper in text.rs.

All Command and *Spec id fields (ImportSpec, BuildSpec, ExportSpec,
and the various Command variants) now carry GlobalId end to end instead of
a u64 that got wrapped in GlobalId::User at each call site in script.rs.
ScriptState's indexes/mv_outputs maps are keyed by GlobalId for the
same reason.

Verification

Extended text.rs's unit tests with parses_prefixed_ids, covering the bare,
u, t, and s forms plus a parse error for a garbage id. Updated the
existing tests' expectations from bare integer literals to GlobalId::User(..).
Ran cargo test -p mz-clusterd-test-driver (25/25 pass), cargo check, cargo clippy, and bin/fmt.

Script ids were raw u64s always mapped to GlobalId::User, so a spec
could not target the system or transient namespaces. Parse ids the
same way GlobalId's own Display does: a bare number defaults to the
user namespace, while an explicit s/si/u/t prefix (s42, u1000, t7)
selects the namespace directly. Spec and Command fields now carry
GlobalId end to end instead of wrapping a u64 at each call site.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@antiguru
antiguru marked this pull request as ready for review July 24, 2026 22:03
@antiguru
antiguru requested a review from DAlperin July 24, 2026 22:03
antiguru added a commit to antiguru/materialize that referenced this pull request Jul 24, 2026
Stacking on MaterializeInc#37880 (typed s/u/t-prefixed global ids in specs) makes the bare
`transient` export flag moot: an export id parses to `GlobalId::Transient`
directly from a `t` prefix. Drop the flag and its driver-side machinery (taken
from MaterializeInc#37880's rewrite of script.rs/text.rs), and mark the interactive query
dataflow's output `t4000` in two_runtime_query_dataflow.spec so the multiplexer
still routes it to the interactive runtime.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CY7GHdrTBfAG4tgvSgPGJ9
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