Skip to content

fix(starrocks): don't default column names for multi-array UNNEST - #8671

Merged
georgesittas merged 1 commit into
tobymao:mainfrom
nytai:starrocks-unnest-default-alias
Oct 19, 2026
Merged

georgesittas merged 1 commit into
tobymao:mainfrom
nytai:starrocks-unnest-default-alias

Conversation

@nytai

@nytai nytai commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Problem

A StarRocks UNNEST with several arrays and no column names was generated with a single-column alias, which StarRocks rejects:

SELECT * FROM t, UNNEST(a, b)  -- generated as UNNEST(a, b) AS unnest(unnest)
-- table unnest has 2 columns available but 1 columns specified

Solution

Only add the default unnest column name for a single array. StarRocks names every column of a multi-array UNNEST unnest, so no column list matches it, and the table alias alone keeps the statement valid.

…AUDE]

StarRocks names every column of a multi-array UNNEST "unnest", but sqlglot
added the single-column alias AS unnest(unnest), which StarRocks rejects with
"table unnest has 2 columns available but 1 columns specified". The default
column name is now only added for a single array.
@georgesittas
georgesittas merged commit b06ed8e into tobymao:main Oct 19, 2026
9 checks passed
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.

2 participants