-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Fix][Connector-V2] Fix the problem that missing options configuration when building ClickHouse Nodes #9277
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
Conversation
…s ineffective because the options configuration is not passed when building ClickHouse Nodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a configuration issue with ClickHouse connectors by ensuring that the options configuration is correctly passed when building ClickHouse Nodes.
- Replace usage of a hard-coded null with the actual configuration value for CLICKHOUSE_CONFIG in node initialization.
- Update both the main util class and the file sink factory to use the provided CLICKHOUSE_CONFIG value.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/util/ClickhouseUtil.java | Replaced null with config.get(ClickhouseBaseOptions.CLICKHOUSE_CONFIG) for node creation. |
| seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/file/ClickhouseFileSinkFactory.java | Updated sink factory to use readonlyConfig.get(CLICKHOUSE_CONFIG) instead of null. |
| config.get(ClickhouseBaseOptions.DATABASE), | ||
| config.get(ClickhouseBaseOptions.SERVER_TIME_ZONE), | ||
| config.get(ClickhouseBaseOptions.USERNAME), | ||
| config.get(ClickhouseBaseOptions.PASSWORD), |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding an inline comment explaining the role and expected structure of CLICKHOUSE_CONFIG during node initialization to aid future maintainability.
| config.get(ClickhouseBaseOptions.PASSWORD), | |
| config.get(ClickhouseBaseOptions.PASSWORD), | |
| // CLICKHOUSE_CONFIG is a map of configuration options for the ClickHouse client. | |
| // Keys and values represent specific settings supported by the ClickHouse client library. |
| readonlyConfig.get(USERNAME), | ||
| readonlyConfig.get(PASSWORD), | ||
| null); | ||
| readonlyConfig.get(CLICKHOUSE_CONFIG)); |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding a comment to describe the purpose of passing CLICKHOUSE_CONFIG in the sink setup, providing clarity for contributors reviewing configuration handling.
Fix the problem that the clickhouse.config becomes ineffective because the options configuration is not passed when building ClickHouse Nodes
Purpose of this pull request
Fix the problem that the clickhouse.config becomes ineffective because the options configuration is not passed when building ClickHouse Nodes.
In the existing implementation, the
clickhouse.configconfiguration actually does not take effect when the data source is ClickHouse. This is because the corresponding configuration is not passed when building the ClickHouse Nodes used to connect to ClickHouse.Does this PR introduce any user-facing change?
No.
How was this patch tested?
This is a rather obvious problem with the connector client configuration. You can simply follow the existing test cases for testing. There's no need to write a separate test case for these options configuration.
Check list
New License Guide
release-note.