v.21.1Improvements

Allow CSV Parsing of Serialized Array Fields as Strings

Allow to parse Array fields from CSV if it is represented as a string containing array that was serialized as nested CSV. Example: "[""Hello"", ""world"", ""42"""" TV""]" will parse as ['Hello', 'world', '42" TV']. Allow to parse array in CSV in a string without enclosing braces. Example: "'Hello', 'world', '42"" TV'" will parse as ['Hello', 'world', '42" TV']. #18271 (alexey-milovidov).
ClickHouse now supports parsing Array fields from CSV data when the array is represented as a serialized nested CSV string, including both formats with enclosing brackets and without enclosing braces.

Why it matters

This feature addresses the problem of importing arrays stored as strings in CSV files, enabling users to correctly deserialize arrays from complex CSV string representations. It improves data ingestion flexibility and correctness when handling array-type columns from CSV inputs.

How to use it

When importing CSV data containing Array fields serialized as nested CSV strings, simply use the existing CSV input format. The parser will automatically recognize and correctly parse array fields whether they are enclosed in brackets (e.g., "["Hello", "world"]") or provided as quoted CSV strings without braces (e.g., "'Hello', 'world'"), converting them into proper ClickHouse Array types.