v.21.4Improvements
Improve clickhouse-format error handling for queries
Improveclickhouse-formatto not throw exception when there are extra spaces or comment after the last query, and throw exception early with readable message when formatASTInsertQuerywith data . #21311 (flynn).
Why it matters
This feature addresses robustness and usability issues in theclickhouse-format tool by preventing unexpected exceptions caused by trailing spaces or comments, and by providing clearer, earlier error messages when attempting to format insert queries containing data. This improves the developer experience by making error diagnostics easier and avoiding disruptions during formatting.How to use it
Use theclickhouse-format tool as usual. The tool now automatically tolerates extra spaces or comments after the last query without raising errors, and if you format an ASTInsertQuery that includes data, the tool will produce a readable error message early in the process.