clusterd-test-driver: add explain verb to assert optimized plan shape#37141
Open
antiguru wants to merge 1 commit into
Open
clusterd-test-driver: add explain verb to assert optimized plan shape#37141antiguru wants to merge 1 commit into
explain verb to assert optimized plan shape#37141antiguru wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #37008 (now merged), addressing DAlperin's review on
join.spec: a script usingoptimizeasserts only the result, so optimizer or lowering drift could silently change the plan under test.explainrenders the lowered LIR plan (theEXPLAIN PHYSICAL PLANform, via a no-catalogDummyHumanizerso ids areu<n>and columns#n) as its golden, submitting nothing. It takes the dataflow either inline (thecreate-dataflowbody) or by reference —explain ref=<name>renders a dataflow a priorcreate-dataflow name=<name>declared, without repeating its body.join.specdeclares the join, thenexplain ref=joinasserts the differential-join plan alongside the count.The multi-object render separates objects with blank lines, so the
.specformat gains thedatadrivendoubled-----block form, emitted automatically byREWRITE.🤖 Generated with Claude Code