Skip to content

[CALCITE-7791] UNNEST of a single-field ROW array loses the field nam… - #5271

Open
sbroeder wants to merge 1 commit into
apache:mainfrom
sbroeder:7791
Open

sbroeder wants to merge 1 commit into
apache:mainfrom
sbroeder:7791

Conversation

@sbroeder

Copy link
Copy Markdown
Contributor

…e when aliased

Extend AliasNamespace's CALCITE-5779 COLLECTION_TABLE check to also cover UNNEST when the array's component type is a struct

Jira Link

CALCITE-7791

}

/**
* Returns whether an UNNEST call's array operand has a struct element type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware that unnest has two semantics, depending on conformance: the Trino semantics does not create a column for each ROW column, and the standard semantics does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was not aware. Thank you for catching that.

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Sep 19, 2026
@mihaibudiu

Copy link
Copy Markdown
Contributor

I think you can squash the commits for merging

…e when aliased

Extend AliasNamespace's CALCITE-5779 COLLECTION_TABLE check to also
cover UNNEST when the array's component type is a struct.

With allowAliasUnnestItems=true (Trino), UNNEST does not
expand struct columns and instead uses the alias directly.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants