flink-connector-clickhouse
flink-connector-clickhouse copied to clipboard
[Enhance]: Ensure Consistency of Database and Parameters in Newly Created ClickHouse JDBC Connections
What happened?
Description
- Currently, the URL configuration is used directly as the URL for the ClickHouseDriver.
- The current format of the ClickHouse JDBC URL is as follows:
jdbc:(ch|clickhouse)[:<protocol>]://endpoint1[,endpoint2,...][/<database>][?param1=value1¶m2=value2][#tag1,tag2,...]
. - When we use the local mode to query a distributed table, a URL address is created for each shard to connect to the local table.
Issue
We need to ensure that the newly created connections contain the same database and parameters as the input URL. This means we need to append [/<database>][?param1=value1¶m2=value2][#tag1,tag2,...]
to the new URL.
Proposed Solution
We propose to modify the URL creation logic to ensure that the database and parameters from the original URL are included in the URLs for each shard. This will ensure consistency across all connections.
Impact
This change will improve the consistency of our connections and prevent potential issues caused by discrepancies in the database or parameters used in different connections.
Affects Versions
master
What are you seeing the problem on?
Connector Connection
How to reproduce
No response
Relevant log output
No response
Anything else
related to https://github.com/itinycheng/flink-connector-clickhouse/issues/129
Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct