Repository navigation
[Docs] Fix connector and transform doc inaccuracies verified against source code - #12833
Conversation
…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
left a comment
There was a problem hiding this comment.
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 oldDECIMAL(38,18)was wrong and the new "precision/scale of the column" is right. - PostgreSql sink:
JdbcSinkFactoryattachesExactlyOnceMaxRetriesValidatortoIS_EXACTLY_ONCEand throws "JDBC XA sink requires max_retries equal to 0 when is_exactly_once=true", so addingmax_retries=0to the note is correct.JdbcSinkOptions.BATCH_INTERVAL_MSis aLongwith default0L, andSinkConnectorCommonOptions.MULTI_TABLE_SINK_REPLICAis in theJdbcSinkFactoryoption rule, so the two new rows match. - Kingbase source:
JdbcSourceFactory.optionRule()only requiresURLandDRIVER;QUERYis optional, andPARTITION_LOWER_BOUND/PARTITION_UPPER_BOUNDareOption<String>inJdbcSourceOptions. Doc changes are correct. - Zendesk sink:
ZendeskSink implements SupportMultiTableSink,ZendeskSinkWriter implements SupportMultiTableSinkWriter<Void>, andZendeskSinkFactory.optionRule()listsMULTI_TABLE_SINK_REPLICA. The whole multi-table contract is present, so ticking the box is right. - Prometheus source:
PrometheusSource.getBoundedness()returnsBOUNDEDin batch andUNBOUNDEDotherwise, andPrometheusSourceReader.pollNextsleepspoll_interval_millisfor 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), andHttp.mditself has column projection unchecked. Consistent. - Lemlist:
LemlistSourceParameterdoesheaders.put(AUTHORIZATION, accessToken)after reading user headers, so a user value is always overwritten. New wording is accurate. - Zendesk source:
ZendeskSourceFactory.optionRule()only addsEMAILandAPI_TOKENon top of the HTTP builder, so the removedformatdefault claim was unsupported. - Copy transform:
CopyFieldTransformFactoryusesexclusive(FIELDS, SRC_FIELD)and requiresdest_fieldwithsrc_field. The new "required" cell is accurate. - Databend: no
generate_sink_sqlanywhere underconnector-databend;DatabendSinkFactorytreatsdatabase/tableas optional options andDatabendSinkConfiguses them directly. - Oracle zh
enable_upsertwording now matches the English row;Mysqlexamples now usejdbc {like the other examples in the file. - OceanBase:
com.oceanbase.jdbc.OceanBaseDataSourcereplacingOceanBaseXADataSourcerests on yourjavapcheck 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:50anddocs/zh/connectors/sink/DB2.md:50(rowSMALLINT | SHORT);docs/en/connectors/source/DB2.md:50-57and the zh counterpart still listINTEGER,LONG,DECIMAL(38,18). - Problem description:
SHORTis not a SeaTunnel type name any more thanINTEGERwas (DB2TypeConverterreturnsBasicType.SHORT_TYPE, which isSMALLINT). The source page uses the sameDB2TypeConverterand 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
SHORTtoSMALLINTin 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). Alsodocs/en/connectors/source/Kingbase.md| No |and the changedINT/BIGINTcells 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
left a comment
There was a problem hiding this comment.
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.
…source code (apache#12833) Co-authored-by: zhangshenghang <zhangshenghang@apache.org> Signed-off-by: Asthenia0412 <Asthenia0412@users.noreply.github.com>
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:
Invalid plugin name
Mysqlin JDBC sink examples (docs/{en,zh}/connectors/sink/Mysql.md): two multi-table-sync examples usedsink { Mysql { ... } }, but the JDBC sink factory identifier isJdbc(JdbcSinkFactory.factoryIdentifier()) andplugin-mapping.propertieshas noseatunnel.sink.Mysqlentry. A job copied from these examples fails with "Could not find any factory for identifier 'Mysql'". Changed tojdbc {, consistent with the other examples in the same file.Corrupted XA data source class name + wrong word (
docs/zh/connectors/sink/Oracle.md): the option description containedOracle.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 correctoracle.jdbc.xa.client.OracleXADataSource. Also fixed the mistranslation "upstart" → "upsert" in theenable_upsertrow.PostgreSql sink options table incomplete (
docs/{en,zh}/connectors/sink/PostgreSql.md): the doc's own examples setbatch_interval_ms = 5000andmulti_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 onlyis_exactly_once=trueis needed, butJdbcSinkFactoryvalidates thatmax_retriesmust be 0 when exactly-once is enabled ("JDBC XA sink requires max_retries equal to 0 when is_exactly_once=true"); the note now saysis_exactly_once=trueandmax_retries=0(matching the MySQL/Oracle sink docs).DB2 type mapping wrong (
docs/{en,zh}/connectors/sink/DB2.md): perDB2TypeConverter,INT/INTEGER→ SeaTunnelINT(doc saidINTEGER, which is not a SeaTunnel type),BIGINT→BIGINT(doc saidLONG), andDECIMAL/DEC/NUMERIC/NUMkeeps the column's declared precision/scale (doc said fixedDECIMAL(38,18)).Nonexistent XA class in OceanBase example (
docs/{en,zh}/connectors/sink/OceanBase.md): the exactly-once example usedcom.oceanbase.jdbc.OceanBaseXADataSource, which does not exist in oceanbase-client (verified against the driver jar). The class implementingjavax.sql.XADataSourceiscom.oceanbase.jdbc.OceanBaseDataSource(verified withjavap). Also fixed theVARBINAR→VARBINARYtypo in the type-mapping table.Reference to nonexistent option (
docs/{en,zh}/connectors/sink/Databend.md): thedatabaserow described behavior "whengenerate_sink_sql = true", butgenerate_sink_sqldoes not exist anywhere in connector-databend (grep returns nothing); the sink readsdatabase/tabledirectly to locate the target table.Kingbase source options (
docs/{en,zh}/connectors/source/Kingbase.md):querywas marked Required=Yes, butJdbcSourceFactory.optionRule()only requiresurlanddriver—queryis optional (table_path/table_listare alternatives, and the canonical Jdbc doc marks it No).partition_lower_bound/partition_upper_boundare declared asStringTypeoptions inJdbcSourceOptions(doc saidBigDecimal). Fixed invalid example SQLselect * id, name from ...→select id, name from .... Aligned the zhNUMERICtype-mapping row with the en row (precision/scale detail).Wrong feature checkboxes:
HttpSource/AbstractSingleSplitSource, which does not implementSupportColumnProjection→ unchecked (en+zh).ZendeskSink implements SupportMultiTableSink→ checked (en+zh).PrometheusSource.getBoundedness()returnsBoundedness.UNBOUNDEDin streaming mode and the doc itself documents stream-only options/examples → checked (en+zh).Misleading prose: Zendesk source said it differs from the Http source in "the required authentication options and the
formatdefault", butZendeskSourceFactorynever overridesformat→ claim removed (en+zh). Lemlist source said a user could override the generatedAuthorizationheader viaheaders, butLemlistSourceParameteralways overwritesheaders[Authorization]with the generated value → reworded (en+zh). Copy transform (docs/{en,zh}/transforms/copy.md):fieldswas marked unconditionally required, butCopyFieldTransformFactorydeclaresfieldsandsrc_fieldas an exclusive pair — the required cell now notes the deprecatedsrc_field+dest_fieldalternative.Which areas/files were updated (25 files)
docs/{en,zh}/connectors/sink/: Mysql, Oracle (zh), PostgreSql, DB2, OceanBase, Databend, Zendeskdocs/{en,zh}/connectors/source/: Kingbase, Zendesk, Klaviyo, Lemlist, Prometheusdocs/{en,zh}/transforms/: copyWere 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?
Optiondefinition /OptionRulein the Java source (file:line evidence in each finding above).javapshowsOceanBaseDataSource implements javax.sql.XADataSource; noOceanBaseXADataSourceclass exists).|, pipe counts match each table's header row (no broken tables), and all relative.mdlinks resolve to existing files.