Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickhouse-jdbc driver did not support connection url parameters #1665

Closed
ldcsaa opened this issue May 31, 2024 · 5 comments · Fixed by #1841
Closed

clickhouse-jdbc driver did not support connection url parameters #1665

ldcsaa opened this issue May 31, 2024 · 5 comments · Fixed by #1841
Labels
bug module-jdbc JDBC driver triaged Issue is triaged usability what affects usability of the client
Milestone

Comments

@ldcsaa
Copy link

ldcsaa commented May 31, 2024

Describe the bug

Clickhouse JDBC connection URL with parameters would be always uses default database, like this:

# the default database is NOT `my_db`, but the `default` db.
url: jdbc:clickhouse://192.168.56.23:8123/my_db?custom_http_params=async_insert=1,wait_for_async_insert=1

If cut the url parameter, that's OK, like this:

# the default database is `my_db`
url: jdbc:clickhouse://192.168.56.23:8123/my_db
  • I had test many version of clickhouse JDBC driver, 0.4.6, 0.5.0, 0.6.0 etc.
  • ClickHouse Server version: 24.1
@ldcsaa ldcsaa added the bug label May 31, 2024
@chernser
Copy link
Contributor

chernser commented Jun 1, 2024

Good day, @ldcsaa! Thank you for reporting the issue!
Am I correct that there are two problems:

  • when query parameters are set then wrong database is selected
  • you would like to pass some parameters thru JDBC url

for the last one - have you tried to url encode this part - async_insert=1,wait_for_async_insert=1 ?

@ldcsaa
Copy link
Author

ldcsaa commented Jun 3, 2024

Good day, @ldcsaa! Thank you for reporting the issue! Am I correct that there are two problems:

  • when query parameters are set then wrong database is selected
  • you would like to pass some parameters thru JDBC url

for the last one - have you tried to url encode this part - async_insert=1,wait_for_async_insert=1 ?

I did not tried to encode URL, just refer to this guide:
Asynchronous Inserts

image

@chernser chernser added module-jdbc JDBC driver usability what affects usability of the client labels Jun 18, 2024
@chernser chernser added this to the 0.6.4 Release milestone Jul 15, 2024
@chernser
Copy link
Contributor

Triage Report

  • Bug and should work as documented.

@chernser chernser added the triaged Issue is triaged label Jul 15, 2024
@ningObito
Copy link

There is a version that solves this problem ?

@chernser
Copy link
Contributor

Good day, @ldcsaa!
I've found the bug that causes the problem - , is used as delimiter for endpoints definitions (http://host1,host2,host3/my_db). This will be fixed in 0.7.0.
However, custom_settings should be used instead custom_http_params (should not be used because depends on protocol and actually is not working as expected.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug module-jdbc JDBC driver triaged Issue is triaged usability what affects usability of the client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants