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

[WIP] Array flatten function #4409

Merged
merged 4 commits into from
Mar 1, 2019
Merged

[WIP] Array flatten function #4409

merged 4 commits into from
Mar 1, 2019

Conversation

kzon
Copy link
Contributor

@kzon kzon commented Feb 15, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

For changelog. Remove if this is non-significant change.

Category:

  • New Feature

Short description:

Add function flatten for converting array of arrays to flat array.
Example:
flatten([[1, 2, 3], [4, 5]]) = [1, 2, 3, 4, 5]

@kzon
Copy link
Contributor Author

kzon commented Feb 15, 2019

@alexey-milovidov I need your advice. It looks like there is no methods for interpreting individual Fields as arrays of arrays. How we can do it? Do we need new GatherUtils function? Or I missed something about memory layout of Field?

@kzon kzon changed the title WIP: Array flatten function [WIP] Array flatten function Feb 15, 2019
@alexey-milovidov
Copy link
Member

alexey-milovidov commented Feb 15, 2019

interpreting individual Fields as arrays of arrays.

Field can be Array. Array is std::vector<Field>. Array elements can also be Array that means we have multidimensional array.

@alexey-milovidov
Copy link
Member

I have completed the implementation, you can read code along with comments.

alexey-milovidov added a commit that referenced this pull request Mar 1, 2019
alexey-milovidov added a commit that referenced this pull request Mar 1, 2019
@alexey-milovidov alexey-milovidov merged commit 58b94db into ClickHouse:master Mar 1, 2019
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