v.24.8Improvement

Autodetect Non-XML/YAML Configuration File Format

Autodetect configuration file format if is not .xml, .yml or .yaml. If the file begins with < it might be XML, otherwise it might be YAML. It is useful when providing a configuration file from a pipe: clickhouse-server --config-file <(echo "hello: world"). #67391 (sakulali).
ClickHouse now supports autodetection of configuration file formats when the file extension is not .xml, .yml, or .yaml. The server checks the first character to infer whether the file is XML or YAML.

Why it matters

This feature addresses the inconvenience of specifying configuration files without standard extensions, especially when providing configuration via pipes. It improves usability by automatically detecting the format based on file content, allowing more flexible and streamlined configuration management.

How to use it

To use this feature, simply provide the configuration file to clickhouse-server without requiring it to have an .xml, .yml, or .yaml extension. If the file starts with a '<' character, it is treated as XML; otherwise, it is treated as YAML. For example, you can pass a configuration via a pipe like this:

clickhouse-server --config-file <(echo "hello: world")