v.23.9Improvement

Parse JSON as JSONEachRow when metadata parsing fails

Parse data in JSON format as JSONEachRow if failed to parse metadata. It will allow to read files with .json extension even if real format is JSONEachRow. Closes #45740. #54405 (Kruglov Pavel).
ClickHouse now attempts to parse data in JSON format as JSONEachRow if metadata parsing fails, enabling seamless reading of .json files that are actually in JSONEachRow format.

Why it matters

This feature solves the issue where files with a .json extension, which are formatted as JSONEachRow, fail to be read correctly due to metadata parsing errors. It improves user experience by automatically handling such cases without requiring manual format specification, ensuring robust and flexible JSON data ingestion.

How to use it

Users can simply read files with .json extension as usual without manually specifying the input format. If the metadata parsing fails, ClickHouse will automatically try to parse the data using JSONEachRow format, requiring no additional configuration.