ClickHouse / clickhouse-java

ClickHouse Java Clients & JDBC Driver
https://clickhouse.com
Apache License 2.0
1.45k stars 535 forks source link

[client-v2] Added setting log_comment #1864

Closed chernser closed 2 weeks ago

chernser commented 1 month ago

Summary

There is an option to set a comment that will be seen in system.query_log record associated with a query. It is useful for troubleshooting. In case of HTTP interface client should send the comment thru query parameter log_comment.

Closes: https://github.com/ClickHouse/clickhouse-java/issues/1836

Checklist

Delete items not relevant to your PR:

chernser commented 2 weeks ago

Thanks @mzitnik! I've replaced code with shared constant from ClientSettings.

mzitnik commented 2 weeks ago

Thanks @mzitnik! I've replaced code with shared constant from ClientSettings.

Actually was referring if we can have a common base class since there is shared code

sonarcloud[bot] commented 2 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
50.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

chernser commented 2 weeks ago

@mzitnik I think, we should not do it to keep developer away from idea of extracting common part. I do not plan to add all server settings in such way and it should not be a problem for maintenance. What I'm afraid of that joining two separate mechanisms will lead to more rigid code and it will not save time as intendent.