Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support unnest with additional columns #9400

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

jonahgao
Copy link
Member

@jonahgao jonahgao commented Feb 29, 2024

Which issue does this PR close?

Closes #9349.

Rationale for this change

The UnnestExec already has this functionality.

This PR passes the necessary parameters, i.e., the expressions in the select list that do not need unnesting, to it.

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

No

@jonahgao jonahgao marked this pull request as draft February 29, 2024 09:11
@github-actions github-actions bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Feb 29, 2024
@jonahgao jonahgao marked this pull request as ready for review February 29, 2024 13:21
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you very much for this contribution @jonahgao -- this PR looks very nice to me (as usual)

4 2
5 2
6 3
12 NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

💯 for testing nulls

let column = expr.display_name()?;

let unnest_column = unnest_columns.pop().unwrap();
// Set preserve_nulls to false to ensure compatibility with DuckDB and PostgreSQL
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@jonahgao
Copy link
Member Author

jonahgao commented Mar 1, 2024

Thank you very much for this contribution @jonahgao -- this PR looks very nice to me (as usual)

Thank you for the review!

Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

LGTM Thanks, @jonahgao

@jayzhan211 jayzhan211 merged commit 10d5f2d into apache:main Mar 1, 2024
24 checks passed
@jonahgao jonahgao deleted the unnest_extra_column branch March 1, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnest function doesn't work as expected with additional columns
3 participants