Skip to content

Conversation

@mrtisttt
Copy link
Contributor

@mrtisttt mrtisttt commented May 6, 2025

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.config configuration 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

…s ineffective because the options configuration is not passed when building ClickHouse Nodes
Copy link
Contributor

Copilot AI left a 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),
Copy link

Copilot AI May 7, 2025

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
readonlyConfig.get(USERNAME),
readonlyConfig.get(PASSWORD),
null);
readonlyConfig.get(CLICKHOUSE_CONFIG));
Copy link

Copilot AI May 7, 2025

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.

Copilot uses AI. Check for mistakes.
@hailin0 hailin0 merged commit 051d19c into apache:dev May 7, 2025
6 of 7 checks passed
@mrtisttt mrtisttt deleted the fix-ck-options branch June 10, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants