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

Support unnest for struct data type #10264

Closed
duongcongtoai opened this issue Apr 27, 2024 · 2 comments · Fixed by #10429
Closed

Support unnest for struct data type #10264

duongcongtoai opened this issue Apr 27, 2024 · 2 comments · Fixed by #10429
Labels
enhancement New feature or request

Comments

@duongcongtoai
Copy link
Contributor

duongcongtoai commented Apr 27, 2024

Is your feature request related to a problem or challenge?

Support unnest for struct data type, an example of such feature in Duckdb

D CREATE TABLE t1 (s STRUCT(v VARCHAR, i INTEGER));
D INSERT INTO t1 VALUES (ROW('a', 42)),(ROW('b', 43));
D select unnest(s) from t1;
┌─────────┬───────┐
│    v    │   i   │
│ varchar │ int32 │
├─────────┼───────┤
│ a       │    42 │
│ b       │    43 │
└─────────┴───────┘

Describe the solution you'd like

We already have UnnestExec that support unnest on list data type, where each item in a list value will result into a new row into the output.
But unnest for struct does almost different thing, where number of output row is expected to stay the same as the input, and only the number of output columns increase. Maybe we should add a new executor for this type of operation like "StructUnnestExec"

Describe alternatives you've considered

No response

Additional context

No response

@duongcongtoai
Copy link
Contributor Author

I would like to work on this

@duongcongtoai
Copy link
Contributor Author

Please help me review this PR everyone #10429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant