v.19.4New Features

Implemented Function Flatten

Implemented function flatten. #4555 #4409 (alexey-milovidov, kzon)
Introduced the flatten function to ClickHouse for transforming nested arrays or tuples into a flattened sequence of elements.

Why it matters

The new flatten function addresses the need to simplify complex nested data structures by converting nested arrays or tuples into a single-level sequence. This enhances data manipulation and querying capabilities on nested data, making it easier for users to work with hierarchical or deeply nested datasets.

How to use it

Use the flatten function in your SQL queries by passing a nested array or tuple as the argument. For example:

SELECT flatten(nested_column) FROM table_name;

This will return all the nested elements in a flat sequence, enabling more straightforward aggregation or filtering.