Skip to content

[Docs] Fix connector doc inaccuracies verified against source code - #13390

Merged
nzw921rx merged 4 commits into
apache:devfrom
zhangshenghang:docs/fix-doc-issues-20261121
Nov 25, 2026
Merged

nzw921rx merged 4 commits into
apache:devfrom
zhangshenghang:docs/fix-doc-issues-20261121

Conversation

@zhangshenghang

Copy link
Copy Markdown
Member

Yes, I am contributing to Apache SeaTunnel.

What documentation issues were found

While comparing connector documentation against the actual Java option definitions and runtime code on the current dev branch (commit 7029c09), the following verified inaccuracies were found:

  1. Csv option section headers in file sinks (en/zh × CosFile, FtpFile, HdfsFile, LocalFile, OssFile, OssJindoFile, S3File, SftpFile): the ### csv_string_quote_mode [string] section header contradicted both the option table (enum) and the code (FileBaseSinkOptions.CSV_STRING_QUOTE_MODE is .enumType(CsvStringQuoteMode.class)). Changed all 16 headers to [enum].
  2. Cassandra sink (en/zh): (a) the batch_size section header said [number] while the table and code (.intType()) say int → [int]; (b) the notes claimed a sync batch holds "at most batch_size statements", but CassandraSinkWriter.write() appends the row before checking the counter (getAndIncrement() >= batchSize), so a flush actually executes batch_size + 1 statements. Reworded both.
  3. Sentry sink (en/zh): maxCacheItems / maxQueueSize headers said [number]; code declares .intType() → [int].
  4. Paimon source (en/zh): paimon.hadoop.conf header said [string]; code is .mapType() (PaimonBaseOptions) → [map].
  5. SqlServer CDC (en/zh): table-names and table-pattern were both marked plain required while being documented as mutually exclusive (self-contradictory). SqlServerIncrementalSourceFactory.optionRule() registers them only as .exclusive(...) (neither .required()), and SqlServerSourceConfigFactory omits table.include.list when both are unset, capturing all CDC-enabled tables of database-names. Changed to "Conditionally required"/"条件必填" with the both-omitted behavior documented, matching the wording already used by MySQL-CDC.md for the identical code pattern.
  6. Vitess CDC (en/zh): the option table omitted username / password, which VitessSourceOptions defines and VitessSourceFactory.optionRule() accepts (optional VTGate gRPC credentials). Added both rows.
  7. DataHub sink FAQ (en/zh): claimed failures beyond the retry budget "are surfaced to the job". DataHubWriter.write() catches DatahubClientException and only logs it; retry() also only logs on final failure. Corrected to state records are logged and dropped (best-effort), so checkpointing does not provide at-least-once replay.
  8. Console sink (en/zh): claimed single-table jobs print tableId=-1. SeaTunnelRow.tableId is a String (default empty), and sources set it to the table path (e.g. FakeSource sets catalogTable.getTableId().toTablePath().toString()). -1 is the pre-String-era output. Reworded accordingly.
  9. FakeSource (en/zh): the feature list marked parallelism unchecked, contradicting FakeSource implements SupportParallelism, FakeSourceSplitEnumerator (splitId % currentParallelism), and the doc's own split-assignment note. Checked the box.
  10. Assert sink (en/zh): described MIN_ROW/MAX_ROW as evaluated against "the cumulative row count observed by that writer instance". AssertSinkWriter keeps JVM-static LongAccumulator counters shared by every parallel writer of a table, evaluated by the last writer of the table to close. Corrected the scope description.
  11. InfluxDB source (zh only): the where reserved-option note was missing the tables_configs paragraph that the en doc already has (configuring where in a table entry fails at build time with OptionValidationException; the multi-table split parser is case-insensitive on where).

What was changed / which areas were updated

35 documentation files under docs/en/connectors and docs/zh/connectors (source + sink): CDC (SqlServer, Vitess), file sinks (8 connectors × csv option header), Paimon, Cassandra, Sentry, DataHub, Console, FakeSource, Assert, InfluxDB. Every change is backed by the cited code location; no formatting-only churn, no unrelated edits.

Were English and Chinese docs both checked?

Yes. Every issue was fixed in both the en and zh versions where the content exists. The only single-language change is item 11 (zh InfluxDB), where the en doc already contained the correct paragraph and zh was lagging behind.

How duplicate PRs from the last 7 days were checked

Before implementing and again before opening this PR, I listed all PRs created in the last 7 days (gh pr list with author zhangshenghang plus repo-wide doc searches) and inspected the changed-file lists of #13380, #13379, #13327, #13292, #13289, #13284, #13302, #13274, #13282. None of them covers the connectors or issues fixed here: #13380 touches Clickhouse/Redis/Elasticsearch/Pulsar/RocketMQ/Maxcompute/IoTDB/HugeGraph/Neo4j/LLM/Replace/Zeta REST; #13327 touches CDC MongoDB/PostgreSQL/Opengauss + Http/Kafka + transforms; #13302 touches JDBC-family + getting-started; #13289 aligns file-connector option tables (its csv_string_quote_mode change is on the table rows, not the section headers fixed here — checked its diff explicitly, no heading lines touched); #13284 touches FtpFile/LocalFile/Paimon sink examples. The remaining open @site link in docs/zh/engines/zeta/rest-api-v2.md was deliberately left untouched because #13380 already fixes it.

How the change was verified

  • Every documented claim above was checked against the code before editing (option definitions, factory option rules, writer/enumerator runtime paths), with file/line evidence collected for each issue.
  • Re-ran a repo-wide relative-link checker over docs/en and docs/zh: no new broken links (the only remaining hit is the pre-existing @site line owned by [Docs] Fix connector doc inaccuracies verified against source code #13380).
  • Ran a heading-vs-table type-consistency checker over all connector docs: the mismatches fixed here are resolved; the only remaining hits are cursor.stop.mode/auth_type (owned by [Docs] Fix connector doc inaccuracies verified against source code #13380) and an int/Integer wording difference that is semantically identical.
  • Ran a markdown table structure checker over all 35 edited files: 0 newly malformed rows (the checker's few hits are pre-existing escaped-pipe cells that also exist on upstream/dev).
  • The Docusaurus website build was not run locally because it requires checking out and installing the separate apache/seatunnel-website repository; the link, table, and consistency checks above cover the changed markdown.

Scope

35 documentation files, 46 insertions / 38 deletions — all real content corrections satisfying the multi-file scope.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for contributing to Apache SeaTunnel! I reviewed the complete current diff and followed its entry points and failure paths. The items below need attention before merging; I hope the concrete paths make the next step straightforward.

What problem does this PR solve?

User pain point: connector guides describe wrong option types, counter scope and failure behavior.

Fix approach: correct 35 English/Chinese documentation files against existing implementations.

One sentence: mostly useful documentation corrections, with one SQL Server selector claim that contradicts the actual public factory.

Example: removing both SQL Server table selectors does not capture all tables; it fails configuration validation before any reader starts.

1. Code changes

1.1 Core logic

Complete runtime path:

Documented job configuration -> FactoryUtil factory validation -> SqlServerIncrementalSourceFactory.optionRule():63
  -> ConfigValidator.checkExclusive():437-459 -> zero selectors: configuration error
AssertSinkWriter.write():108-110 -> shared table counter -> close():124-191 -> last open writer checks row rules
CassandraSinkWriter.write():81-87 -> append -> getAndIncrement >= batch_size -> flush
DataHubWriter.write():90-105 -> failed-record retry():113-124 -> log/drop paths
FakeSourceSplitEnumerator.run():63-67 -> discovery -> splitId % parallelism -> reader assignment
File/Sentry/Paimon Option definitions -> enum/int/map parsing; VitessSourceConfig:190-201 -> authentication properties

Key findings and correctness:

Normal users reach the documented factory and writer paths. The shared Assert counter/last-writer close description agrees with AssertSinkWriter:49-61,124-133. Cassandra really appends before testing the preincrement value, so a full synchronous flush has batch_size+1 rows. DataHub can log unsuccessful writes without notifying the engine; checkpointing cannot reconstruct that missing failure signal. SeaTunnelRow:32 stores an empty-default String tableId. FileBaseSinkOptions:308-312 is an enum, SentrySinkOptions:43-57 are integers, PaimonBaseOptions:113 declares a map, FakeSource assigns splits to parallel readers, and Vitess exposes the two authentication options. The Chinese InfluxDB addition aligns with the existing English multi-table warning. The SQL Server change is the exception: exclusive means exactly one, not at most one. No runtime code or registry entry is changed.

Before:


## Streaming Validation

Assert works in both `BATCH` and `STREAMING` job modes. Field rules (`NOT_NULL`, `MIN_LENGTH`, `MAX_LENGTH`, etc.) are checked on every row as it arrives at the sink writer. Row count rules (`MIN_ROW` / `MAX_ROW`) are evaluated **exactly once** when the sink writer closes (at job shutdown, savepoint, or failure), against the cumulative row count observed by that writer instance since it was created — not per checkpoint window, and not reset between checkpoints. If you need per-checkpoint-window row-count validation, that requires a source code change (out of scope for a docs update).

## Example

After:


## Streaming Validation

Assert works in both `BATCH` and `STREAMING` job modes. Field rules (`NOT_NULL`, `MIN_LENGTH`, `MAX_LENGTH`, etc.) are checked on every row as it arrives at the sink writer. Row count rules (`MIN_ROW` / `MAX_ROW`) are evaluated **exactly once** when the sink writer closes (at job shutdown, savepoint, or failure). The counter is shared by every parallel writer of the same table inside one process (Flink subtasks, Zeta parallel tasks on one node), so the rules are checked against the whole-table total accumulated across all those writers, and the last writer of the table to close performs the check — not per checkpoint window, and not reset between checkpoints. If you need per-checkpoint-window row-count validation, that requires a source code change (out of scope for a docs update).

## Example

1.2 Compatibility

Fully compatible at runtime: no API, option key/default, protocol, row/checkpoint serialization or execution behavior changes. This PR must describe the existing contract accurately, particularly exactly-one selector validation.

1.3 Performance and side effects

Documentation only: no CPU, memory/GC, network, lock, concurrency, retry, idempotency or resource-release behavior changes. The DataHub and Cassandra notes describe existing operational limits.

1.4 Errors, logging, and findings

Issue 1: Do not document an omitted-selector configuration that the factory rejects

  • Location: docs/en/connectors/source/SqlServer-CDC.md:85.
  • Description and risk: Both updated table rows say omitting table-names and table-pattern captures all CDC-enabled tables; the Chinese rows repeat this. The normal public factory declares .exclusive(TABLE_NAMES,TABLE_PATTERN) at SqlServerIncrementalSourceFactory.java:63. ConfigValidator.checkExclusive at 437-452 rejects count==0 with "exactly one option must be set, but none are configured". A reader never starts for the advertised configuration.
  • Best improvement: Keep exactly-one-required wording in both guides; to document all-table capture, provide an explicit matching table-pattern accepted by the factory. This documentation PR should not weaken the shared validator or expand runtime selection semantics.
  • Responsibility and trade-off: The documentation is the right responsibility boundary: preserve runtime behavior and correct the guides. The smallest safe correction and best solution here are the same: match the actual public factory/writer contract in both languages. Changing global validation or adding runtime behavior solely to make a sentence true would expand scope and regression cost.
  • Severity: Medium; blocking: true.
  • Previously raised by another reviewer: No, unless explicitly attributed above.

Community input: no independent technical finding or maintainer approval/change request was present in the collected discussion.

2. Code quality

2.1 Conventions

Reviewed all changed files for license, imports, naming, core-method and state-field comments. See the numbered findings for the required changes.

2.2 Test coverage and stability

Stability rating: Stable. No UT/E2E changes; flakiness rating is not applicable. Both exact-head Build signals report success for this docs-only head, but skipped connector lanes are not evidence of connector execution. Static option and call-chain checks establish Issue 1; no job was run locally.

2.3 Documentation

Reviewed all 35 changed English/Chinese files and compared the affected Option definitions, writer branches and source validation. Issue 1 affects both SQL Server guides. Existing unrelated runtime defects described by the docs are not fixes delivered by this PR.

3. Architecture

3.1 Change location

The documentation is the right responsibility boundary: preserve runtime behavior and correct the guides. The smallest safe correction and best solution here are the same: match the actual public factory/writer contract in both languages. Changing global validation or adding runtime behavior solely to make a sentence true would expand scope and regression cost.

3.2 Maintainability

Keep the behavior, lifecycle ownership, and failure contract together. The documentation is the right responsibility boundary: preserve runtime behavior and correct the guides. The smallest safe correction and best solution here are the same: match the actual public factory/writer contract in both languages. Changing global validation or adding runtime behavior solely to make a sentence true would expand scope and regression cost.

3.3 Extensibility

Prefer the existing component boundary and tests over unrelated shared abstractions.

3.4 Upgrade impact

Fully compatible at runtime: no API, option key/default, protocol, row/checkpoint serialization or execution behavior changes. This PR must describe the existing contract accurately, particularly exactly-one selector validation.

4. Findings summary

Completeness check: All changed files and affected entry/failure paths were reviewed; configuration/serialization compatibility, test failure capability and stability, documentation/examples, change ownership, and current CI/conflict/review gates are covered above. No unreviewed source scope is claimed complete.

# Finding Location Severity
1 Do not document an omitted-selector configuration that the factory rejects docs/en/connectors/source/SqlServer-CDC.md:85 Medium

5. Merge recommendation

Merge after fixes

Blocking items: Issues 1. Current-head CI and write-capable maintainer review remain independent requirements.

Non-blocking suggestions: None beyond the validation limits above.

Overall: the approach addresses a real path, but the listed blockers must be closed. Daniel has READ permission, so this COMMENT cannot dismiss historical requested changes or satisfy a write-capable maintainer approval gate.

CI and repository state: Signal pull request update: SUCCESS; Build: SUCCESS; Build: success. GitHub reports BLOCKED / REVIEW_REQUIRED.

Verification: Reviewed all changed files and the referenced call sites at d4043c7b2a33bdb1e70f61f490ceddd8133438a8 against merge base 7029c0969a9f6ea9add7a11f9262f42fe2ce9da9. git diff --check passed. I did not build, run tests, or execute SeaTunnel locally.

Review time: 2026-11-23T06:43:31.642235-05:00

Local evidence: git fetch obtained head d4043c7b2a33bdb1e70f61f490ceddd8133438a8; git merge-base returned 7029c0969a9f6ea9add7a11f9262f42fe2ce9da9; git diff --stat reports 35 files changed, 46 insertions(+), 38 deletions(-). git show and source searches were used for the entry points above. No local build, unit test, E2E, Docker run or service startup was executed.

…rn in SQL Server CDC guides

SqlServerIncrementalSourceFactory declares .exclusive(TABLE_NAMES,
TABLE_PATTERN) and ConfigValidator.checkExclusive rejects a config that
sets neither, so the 'omit both to capture all tables' wording in en/zh
described a configuration no reader can start. State the
exactly-one-required contract and point readers at a matching
table-pattern for all-table capture.
nzw921rx
nzw921rx previously approved these changes Nov 25, 2026

@nzw921rx nzw921rx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 LGTM

@nzw921rx
nzw921rx added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 25, 2026
@nzw921rx
nzw921rx enabled auto-merge November 25, 2026 14:06
@nzw921rx

Copy link
Copy Markdown
Member

Re-reviewed #13390 at a1e069895609.

What changed

Sink options and lifecycle notes for Assert, Cassandra, DataHub and file connectors, plus selected source option tables.

Runtime path checked

AssertSinkWriter evaluates row-count rules when its last writer for the table closes in that JVM. The Cassandra writer's flush path distinguishes asynchronous writes from grouped batch statements. DataHubWriter logs exhausted record retries, and the Vitess options are listed once.

Review result

I rechecked earlier review feedback against this head. I found no new source-side blocker in the documentation diff.

Verification

I checked the full diff and prior review threads, compiled 31 changed Markdown/MDX pages, and checked the diff with git diff --check. The batch passed offline Spotless.
Local verification excludes Maven verify, live connector jobs and a full site build.

Merge conclusion

The required Build reports IN_PROGRESS for this SHA. Build check The source review is clear for this SHA. The required build gate is still pending.

@nzw921rx nzw921rx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@nzw921rx
nzw921rx added this pull request to the merge queue Nov 25, 2026
Merged via the queue into apache:dev with commit a9b342c Nov 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants