Skip to content

[Docs] Fix file, Hive, Iceberg, MongoDB and DataHub doc issues verified against source code - #13089

Merged
davidzollo merged 2 commits into
apache:devfrom
zhangshenghang:docs-fix-20261101
Nov 2, 2026
Merged

davidzollo merged 2 commits into
apache:devfrom
zhangshenghang:docs-fix-20261101

Conversation

@zhangshenghang

Copy link
Copy Markdown
Member

Purpose of this PR

This PR is a documentation-only change that fixes real documentation issues found by auditing connector docs against the actual source code on dev. I confirm that I am contributing to SeaTunnel.

What documentation issues were found

Issues were verified line-by-line against connector code before editing:

  1. dag-parsing.mode documented a non-existent enum value (source-common-options.md, en+zh). Docs said MULTIPLEXING, but ParsingMode only defines SINGLENESS, SHARDING, and the deprecated MULTIPLEX. Setting the documented value fails enum parsing at job submission. Also, the deprecated MULTIPLEX description was wrong (it means one source with separate sinks, not one source and one sink).
  2. DataHub sink recommended an unsupported placeholder (Datahub.md, en+zh). Docs told users to use ${table} and called ${table_name} a "deprecated alias" — exactly backwards. TablePlaceholder has no ${table}; following the docs, the literal string ${table} reaches the DataHub client and the job fails. Fixed all occurrences (description, topic section, multi-table example, FAQ) and added multi_table_sink_replica to the option table.
  3. File connectors: wrong format-scope claims (LocalFile.md, HdfsFile.md, source+sink, en+zh). null_format also applies to csv reads, not only text (used by CsvReadStrategy); HdfsFile skip_header_row_number also applies to Excel (ExcelReadStrategy honors it), not only txt/csv; HdfsFile sink field_delimiter/row_delimiter descriptions contradicted themselves and the writers.
  4. File sink options missing from docs (LocalFile.md/HdfsFile.md sink, en+zh). date_format / datetime_format / time_format (registered in both sink factories, used by text/csv/excel/xml writers) and multi_table_sink_replica (LocalFile sink) were absent; HdfsFile source lacked excel_use_header_line and the markdown_rag_metadata_enabled / pdf_rag_metadata_enabled table rows (referenced only in prose).
  5. Hive source table_list inheritance claim was wrong (Hive.md, en+zh). Entries are parsed as standalone configs (ReadonlyConfig::fromMap) and do NOT inherit root-level options; metastore_uri etc. must be repeated per entry. Also documented the missing null_format and parse_partition_from_path options, noted that regex discovery (use_regex) requires a reachable metastore, and added ${current_timestamp} to the sink save_mode_create_template variable list (HiveTableTemplateUtils substitutes it).
  6. Iceberg source table_list per-item keys undocumented (Iceberg.md, en+zh). Items are deserialized by Jackson with camelCase field names (startSnapshotId, streamScanStrategy, splitSize, splitLookback, splitOpenFileCost, ...); copying the snake_case root names fails with unknown-property errors. Added a per-item key table in both languages.
  7. Chinese Iceberg docs were incomplete/mixed-language (zh sink/+source/Iceberg.md). Added the missing "Glue Catalog" example section (parity with en) and replaced English yes/no cells with 是/否.
  8. MongoDB sink type mapping claimed STRING -> ObjectId (MongoDB.md, en+zh). No sink code path produces an ObjectId (RowDataToBsonConverters only emits BsonString); removed the row and documented the actual behavior.

What was changed

  • Documentation only — 21 markdown files (11 topics × en + zh), 162 insertions / 62 deletions. No code, config, or build files touched.

Which areas/files were updated

  • docs/{en,zh}/connectors/source/{LocalFile,HdfsFile,Hive,Iceberg}.md
  • docs/{en,zh}/connectors/sink/{LocalFile,HdfsFile,Hive,Iceberg,MongoDB,Datahub}.md
  • docs/{en,zh}/connectors/common-options/source-common-options.md

Were English and Chinese docs both checked?

Yes. Every fix was applied to both language versions; the Chinese Iceberg pages additionally received the missing Glue Catalog section and consistent 是/否 required-column cells.

How duplicate PRs from the last 7 days were checked

Listed all open PRs from the last week (gh pr list --state open) and inspected the changed-file lists of my own recent open doc PRs: #13072, #13050, #12993, #12986, #12971, plus merged #13062/#13019 and the just-merged #11779. This PR deliberately targets only pages not covered by those PRs (file connectors, Hive, Iceberg, non-CDC MongoDB, DataHub, source common options). Overlapping connectors (JDBC, Kafka, MySQL/Oracle/PG/Redis, Clickhouse/Doris/StarRocks, CDC connectors, cloud file connectors, engine pages) were intentionally not touched here.

How the change was verified

  • Every changed option name/default/type was cross-checked against the defining Java classes (ParsingMode, TablePlaceholder, FormatOptions, SinkConnectorCommonOptions, FileBaseSourceOptions, SourceTableConfig, IcebergStreamScanStrategy, RowDataToBsonConverters, MultipleTableHiveSourceConfig, HiveTableTemplateUtils, sink factories, read/write strategies) before editing.
  • Ran a script over all 21 changed files: every markdown table row matches its header's column count and every relative link resolves (all pass).
  • Grep-verified no stale references remain (MULTIPLEXING, ${table} outside the explicit warning notes) and that anchors used in cross-references exist.
  • No full docs site build was run because this repository contains only the docs sources (no package.json/docusaurus tooling in-repo, no docs CI workflow); the checks above cover table structure and link integrity.

@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 another careful docs-accuracy pass. I reviewed the full diff (21 files, EN and ZH) at head 0ff2926cc1322f71d628c553568afc0507e25f59 and re-checked each claim against the code. Most of the corrections are right and valuable; two statements in the new Iceberg table_list table do not match the code, so they should be fixed before this lands.

What Problem Does This PR Solve?

Pain point: several connector pages describe options, enum values and placeholders that the code does not accept (MULTIPLEXING, DataHub ${table}, STRING -> ObjectId, Hive table_list inheritance), and omit options that do exist.

Fix approach: documentation-only edits, mirrored in EN and ZH, each backed by a code reference.

One-sentence summary: align file, Hive, Iceberg, MongoDB, DataHub and common-option docs with what the source really does.

1. Code Change Review

1.1 Core Logic Analysis (what I verified against source)

Confirmed correct:

  • dag-parsing.mode: ParsingMode has SINGLENESS, SHARDING and deprecated MULTIPLEX (ParsingMode.java); the new description of MULTIPLEX matches its Javadoc.
  • DataHub: DataHubSinkFactory.optionRule() registers MULTI_TABLE_SINK_REPLICA; TablePlaceholder defines database_name, schema_name, table_name and others, and no table key, so ${table} is not substituted.
  • LocalFile/HdfsFile sink: both factories register DATE_FORMAT_LEGACY, DATETIME_FORMAT_LEGACY, TIME_FORMAT_LEGACY (keys date_format, datetime_format, time_format; FormatOptions.java), consumed by the Text, Csv, Excel and Xml writers. LocalFile registers MULTI_TABLE_SINK_REPLICA. The reworded HdfsFile sink field_delimiter / row_delimiter descriptions match the writers (TextWriteStrategy and CsvWriteStrategy read the field delimiter; the text, csv and json writers read the row delimiter).
  • HdfsFile/LocalFile source: null_format is used by TextReadStrategy and CsvReadStrategy; skip_header_row_number is honoured by ExcelReadStrategy; excel_use_header_line, markdown_rag_metadata_enabled, pdf_rag_metadata_enabled exist in FileBaseSourceOptions and the source factories.
  • Hive source: MultipleTableHiveSourceConfig builds each table_list item with ReadonlyConfig::fromMap (no root inheritance); regex discovery throws if metastore_uri is blank; null_format and parse_partition_from_path are read in HiveSourceConfig. Hive sink: HiveTableTemplateUtils replaces ${current_timestamp}.
  • MongoDB sink: RowDataToBsonConverters STRING case only returns BsonString (or the value inside a _value wrapper); no ObjectId path exists.
  • ZH pages mirror the EN edits, including the Hive sink ${current_timestamp} and the yes/no column normalisation in the Chinese tables.

1.2 Compatibility Impact

Fully compatible. Documentation only; no code, option or default changes.

1.3 Performance / Side Effects

None.

1.4 Accuracy Issues Found

Issue 1 (Medium): the Iceberg table_list item key namespace is documented as supported, but the code ignores it.

  • Location: docs/en/connectors/source/Iceberg.md:149 and docs/zh/connectors/source/Iceberg.md:162 (new item-key table); code: IcebergSourceConfig.java:70.
  • Problem: when table_list is used, the constructor does .map(tableConfig -> tableConfig.setNamespace(this.getNamespace())), overwriting every item's namespace with the root namespace option (default default). A per-item namespace therefore has no effect. The only per-item way to target another database is a qualified table (SourceTableConfig.getTablePath() splits db.table).
  • Risk: users set namespace inside an item and silently read the wrong database/table, which is exactly the class of doc defect this PR is fixing.
  • Best improvement: drop the namespace row from the item table, or describe it as "ignored; the root namespace is used, use db.table in table to override".
  • Raised by another reviewer: no.

Issue 2 (Medium): wrong default for the per-item streamScanStrategy.

  • Location: docs/en/connectors/source/Iceberg.md:157 and docs/zh/connectors/source/Iceberg.md:170.
  • Problem: the table says TABLE_SCAN_THEN_INCREMENTAL is the default. SourceTableConfig.streamScanStrategy is initialised from KEY_STREAM_SCAN_STRATEGY.defaultValue() (SourceTableConfig.java:51), and that option's default is FROM_LATEST_SNAPSHOT (IcebergSourceOptions.java:62-65); items are deserialised by Jackson through the public no-arg constructor (ConfigUtil.convertValue), so the initializer applies. The root stream_scan_strategy row in the same file already documents FROM_LATEST_SNAPSHOT. This is my reading of the source; I did not run a job.
  • Risk: a streaming user who relies on the documented default expects a full table scan first, but gets incremental-from-latest, so historical rows are skipped.
  • Best improvement: change the default to FROM_LATEST_SNAPSHOT in both languages.
  • Raised by another reviewer: no.

Issue 3 (Low, non-blocking): "Supported formats" lists only a subset of the accepted values.

  • Location: docs/en/connectors/sink/LocalFile.md:62-64, docs/en/connectors/sink/HdfsFile.md:63-65 (and ZH).
  • Problem: DateUtils.Formatter also accepts yyyy/M/d, and DateTimeUtils.Formatter accepts about a dozen values (for example the T-separated ISO8601 forms and .SSSSSS). The text reads as an exhaustive list.
  • Best improvement: say "for example" or list all values.
  • Raised by another reviewer: no.

Issue 4 (Low, non-blocking): "root-level options outside table_list are ignored" is broader than the code.

  • Location: docs/en/connectors/source/Hive.md:45 (and ZH).
  • Problem: the connector options are indeed not inherited, but framework-level source options such as plugin_output and parallelism at the root are still honoured by the engine.
  • Best improvement: scope the sentence to connector options.
  • Raised by another reviewer: no.

2. Code Quality

2.1 Standards

Tables are well-formed and EN/ZH are consistent. No code changed, so no comment or logging concerns.

2.2 Tests

Not applicable (docs only). The fork run for this head passed Dead links, Build website, code style and license header.

2.3 Documentation

See Issues 1 to 4. EN/ZH parity is otherwise complete.

3. Architectural Soundness

3.1 Fix Type

Precise corrections of incorrect statements; no workarounds.

3.2 Maintainability

Adding the previously undocumented options reduces future drift. A small suggestion: because this PR verifies docs against source, a final grep of each new default in its option class (as in Issue 2) is the cheapest guard.

4. Issue Summary

ID Issue Location Severity
1 Item namespace documented but overwritten by root namespace source/Iceberg.md:149 (EN), :162 (ZH); IcebergSourceConfig.java:70 Medium
2 Wrong per-item streamScanStrategy default source/Iceberg.md:157 (EN), :170 (ZH); SourceTableConfig.java:51 Medium
3 Date/time format lists incomplete sink/LocalFile.md, sink/HdfsFile.md Low
4 "Root options ignored" too absolute source/Hive.md:45 Low

5. Merge Recommendation

Conclusion: Ready to merge after fixes

Blockers (documentation contract):

  1. Issue 1: remove or correct the item namespace row (EN and ZH).
  2. Issue 2: correct the streamScanStrategy default (EN and ZH).

Recommended non-blocking fixes: Issues 3 and 4.

CI: the fork run for this head is green (Dead links, Build website, code style, license header, sanity check); nothing here needs a rerun. The branch is up to date with dev.

…d Hive root options

- Iceberg.md (EN/ZH): the per-item namespace key is overwritten by the
  root namespace in IcebergSourceConfig, so document it as ignored and
  point users at qualified db.table values; correct the per-item
  streamScanStrategy default to FROM_LATEST_SNAPSHOT.
- LocalFile.md / HdfsFile.md (EN/ZH): present the date/datetime/time
  format lists as examples instead of exhaustive lists.
- Hive.md (EN/ZH): scope the 'options outside table_list are ignored'
  statement to connector options; framework options still apply.
@zhangshenghang

Copy link
Copy Markdown
Member Author

Thanks for the careful re-check against the option classes. All four findings are addressed in 279af8d: the Iceberg table_list namespace row now documents that each item is overwritten by the root namespace (qualified db.table in table is the per-item override), the per-item streamScanStrategy default is corrected to FROM_LATEST_SNAPSHOT, the date/datetime/time format lists in LocalFile/HdfsFile are presented as examples, and the Hive root-options statement is scoped to connector options while noting framework options like plugin_output and parallelism still apply (EN and ZH updated in all four cases).

@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 @zhangshenghang for the quick turnaround. I reviewed the new head 279af8d901735d3774398547de9e14184c602c7c (commit "Address review findings on Iceberg table_list, format lists and Hive root options") on top of my previous review of 0ff2926c. All four findings from the last round are addressed, and I re-checked each fix against the source.

What Problem Does This PR Solve?

Pain point: several connector pages described options, enum values and placeholders that the code does not accept (MULTIPLEXING, DataHub ${table}, STRING -> ObjectId, Hive table_list inheritance) and omitted options that do exist.

Fix approach: documentation-only edits, mirrored in EN and ZH, each backed by a code reference.

One-sentence summary: align file, Hive, Iceberg, MongoDB, DataHub and common-option docs with what the source really does.

1. Code Change Review

1.1 Core Logic Analysis (verified against source)

Delta since my last review (0ff2926c -> 279af8d9, 8 doc files, 16 lines):

  • Iceberg table_list item key namespace (previous Issue 1): now documented as ignored, with db.table in table as the per-item override. This matches IcebergSourceConfig.java:70, which does tableConfig.setNamespace(this.getNamespace()) for every item. Fixed in EN and ZH.
  • Iceberg per-item streamScanStrategy default (previous Issue 2): now FROM_LATEST_SNAPSHOT. This matches SourceTableConfig.java:51 (= KEY_STREAM_SCAN_STRATEGY.defaultValue()). Fixed in EN and ZH.
  • Date/time format lists (previous Issue 3): LocalFile and HdfsFile sink EN rows now say "Supported formats (examples)". See Issue 1 below for a small ZH inconsistency.
  • Hive table_list root-options sentence (previous Issue 4): now scoped to connector options and says framework-level options such as plugin_output and parallelism still apply (EN and ZH).

The rest of the PR is unchanged from the head I already verified in the last round.

1.2 Compatibility Impact

Fully compatible. Documentation only; no code, option name or default changes.

1.3 Performance / Side-Effect Analysis

None.

1.4 Error Handling and Logging

Issue 1 (Low, non-blocking): ZH datetime_format rows were not given the "examples" wording.

  • Location: docs/zh/connectors/sink/HdfsFile.md:63 and docs/zh/connectors/sink/LocalFile.md:63 (the datetime_format rows).
  • Problem description: in the new commit the ZH date_format and time_format rows were changed to read as an example list, but the ZH datetime_format row still says "supported formats" without the qualifier, while the EN datetime_format row was updated. The list there is still only a subset of what the code accepts.
  • Potential risk: a small EN/ZH mismatch; a ZH reader may read the list as exhaustive.
  • Best improvement: apply the same wording to the two ZH datetime_format rows.
  • Severity: Low
  • Raised by another reviewer: no

2. Code Quality Assessment

2.1 Coding Standards

Tables stay well-formed and EN/ZH are consistent apart from Issue 1. No code changed.

2.2 Test Coverage and Test Stability

Not applicable (docs only). No test files changed.

2.3 Documentation Updates

EN and ZH both updated for every item in the PR description. The only gap is Issue 1.

3. Architectural Soundness

3.1 Fix Type

Precise fix (corrections of incorrect statements, no workarounds).

3.2 Maintainability

Good. Each default and key is now traceable to an option class.

3.3 Extensibility

N/A for a docs-only change.

3.4 Historical Compatibility

No behavior change.

4. Issue Summary

ID Issue Location Severity
1 ZH datetime_format rows lack the "examples" wording docs/zh/connectors/sink/HdfsFile.md:63, docs/zh/connectors/sink/LocalFile.md:63 Low

5. Merge Recommendation

Conclusion: Ready to merge

Blockers: none.

Recommended non-blocking fixes: Issue 1 (optional wording alignment in two ZH rows).

CI: the Build check for this head completed successfully, and the branch is up to date with dev (behind by 0). I did not run anything locally; this is a source and docs review.

Overall assessment: all previous findings are fixed and verified against the code. Thanks again for the careful, source-backed docs work.

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

+1
Good job~

@davidzollo
davidzollo added this pull request to the merge queue Nov 2, 2026
Merged via the queue into apache:dev with commit 70ef5cd Nov 2, 2026
3 checks passed
zhangshenghang pushed a commit to zhangshenghang/seatunnel that referenced this pull request Nov 2, 2026
Resolve Datahub.md (EN/ZH) conflicts: keep the dev-side placeholder
description and FAQ wording consolidated by apache#13089.
zhangshenghang pushed a commit to zhangshenghang/seatunnel that referenced this pull request Nov 3, 2026
Resolve JDBC-family source table and RocketMQ FAQ conflicts (EN/ZH):
keep the dev-side wording verified in apache#12447/apache#12865/apache#13089 (DB2 BIGINT
to LONG, DECIMAL(precision, scale), OceanBase merged unsigned rows and
Number(p,s) qualification, partition-row formatting).
zhangshenghang pushed a commit to zhangshenghang/seatunnel that referenced this pull request Nov 3, 2026
Resolve JDBC source table conflicts (EN/ZH): keep the dev-side rows
verified in apache#12865/apache#13089 (Oracle NUMBER scale>0/scale<0 split,
TIMESTAMP_TZ(s)/DATETIMEOFFSET(s) scale, PostgreSQL _BYTEA removal) and
partition-row formatting.
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.

4 participants