Skip to content

fix(playground): repeated result names as the statement returns them, and whole raised messages - #137

Merged
kvlonge merged 2 commits into
mainfrom
fix/playground-run-display
Nov 7, 2026
Merged

kvlonge merged 2 commits into
mainfrom
fix/playground-run-display

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #132, stacked on it: base feat/playground-sample-schema at 8f8b12e, one commit. The coordinator queues it after #135 and ahead of D315.

1. Repeated result names (D335). The Run stage wraps each translation in SELECT COLUMNS(*)::VARCHAR FROM (<sql>) AS result. DuckDB renames a repeated name inside a subquery, so SELECT order_id, order_id came back as ORDER_ID, ORDER_ID_1. Reading rows with row.toJSON() would also collapse duplicate keys into a single column. The fix:

  • The header now uses the names DESCRIBE <sql> returns. DESCRIBE only binds the statement, it doesn't run it, and it keeps top-level names exactly as DuckDB 2.0 and Snowflake return them.
  • Values are read by column index.
  • If DESCRIBE fails, or its names don't line up with the result's columns, the header falls back to the wrapper's names.
  • Checked in the browser's DuckDB-WASM v2.0.0: DESCRIBE gives ORDER_ID, ORDER_ID, and the rendered table shows both columns, each with its own values.

2. "Can't" cut (#132 audit note). run_failure used to end a raised message at the first quote after the tag. So "Can't parse the text as date with the format" (100097/100096) and the TIME format message read back as "Can". It now ends at the last quote on the line, which is the one DuckDB closes the tagged text with. Native DuckDB 2.0.0 prints the quote unescaped: Could not convert string 'sqlquack:100097#…: Can't parse … format' to INT32.

Tests (npm run test:engine, 12 pass):

  • A format mismatch raised by TO_DATE(note, 'YYYY-MM-DD') under the repository policy reads back with errno 100097, the full message, and the raise ID pointing at the TO_DATE span.
  • A result with two ORDER_ID columns renders two ORDER_ID headers with each column's own values, NULL included.

fmt, fensu and the hygiene scan are clean.

…aised messages

The Run stage reads each column's values by position and labels the
header with DESCRIBE's names, so `SELECT order_id, order_id` shows two
ORDER_ID columns with their own values instead of the wrapper's ORDER_ID_1,
or one column when rows were read as objects.

run_failure ends a raised message at the last quote on its line, the one
DuckDB closes the tagged text with, so messages holding a quote, such as
"Can't parse the text as date with the format", read back whole.
@kvlonge
kvlonge changed the base branch from feat/playground-sample-schema to main November 7, 2026 03:04

kvlonge commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Gate passed on the exact head 1362af4: #137 at 17beff1 (auditor record 5ca1484), merged with main 99e4ab3.

  • make check-merge RECORDER=0: exit 0 in 44m13s. fensu reported 0 faults.
  • make verify-recorded: exit 0 in 23m12s. 12,033 cases: 7,997 passed, 1,035 diverged as expected, 2,964 refused, 37 typed, 0 pending, 0 unproven, 0 failed; 226 of 226 equivalences and rules verified. The translation results have 0 regressions against the baseline.
  • The public-repository hygiene scan is clean.

GitHub Actions can't run because of the account billing block, so this local gate is the check for this landing.

@kvlonge
kvlonge merged commit 1362af4 into main Nov 7, 2026
1 of 2 checks passed
@kvlonge
kvlonge deleted the fix/playground-run-display branch November 9, 2026 21:32
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