Context
Remaining spanvalue v0.5.0 opportunities not covered by #38 (dependency bump) or #39 (WriteRowIterator). Grouped for one or more follow-up PRs; no change to default CSV/jq output unless paired with the breaking-track issue.
Done
Proposed work (pick subset per PR)
A. Query stats / plan for CSV + WITH_STATS modes (medium)
WriteRowIterator returns RowIteratorResult (QueryPlan, QueryStats, RowsRead). CSV currently discards this; json eager mode embeds stats in the ResultSet shape.
Ideas (additive):
- Emit stats to stderr as JSON when
--query-mode is WITH_STATS or WITH_PLAN_AND_STATS and --format=experimental_csv.
- Or
--stats-file / documented convention for machine-readable side channel.
Tests: emulator or fixture iterator with stats fields populated.
B. CSV writer options (small)
--no-csv-header → writer.WithHeader(false) on NewCSVWriter.
- Document interaction with zero-row
SELECT (header-only vs headerless).
C. New export formats (larger, separate PRs ok)
| Format |
spanvalue API |
Notes |
experimental_jsonl |
NewJSONLWriter |
One JSON object per line; align formatter with CSV preset flag when added |
| SQL INSERT dump |
NewSQLInsertWriter |
Needs typed rows / GCV path; not a drop-in for current string jq pipeline |
D. Diagnostics hooks (small / optional)
RunRowIterator decorators: ObserveWriteRow, WithRowOrdinal for logging row progress on long exports—only if product wants visible progress without changing file format.
E. jq column naming consistency (small / if needed)
For unnamed STRUCT fields, align jq-visible column names with spanvalue using spanvalue.ColumnNames + same UnnamedFieldNamer as writer.WithUnnamedFieldNamer—only if golden/integration tests show a mismatch today.
References
- spanvalue
writer README: RowIterator, RowIteratorResult, hooks
- Prior trial notes:
/tmp/spanvalue-v0.5.0-alpha.2-feedback.md (local)
Acceptance (per sub-item)
Context
Remaining spanvalue v0.5.0 opportunities not covered by #38 (dependency bump) or #39 (
WriteRowIterator). Grouped for one or more follow-up PRs; no change to default CSV/jq output unless paired with the breaking-track issue.Done
NewCSVWritererror handling (#38)writeCsvFromRowIter→svwriter.WriteRowIterator(#39)Proposed work (pick subset per PR)
A. Query stats / plan for CSV +
WITH_STATSmodes (medium)WriteRowIteratorreturnsRowIteratorResult(QueryPlan,QueryStats,RowsRead). CSV currently discards this; json eager mode embeds stats in theResultSetshape.Ideas (additive):
--query-modeisWITH_STATSorWITH_PLAN_AND_STATSand--format=experimental_csv.--stats-file/ documented convention for machine-readable side channel.Tests: emulator or fixture iterator with stats fields populated.
B. CSV writer options (small)
--no-csv-header→writer.WithHeader(false)onNewCSVWriter.SELECT(header-only vs headerless).C. New export formats (larger, separate PRs ok)
experimental_jsonlNewJSONLWriterNewSQLInsertWriterD. Diagnostics hooks (small / optional)
RunRowIteratordecorators:ObserveWriteRow,WithRowOrdinalfor logging row progress on long exports—only if product wants visible progress without changing file format.E. jq column naming consistency (small / if needed)
For unnamed STRUCT fields, align jq-visible column names with spanvalue using
spanvalue.ColumnNames+ sameUnnamedFieldNameraswriter.WithUnnamedFieldNamer—only if golden/integration tests show a mismatch today.References
writerREADME: RowIterator,RowIteratorResult, hooks/tmp/spanvalue-v0.5.0-alpha.2-feedback.md(local)Acceptance (per sub-item)