Skip to content

duckdb: report unsupported star modifiers during query analysis - #4700

Open
1akashkalita wants to merge 1 commit into
sqlc-dev:mainfrom
1akashkalita:codex/duckdb-modified-star
Open

1akashkalita wants to merge 1 commit into
sqlc-dev:mainfrom
1akashkalita:codex/duckdb-modified-star

Conversation

@1akashkalita

Copy link
Copy Markdown

Fixes #4660.

With SELECT * EXCLUDE (secret) FROM people, DuckDB can return several columns. On current main, sqlc analyze reports one untyped column named ?column?. The same happens for * REPLACE, and Go generation eventually fails on the question mark in the generated source.

This takes the issue's suggested error-at-generation approach. The DuckDB converter identifies star expressions whose output shape sqlc cannot yet determine. Analysis then reports the unsupported expression at the query, before code generation. Plain and qualified stars continue through the existing expansion path.

The CLI regression covers both EXCLUDE and REPLACE. I reproduced the incorrect JSON on main and checked the diagnostics with both sqlc analyze and sqlc generate. These passed locally with Go 1.26.5 and CGO_ENABLED=0:

  • go test ./internal/core/... ./internal/engine/duckdb/... ./internal/compiler/... ./internal/sql/...
  • go test ./internal/endtoend -run '^TestReplay$/^base$'

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.

duckdb: SELECT * EXCLUDE (...) and * REPLACE (...) give one untyped column and no error

1 participant