Skip to content

[Docs] Fix connector and transform doc inaccuracies verified against source code - #12833

Merged
davidzollo merged 1 commit into
apache:devfrom
zhangshenghang:docs-fix-batch-20261016
Oct 18, 2026
Merged

davidzollo merged 1 commit into
apache:devfrom
zhangshenghang:docs-fix-batch-20261016

Conversation

@zhangshenghang

Copy link
Copy Markdown
Member

Purpose of this PR

This PR fixes a batch of real documentation inaccuracies found by verifying connector/transform docs line-by-line against the Java source code on this branch. It covers 25 documentation files (13 English + 12 Chinese... see list below; most fixes are applied to both languages).

What documentation issues were found

All issues below were verified directly against the source code before fixing:

  1. Invalid plugin name Mysql in JDBC sink examples (docs/{en,zh}/connectors/sink/Mysql.md): two multi-table-sync examples used sink { Mysql { ... } }, but the JDBC sink factory identifier is Jdbc (JdbcSinkFactory.factoryIdentifier()) and plugin-mapping.properties has no seatunnel.sink.Mysql entry. A job copied from these examples fails with "Could not find any factory for identifier 'Mysql'". Changed to jdbc {, consistent with the other examples in the same file.

  2. Corrupted XA data source class name + wrong word (docs/zh/connectors/sink/Oracle.md): the option description contained Oracle.jdbc.xa.client。OracleXADataSource (wrong package case, a Chinese full stop inside the class name, unbalanced backtick). The same file's own example already used the correct oracle.jdbc.xa.client.OracleXADataSource. Also fixed the mistranslation "upstart" → "upsert" in the enable_upsert row.

  3. PostgreSql sink options table incomplete (docs/{en,zh}/connectors/sink/PostgreSql.md): the doc's own examples set batch_interval_ms = 5000 and multi_table_sink_replica = 2 (JdbcSinkOptions / SinkConnectorCommonOptions), but neither option had a row in the options table. Added both rows (text mirrors the MySQL sink doc). Also, the exactly-once note said only is_exactly_once=true is needed, but JdbcSinkFactory validates that max_retries must be 0 when exactly-once is enabled ("JDBC XA sink requires max_retries equal to 0 when is_exactly_once=true"); the note now says is_exactly_once=true and max_retries=0 (matching the MySQL/Oracle sink docs).

  4. DB2 type mapping wrong (docs/{en,zh}/connectors/sink/DB2.md): per DB2TypeConverter, INT/INTEGER → SeaTunnel INT (doc said INTEGER, which is not a SeaTunnel type), BIGINT → BIGINT (doc said LONG), and DECIMAL/DEC/NUMERIC/NUM keeps the column's declared precision/scale (doc said fixed DECIMAL(38,18)).

  5. Nonexistent XA class in OceanBase example (docs/{en,zh}/connectors/sink/OceanBase.md): the exactly-once example used com.oceanbase.jdbc.OceanBaseXADataSource, which does not exist in oceanbase-client (verified against the driver jar). The class implementing javax.sql.XADataSource is com.oceanbase.jdbc.OceanBaseDataSource (verified with javap). Also fixed the VARBINAR → VARBINARY typo in the type-mapping table.

  6. Reference to nonexistent option (docs/{en,zh}/connectors/sink/Databend.md): the database row described behavior "when generate_sink_sql = true", but generate_sink_sql does not exist anywhere in connector-databend (grep returns nothing); the sink reads database/table directly to locate the target table.

  7. Kingbase source options (docs/{en,zh}/connectors/source/Kingbase.md): query was marked Required=Yes, but JdbcSourceFactory.optionRule() only requires url and driver — query is optional (table_path/table_list are alternatives, and the canonical Jdbc doc marks it No). partition_lower_bound/partition_upper_bound are declared as StringType options in JdbcSourceOptions (doc said BigDecimal). Fixed invalid example SQL select * id, name from ... → select id, name from .... Aligned the zh NUMERIC type-mapping row with the en row (precision/scale detail).

  8. Wrong feature checkboxes:

    • Zendesk/Klaviyo/Lemlist sources claimed [x] column projection, but they extend HttpSource/AbstractSingleSplitSource, which does not implement SupportColumnProjection → unchecked (en+zh).
    • Zendesk sink claimed [ ] multi-table write, but ZendeskSink implements SupportMultiTableSink → checked (en+zh).
    • Prometheus source claimed [ ] stream, but PrometheusSource.getBoundedness() returns Boundedness.UNBOUNDED in streaming mode and the doc itself documents stream-only options/examples → checked (en+zh).
  9. Misleading prose: Zendesk source said it differs from the Http source in "the required authentication options and the format default", but ZendeskSourceFactory never overrides format → claim removed (en+zh). Lemlist source said a user could override the generated Authorization header via headers, but LemlistSourceParameter always overwrites headers[Authorization] with the generated value → reworded (en+zh). Copy transform (docs/{en,zh}/transforms/copy.md): fields was marked unconditionally required, but CopyFieldTransformFactory declares fields and src_field as an exclusive pair — the required cell now notes the deprecated src_field+dest_field alternative.

Which areas/files were updated (25 files)

  • docs/{en,zh}/connectors/sink/: Mysql, Oracle (zh), PostgreSql, DB2, OceanBase, Databend, Zendesk
  • docs/{en,zh}/connectors/source/: Kingbase, Zendesk, Klaviyo, Lemlist, Prometheus
  • docs/{en,zh}/transforms/: copy

Were English and Chinese docs both checked?

Yes. Every fix above was applied to both the English and Chinese documentation wherever both files contain the same content; two issues were zh-only (Oracle corrupted class name/upstart typo, Kingbase NUMERIC row) because the en files were already correct.

How duplicate PRs were checked

I listed all open PRs from the last 7 days before starting (via gh pr list --repo apache/seatunnel):

How was this verified?

  • Every changed table row was checked against the corresponding Option definition / OptionRule in the Java source (file:line evidence in each finding above).
  • The OceanBase XA class name was verified against the actual driver jar in the local Maven repository (javap shows OceanBaseDataSource implements javax.sql.XADataSource; no OceanBaseXADataSource class exists).
  • Post-run automated checks on all 25 changed files: every Markdown table row opens and closes with |, pipe counts match each table's header row (no broken tables), and all relative .md links resolve to existing files.
  • Docs-only change: no Java/build code is affected, so the full Maven build was not run; the checks above are the appropriate verification for this change.

…source code

Fix documentation issues found by verifying docs against the Java source code:

- Jdbc-family sink docs: invalid plugin name Mysql in multi-table examples
  (factory identifier is Jdbc; jobs would fail with factory-not-found)
- Oracle zh: corrupted XA data source class name and upstart->upsert typo
- PostgreSql en+zh: document batch_interval_ms and multi_table_sink_replica
  (both used by the doc's own examples but missing from the options table),
  and add the mandatory max_retries=0 required by the JDBC XA exactly-once validator
- DB2 en+zh: fix SeaTunnel type mapping (INTEGER->INT, LONG->BIGINT,
  DECIMAL keeps the column's precision/scale per DB2TypeConverter)
- OceanBase en+zh: use the real XA data source class com.oceanbase.jdbc.OceanBaseDataSource
  (OceanBaseXADataSource does not exist in the driver) and fix VARBINAR typo
- Databend sink en+zh: remove reference to nonexistent generate_sink_sql option
- Kingbase source en+zh: query is optional (table_path/table_list are alternatives),
  partition bounds are String per JdbcSourceOptions, fix invalid example SQL
  (select * id, name), align zh NUMERIC mapping row with en
- Zendesk/Klaviyo/Lemlist source en+zh: column projection is not supported
  (HttpSource does not implement SupportColumnProjection)
- Zendesk sink en+zh: multi-table write is supported (implements SupportMultiTableSink)
- Zendesk source en+zh: remove wrong claim about a different format default
- Lemlist en+zh: a user-supplied Authorization header is always overwritten
  by the generated Basic auth header
- Prometheus source en+zh: stream mode is supported (Boundedness.UNBOUNDED)
- Copy transform en+zh: fields is required unless the deprecated
  src_field/dest_field pair is used (options are exclusive)

@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.

Hi @zhangshenghang, thanks a lot for another careful docs-accuracy pass, and for the very thorough PR description (per-finding evidence and the duplicate-PR audit made this easy to review). I checked the changes against the source at the PR head and found no blocking issue; a few small, optional follow-ups are listed below.

What Problem Does This PR Solve?

User pain point. Several connector/transform pages describe behavior the code does not have, so a copied example fails or a reader picks the wrong option. For example, the Mysql sink pages use sink { Mysql { ... } }, but the sink factory identifier is Jdbc, so a job copied from those two multi-table examples cannot find a factory.

Fix approach. Docs-only: 25 files (en and zh), 49 additions / 46 deletions. Each change aligns a doc row, example, or feature checkbox with the corresponding Option / OptionRule / class declaration.

One-sentence summary. Corrects verified doc-vs-code mismatches in the JDBC sinks (Mysql, PostgreSql, DB2, OceanBase, Oracle zh), Databend, Kingbase, the Zendesk/Klaviyo/Lemlist/Prometheus HTTP connectors and the Copy transform.

1. Code Change Review

1.1 Core Logic Analysis

I re-verified the claims that carry the most risk against the head source:

  • DB2 type mapping: DB2TypeConverter (DB2_INT/DB2_INTEGER -> BasicType.INT_TYPE, DB2_BIGINT -> BasicType.LONG_TYPE, DB2_DECIMAL -> new DecimalType(precision, scale)). So the old DECIMAL(38,18) was wrong and the new "precision/scale of the column" is right.
  • PostgreSql sink: JdbcSinkFactory attaches ExactlyOnceMaxRetriesValidator to IS_EXACTLY_ONCE and throws "JDBC XA sink requires max_retries equal to 0 when is_exactly_once=true", so adding max_retries=0 to the note is correct. JdbcSinkOptions.BATCH_INTERVAL_MS is a Long with default 0L, and SinkConnectorCommonOptions.MULTI_TABLE_SINK_REPLICA is in the JdbcSinkFactory option rule, so the two new rows match.
  • Kingbase source: JdbcSourceFactory.optionRule() only requires URL and DRIVER; QUERY is optional, and PARTITION_LOWER_BOUND/PARTITION_UPPER_BOUND are Option<String> in JdbcSourceOptions. Doc changes are correct.
  • Zendesk sink: ZendeskSink implements SupportMultiTableSink, ZendeskSinkWriter implements SupportMultiTableSinkWriter<Void>, and ZendeskSinkFactory.optionRule() lists MULTI_TABLE_SINK_REPLICA. The whole multi-table contract is present, so ticking the box is right.
  • Prometheus source: PrometheusSource.getBoundedness() returns BOUNDED in batch and UNBOUNDED otherwise, and PrometheusSourceReader.pollNext sleeps poll_interval_millis for non-bounded jobs. The doc already documents a streaming example, so the stream box was wrong.
  • Zendesk/Klaviyo/Lemlist column projection: all extend HttpSource (-> AbstractSingleSplitSource), and Http.md itself has column projection unchecked. Consistent.
  • Lemlist: LemlistSourceParameter does headers.put(AUTHORIZATION, accessToken) after reading user headers, so a user value is always overwritten. New wording is accurate.
  • Zendesk source: ZendeskSourceFactory.optionRule() only adds EMAIL and API_TOKEN on top of the HTTP builder, so the removed format default claim was unsupported.
  • Copy transform: CopyFieldTransformFactory uses exclusive(FIELDS, SRC_FIELD) and requires dest_field with src_field. The new "required" cell is accurate.
  • Databend: no generate_sink_sql anywhere under connector-databend; DatabendSinkFactory treats database/table as optional options and DatabendSinkConfig uses them directly.
  • Oracle zh enable_upsert wording now matches the English row; Mysql examples now use jdbc { like the other examples in the file.
  • OceanBase: com.oceanbase.jdbc.OceanBaseDataSource replacing OceanBaseXADataSource rests on your javap check against the driver jar. I did not download the jar, so I am taking that part from your description; the change is plausible and the new value is no worse than a class name that you report does not exist.

Normal path: this is documentation only, no Java, build, or option changes, so no runtime path is touched.

1.2 Compatibility Impact

Fully compatible. No code, defaults, option names, or serialization are changed; the doc rows now describe existing behavior.

1.3 Performance / Side-Effect Analysis

None (docs only).

1.4 Error Handling and Logging

No blocking issues. Optional follow-ups (all documentation polish):

Issue 1: SMALLINT -> SHORT left unchanged in the DB2 sink mapping table (and the same table in the DB2 source page still has the old values)

  • Location: docs/en/connectors/sink/DB2.md:50 and docs/zh/connectors/sink/DB2.md:50 (row SMALLINT | SHORT); docs/en/connectors/source/DB2.md:50-57 and the zh counterpart still list INTEGER, LONG, DECIMAL(38,18).
  • Problem description: SHORT is not a SeaTunnel type name any more than INTEGER was (DB2TypeConverter returns BasicType.SHORT_TYPE, which is SMALLINT). The source page uses the same DB2TypeConverter and carries the exact inaccuracies this PR fixes in the sink page.
  • Potential risk: the same reader confusion this PR removes, just on the neighboring row/page.
  • Best improvement: change SHORT to SMALLINT in the sink page, and apply the same INT/BIGINT/DECIMAL row fixes to the DB2 source page (en+zh), either here or in a small follow-up.
  • Severity: Low
  • Raised by another reviewer: No

Issue 2: New DECIMAL cell text has unbalanced parentheses and misaligned table columns

  • Location: docs/en/connectors/sink/DB2.md:52, docs/zh/connectors/sink/DB2.md:52, docs/zh/connectors/source/Kingbase.md:51 (DECIMAL((...),<br/>(...))) has 3 opening and 4 closing parentheses). Also docs/en/connectors/source/Kingbase.md | No | and the changed INT/BIGINT cells no longer line up with the header.
  • Problem description: the text was copied from the existing en Kingbase row, which has the same stray ). It renders, but looks like a typo.
  • Potential risk: cosmetic only.
  • Best improvement: e.g. DECIMAL(precision, scale) taken from the column definition, with matching zh text, and re-pad the edited table cells.
  • Severity: Low
  • Raised by another reviewer: No

2. Code Quality Assessment

2.1 Coding standards

No Java changes, so no new methods needing comments. Markdown tables keep the same column counts as their headers.

2.2 Test coverage and stability

Not applicable for docs-only changes. Stability rating: Stable (no tests added or modified).

2.3 Documentation updates

en and zh were updated together wherever both contained the issue. docs/en and docs/zh stay in sync for every file touched. No change in incompatible-changes.md is needed since nothing user-visible at runtime changes.

3. Architectural Soundness

3.1 Fix type

Precise fix: each edit is tied to a specific source declaration.

3.2 Maintainability

Good: smaller, per-file corrections; the PR description lists the evidence for each.

3.3 Extensibility

Not applicable.

3.4 Historical-version compatibility

No impact; docs only.

4. Issue Summary

No. Issue Location Severity
1 SMALLINT -> SHORT left in DB2 sink table; DB2 source page still has old INTEGER/LONG/DECIMAL(38,18) rows docs/{en,zh}/connectors/sink/DB2.md, docs/{en,zh}/connectors/source/DB2.md Low
2 Unbalanced parentheses and table alignment in new DECIMAL / No cells docs/{en,zh}/connectors/sink/DB2.md, docs/zh/connectors/source/Kingbase.md, docs/en/connectors/source/Kingbase.md Low

5. Merge Recommendation

Conclusion: Ready to merge

Blockers (must fix): none.

Recommended fixes (non-blocking): Issues 1 and 2 above.

Overall assessment: Each fix I traced matches the source at the head. CI for the current head is green: the apache-side Build check succeeded and the corresponding run in the PR author's fork (run 38928911316) completed successfully. A committer approval is still needed, since this review is advisory.

Better alternative: none; the approach is right.

Thanks again for keeping the docs honest!

@davidzollo davidzollo 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.

Approving. The doc corrections were verified against the connector source, there are no open source-side blockers, and the Build check is green on this exact head. Thanks @zhangshenghang. Enqueueing for merge.

@davidzollo
davidzollo added this pull request to the merge queue Oct 18, 2026
Merged via the queue into apache:dev with commit 5d73e62 Oct 18, 2026
4 checks passed
Asthenia0412 added a commit to Asthenia0412/seatunnel that referenced this pull request Oct 18, 2026
…source code (apache#12833)

Co-authored-by: zhangshenghang <zhangshenghang@apache.org>

Signed-off-by: Asthenia0412 <Asthenia0412@users.noreply.github.com>
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