v.22.2Improvement

Add Options for clickhouse-format: max_query_size and max_parser_depth

Add options for clickhouse-format. Which close #30528 - max_query_size - max_parser_depth. #34349 (李扬).
Added new options max_query_size and max_parser_depth to the clickhouse-format tool to control query size and parsing depth.

Why it matters

These options allow users to configure limits on the size of the input query and the maximum depth of the parser recursion, improving stability and preventing resource exhaustion when formatting very large or complex queries.

How to use it

Use the clickhouse-format command-line tool with the new options --max_query_size and --max_parser_depth to specify the desired limits, for example:

clickhouse-format --max_query_size=100000 --max_parser_depth=100