Skip to content

[Improve][Connector-V2] Migrate IoTDBv2 SQL dialect validation to OptionRule - #11839

Open
liziing wants to merge 2 commits into
apache:devfrom
liziing:improve/iotdbv2-optionrule-validation
Open

[Improve][Connector-V2] Migrate IoTDBv2 SQL dialect validation to OptionRule#11839
liziing wants to merge 2 commits into
apache:devfrom
liziing:improve/iotdbv2-optionrule-validation

Conversation

@liziing

@liziing liziing commented Aug 17, 2026

Copy link
Copy Markdown

Purpose of this pull request

Part of #11007.

The IoTDBv2 source and sink factories currently validate sql_dialect imperatively during createSource and createSink. Because the accepted values are a static configuration rule, this change moves that validation into each factory's declarative OptionRule.

  • Accept only tree and table, preserving the existing case-insensitive behavior.
  • Preserve the existing default value of tree.
  • Remove the duplicate runtime unsupported-dialect checks.
  • Add focused ConfigValidator coverage for omitted, valid, mixed-case, and unsupported values in both source and sink rules.

Does this PR introduce any user-facing change?

Yes. Invalid explicit sql_dialect values are now rejected earlier by standard option validation with OptionValidationException. The accepted values, default value, option name, and behavior of valid configurations are unchanged.

The English and Chinese connector documentation already state that the supported values are tree and table and that the default is tree, so no documentation update is required.

How was this patch tested?

Test-first verification confirmed that the new invalid-value test failed against the old implementation because no OptionValidationException was raised.

The final change was verified with:

./mvnw spotless:apply
./mvnw -q \
  -pl seatunnel-connectors-v2/connector-iotdb-v2 \
  -am \
  -Dmaven.site.skip=true \
  -Dtest=IoTDBFactoryTest,IoTDBv2SourceSplitEnumeratorTest \
  -Dsurefire.failIfNoSpecifiedTests=false \
  verify
./mvnw -q -pl seatunnel-connectors-v2/connector-iotdb-v2 spotless:check
git diff --check origin/dev..HEAD

Results:

  • IoTDBFactoryTest: 4 tests passed.
  • IoTDBv2SourceSplitEnumeratorTest: 3 tests passed.
  • Total: 7 tests passed, 0 failures, 0 errors, 0 skipped.
  • Full-repository Spotless completed successfully across 288 reactor modules.

The full-repository ./mvnw -q -DskipTests verify was also attempted twice, but Maven dependency resolution stalled on the local network proxy while resolving unrelated transitive dependencies. The scoped IoTDBv2 reactor verify above completed successfully.

Check list

  • No new binary package or dependency is added.
  • Existing English and Chinese docs already describe the accepted values and default.
  • No incompatible option, API, or SPI change is introduced.
  • This updates an existing connector, so plugin mapping, distribution POM, label scope, and plugin configuration changes are not required.

@liziing
liziing marked this pull request as ready for review August 17, 2026 10:26
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.

1 participant