v.24.3Improvement

Support Output Format Detection by File Extension in ClickHouse Clients

Support detect output format by file exctension in clickhouse-client and clickhouse-local. #61036 (豪肥肥).
Support detection of output format by file extension in clickhouse-client and clickhouse-local tools.

Why it matters

This feature allows users to automatically infer the desired output format based on the file extension of the specified output file, simplifying the process of formatting query results. It helps avoid manually specifying the --format option and reduces errors related to format specification.

How to use it

When using clickhouse-client or clickhouse-local, specify the output file with an extension corresponding to the desired output format (e.g., .json, .tsv, .csv). The tool will automatically detect and apply the appropriate output format based on the file extension.