Skip to content

clusterd-test-driver: add explain verb to assert optimized plan shape#37141

Open
antiguru wants to merge 1 commit into
MaterializeInc:mainfrom
antiguru:headless-driver-explain
Open

clusterd-test-driver: add explain verb to assert optimized plan shape#37141
antiguru wants to merge 1 commit into
MaterializeInc:mainfrom
antiguru:headless-driver-explain

Conversation

@antiguru

Copy link
Copy Markdown
Member

Follow-up to #37008 (now merged), addressing DAlperin's review on join.spec: a script using optimize asserts only the result, so optimizer or lowering drift could silently change the plan under test.

explain renders the lowered LIR plan (the EXPLAIN PHYSICAL PLAN form, via a no-catalog DummyHumanizer so ids are u<n> and columns #n) as its golden, submitting nothing. It takes the dataflow either inline (the create-dataflow body) or by reference — explain ref=<name> renders a dataflow a prior create-dataflow name=<name> declared, without repeating its body. join.spec declares the join, then explain ref=join asserts the differential-join plan alongside the count.

The multi-object render separates objects with blank lines, so the .spec format gains the datadriven doubled----- block form, emitted automatically by REWRITE.

🤖 Generated with Claude Code

Per review (DAlperin): a script using `optimize` asserts only the result, so
optimizer or lowering drift could silently change the plan under test. `explain`
renders the lowered LIR plan (the `EXPLAIN PHYSICAL PLAN` form, via a no-catalog
`DummyHumanizer` so ids are `u<n>` and columns `#n`) as its golden, submitting
nothing.

It takes the dataflow either inline (the same body as `create-dataflow`) or by
reference: `explain ref=<name>` renders a dataflow a prior `create-dataflow
name=<name>` declared, without repeating its body. `join.spec` declares the join,
then `explain ref=join` asserts the differential-join plan alongside the count.

The multi-object render separates objects with blank lines, so the `.spec` format
gains the `datadriven` doubled-`----` block form, emitted automatically by
`REWRITE`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antiguru antiguru marked this pull request as draft June 18, 2026 19:20
@antiguru antiguru marked this pull request as ready for review June 18, 2026 19:29
@antiguru antiguru requested a review from DAlperin June 18, 2026 19:29
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