Context
spannerplan.ExtractQueryPlan already accepts three top-level JSON/YAML shapes (extract.go on v0.3.0):
ResultSetStats (queryPlan at the top level)
QueryPlan (planNodes at the top level)
ResultSet (stats at the top level), which is the only path that also returns metadata.rowType
The third shape is the one diagram rendering needs: spannerplanviz.visualize.BuildPlan(rowType, stats, ...) wants both the plan and the row type. Console-downloaded JSON is usually bare ResultSetStats and therefore loses rowType.
execspansql now emits a rows-less ResultSet envelope (metadata + full stats, no rows) as the --plan-output JSON/YAML artifact so the same bytes can be fed to ExtractQueryPlan without a new schema:
https://github.com/apstndb/execspansql/blob/ff4f7d15df6a88d8d4c9d9ba57e636fcc0c54bb7/output.go#L435-L458
spannerplan README does not mention ExtractQueryPlan or these shapes. spannerplanviz README shows ExtractQueryPlan(input) but does not describe the envelope. ECOSYSTEM.md talks about “Spanner plan input” without listing accepted documents.
Verified against github.com/apstndb/spannerplan@v0.3.0 (extract.go, README.md, ECOSYSTEM.md) and GitHub main. No existing issue.
Request
Document the rows-less ResultSet envelope (metadata.rowType + stats including queryPlan / queryStats / rowCount*, without rows) as an interchange shape that ExtractQueryPlan already accepts, alongside bare ResultSetStats and bare QueryPlan. README or ECOSYSTEM.md is enough; no API change required.
Note that only the ResultSet path returns rowType; callers who persist bare ResultSetStats cannot reconstruct it later.
Alternatives considered
- Treat Console
ResultSetStats JSON as the only public interchange. That drops rowType, which spannerplanviz uses for SerializeResult labels.
- Invent a new document type. Unnecessary: the protobuf
ResultSet with empty/omitted rows is already the wire type.
Downstream evidence
execspansql PR #95 (split --plan-output artifact) and #94 (in-process rendering that consumes rowType + stats). Merged at ff4f7d1.
Context
spannerplan.ExtractQueryPlanalready accepts three top-level JSON/YAML shapes (extract.goon v0.3.0):ResultSetStats(queryPlanat the top level)QueryPlan(planNodesat the top level)ResultSet(statsat the top level), which is the only path that also returnsmetadata.rowTypeThe third shape is the one diagram rendering needs:
spannerplanviz.visualize.BuildPlan(rowType, stats, ...)wants both the plan and the row type. Console-downloaded JSON is usually bareResultSetStatsand therefore losesrowType.execspansql now emits a rows-less
ResultSetenvelope (metadata+ fullstats, norows) as the--plan-outputJSON/YAML artifact so the same bytes can be fed toExtractQueryPlanwithout a new schema:https://github.com/apstndb/execspansql/blob/ff4f7d15df6a88d8d4c9d9ba57e636fcc0c54bb7/output.go#L435-L458
spannerplanREADME does not mentionExtractQueryPlanor these shapes.spannerplanvizREADME showsExtractQueryPlan(input)but does not describe the envelope.ECOSYSTEM.mdtalks about “Spanner plan input” without listing accepted documents.Verified against
github.com/apstndb/spannerplan@v0.3.0(extract.go,README.md,ECOSYSTEM.md) and GitHubmain. No existing issue.Request
Document the rows-less
ResultSetenvelope (metadata.rowType+statsincludingqueryPlan/queryStats/rowCount*, withoutrows) as an interchange shape thatExtractQueryPlanalready accepts, alongside bareResultSetStatsand bareQueryPlan. README orECOSYSTEM.mdis enough; no API change required.Note that only the
ResultSetpath returnsrowType; callers who persist bareResultSetStatscannot reconstruct it later.Alternatives considered
ResultSetStatsJSON as the only public interchange. That dropsrowType, which spannerplanviz uses forSerializeResultlabels.ResultSetwith empty/omittedrowsis already the wire type.Downstream evidence
execspansql PR #95 (split
--plan-outputartifact) and #94 (in-process rendering that consumesrowType+stats). Merged atff4f7d1.