ContentSquare / chproxy

Open-Source ClickHouse http proxy and load balancer
https://www.chproxy.org/
MIT License
1.24k stars 256 forks source link

[Feature] allow log_comment in query parameters #431

Open profick opened 2 months ago

profick commented 2 months ago

Is your feature request related to a problem? Please describe. Currently CHProxy restricts most query_parameters including log_comment. I need to use log_comment query parameter to add additional information to system.query_log table, in my particular case - to distinguish paragraphs (notes) that run Clickhouse queries from the same CHProxy user. I can't update SETTINGS clause of the query because log_comment is provided via query_parameter in jdbc connection.

Describe the solution you'd like Add log_comment to allowedParams. This parameter is safe and doesn't affect caching logic of CHProxy.

Documentation of log_comment

Describe alternatives you've considered As a general solution for parameters related issues - allow to customize allowedParams list (add custom values) in configuration file. Just like we allow to set user's params but for incoming query parameters, not constant values. There is possibility of cache related problems, therefore it should be noted in documentation that custom params do not affect caching logic.

Additional context