Skip to content

[improve] selectdb options #9252

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

liunaijie
Copy link
Member

Purpose of this pull request

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@nielifeng nielifeng requested a review from Copilot April 30, 2025 02:34
Copy link
Contributor

@Copilot 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 pull request refactors the SelectDB sink connector configuration to use the new SelectDBConfig and SelectDBSinkOptions instead of the legacy Config, streamlining and modernizing the configuration management.

  • Refactored the sink writer, committer, and sink to accept a SelectDBConfig and CatalogTable instead of a generic Config.
  • Updated the configuration loading in SelectDBConfig to work with ReadonlyConfig and new option definitions.
  • Adjusted connector option tests by removing the whitelist entry for SelectDBSinkOptions.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/sink/writer/SelectDBSinkWriter.java Updated to use SelectDBConfig instead of Config.
seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/sink/committer/SelectDBCommitter.java Refactored to use SelectDBConfig directly.
seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/sink/SelectDBSink.java Modified to load configuration using the new config methods and handle CatalogTable.
seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/config/SelectDBSinkOptions.java Introduced new configuration options for the SelectDB sink.
seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/config/SelectDBConfig.java Updated loadConfig method to use ReadonlyConfig and new options.
seatunnel-ci-tools/src/test/java/org/apache/seatunnel/api/ConnectorOptionCheckTest.java Removed the whitelist entry for SelectDBSinkOptions to update test validations.
Comments suppressed due to low confidence (1)

seatunnel-ci-tools/src/test/java/org/apache/seatunnel/api/ConnectorOptionCheckTest.java:204

  • Ensure that removing 'SelectDBSinkOptions' from the whitelist does not inadvertently reduce test coverage for connector options validation.
whiteList.add("SelectDBSinkOptions");

}
selectdbConfig.setLabelPrefix(pluginConfig.get(SelectDBSinkOptions.SINK_LABEL_PREFIX));
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Verify that the default value for SINK_LABEL_PREFIX is consistently provided through pluginConfig to ensure that the label prefix is never null.

Suggested change
selectdbConfig.setLabelPrefix(pluginConfig.get(SelectDBSinkOptions.SINK_LABEL_PREFIX));
selectdbConfig.setLabelPrefix(
pluginConfig.getOptional(SelectDBSinkOptions.SINK_LABEL_PREFIX)
.orElse("default_label_prefix"));

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant