Skip to content

[Docs] Fix CDC, InfluxDB, file and IM connector doc inaccuracies verified against source code - #12771

Merged
davidzollo merged 3 commits into
apache:devfrom
zhangshenghang:docs-fix-batch-20261014
Oct 24, 2026
Merged

davidzollo merged 3 commits into
apache:devfrom
zhangshenghang:docs-fix-batch-20261014

Conversation

@zhangshenghang

Copy link
Copy Markdown
Member

Purpose of this PR

This PR fixes a batch of real documentation issues found by comparing the docs against the actual connector source code on dev. All findings were verified against the code before editing, and every issue is fixed in both the English and Chinese docs.

What was changed

PostgreSQL-CDC (en/zh)

  • All three task examples used a non-existent option schema-names; the connector only defines schema-name (PostgresIncrementalSourceOptions.java). Because of the wrong key, schema filtering silently did not apply. Fixed the examples and added the missing schema-name row to the options table.
  • server-time-zone default was documented as UTC, but the code default is ZoneId.systemDefault().getId() (JdbcSourceOptions.java); changed to -, consistent with the MySQL-CDC/Oracle-CDC pages (the row description already explained the real behavior).
  • connect.timeout.ms type was documented as Duration, but the code declares longType(); changed to Long.

MongoDB-CDC (en/zh)

  • Added the missing format option row (DEFAULT / COMPATIBLE_DEBEZIUM_JSON, defined in the CDC base SourceOptions and applied by MongodbIncrementalSource), mirroring the MySQL-CDC page.
  • debezium default was documented as -, but the MongoDB option overrides the base option with the default map {key.converter.schemas.enable=false, value.converter.schemas.enable=false} (MongodbIncrementalSourceOptions.java).

InfluxDB source (en/zh)

  • The partition_num split description was inverted: the code clamps the partition count down to upper_bound - lower_bound when partition_num is greater than the range (InfluxDBSourceSplitEnumerator.genSplitNumRange), not when it is less.

InfluxDB sink (en/zh)

  • key_time claimed ISO-8601 timestamp strings are accepted, but the serializer only does Long.parseLong for STRING fields (DefaultSerializer.createTimestampExtractor); an ISO-8601 string would throw NumberFormatException. Rewrote the description (BIGINT epoch millis / numeric STRING / TIMESTAMP with UTC conversion) and clarified the STRING row of the type-mapping table.

Oracle-CDC (en)

  • The heading "Oracle 11g is not supported" (above the GRANT LOGMINING statement) read as if Oracle CDC does not support Oracle 11g, contradicting the FAQ on the same page. Reworded to "The following privilege is not supported on Oracle 11g", matching the Chinese page.

S3File (en/zh)

  • Source: parse_partition_from_path example said the path .../age=26 adds age=16; fixed to age=26.
  • Sink: added the missing multi_table_sink_replica row (present in S3FileSinkFactory.optionRule() and documented on other file-sink pages).

S3File (zh only, en was already correct)

  • field_delimiter said it is only used for text, but the code applies it to text and csv (BaseFileSinkConfig); fixed in the table and the section description.
  • merge_update_event description was truncated mid-sentence; completed it to explain the UPDATE_BEFORE/UPDATE_AFTER merging behavior.
  • The "Simple" example had broken HOCON: the source { block was closed by a stray nested source { } instead of }, so transform/sink ended up nested inside source. Fixed to match the English page.

GcsFile source (en/zh)

  • Added options that exist in GcsFileSourceFactory.optionRule() / the shared reader but were undocumented (all are documented on the S3 page): date_format, datetime_format, time_format, csv_use_header_line, file_filter_modified_start, file_filter_modified_end, sort_files_by_modification_time, metalake_type.

Socket sink (en only, zh was already correct)

  • Example said input age: 12 produces {"name":"jared","age":17}; fixed the input to age: 17.

SftpFile sink (zh only)

  • The :::tip admonition block was never closed, so the rest of the page (key features onward) fell inside the tip container; added the closing ::: to match the English page.

Feishu sink (zh only)

  • The rich-text example used named_struct(...), a function that does not exist in SeaTunnel SQL (the correct MAP(...) is used on the English page); the ZH example would fail at runtime.

Which areas / files were updated

18 documentation files (docs/en + docs/zh), all under docs/*/connectors/:

  • source/PostgreSQL-CDC.md, source/MongoDB-CDC.md, source/Oracle-CDC.md, source/InfluxDB.md, source/S3File.md, source/GcsFile.md
  • sink/InfluxDB.md, sink/S3File.md, sink/Socket.md, sink/Feishu.md, sink/SftpFile.md (and their docs/zh counterparts)

No code was changed in this PR.

Were both English and Chinese docs checked?

Yes. Every issue above was fixed in both languages where applicable; for issues that existed only in one language (SftpFile tip block, Feishu named_struct, ZH S3File table/示例, EN Socket example, EN Oracle-CDC heading), the other language was verified as already correct.

How duplicate PRs were checked

I reviewed all SeaTunnel PRs opened in the last 7 days (by any author), including the docs batches #12758, #12730, #12709, #12693 and #12679, plus #12663 and #12703. I programmatically compared the union of the files touched by those PRs with the 18 files changed here: zero file overlap. This PR therefore does not repeat any recent fix; the connectors above (PostgreSQL-CDC, MongoDB-CDC, Oracle-CDC, InfluxDB, S3File, GcsFile, Socket, SftpFile, Feishu) were not covered by them.

How the change was verified

  • For every fix, the doc statement was compared against the actual Java source (option definitions, OptionRules, split-enumeration and serializer code paths), referenced above by class names.
  • A Markdown table consistency check was run over all 18 modified files: 0 column-count issues.
  • A relative-link check was run over all 18 modified files: 0 broken links.
  • Confirmed no leftover occurrences of the wrong keys (schema-names, named_struct).
  • Full mvnw verify / site build was not run because this PR contains documentation-only changes; no Java code, configuration, or build files were touched.

@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 this careful docs sweep, @zhangshenghang! I went through the full diff of all 18 files (en and zh) and checked each claim against the connector source on the PR head. Almost everything is accurate, and the PostgreSQL-CDC schema-name fix in particular is a great catch. I found one new inaccuracy in the InfluxDB sink text that I think should be fixed before merge, plus one follow-up of the same kind as your PostgreSQL fix. Details below.

What Problem Does This PR Solve?

  • User pain point: several connector pages describe options, defaults or examples that do not match the code. The worst case is the PostgreSQL-CDC examples using schema-names, which the connector does not define, so the schema filter is silently ignored.
  • Fix approach: docs-only edits in docs/en and docs/zh for PostgreSQL-CDC, MongoDB-CDC, Oracle-CDC, InfluxDB (source and sink), S3File, GcsFile, Socket, SftpFile and Feishu.
  • In one sentence: align documented options, defaults and examples with what the code actually does.

1. Code Change Review

1.1 Core Logic Analysis

No code is changed. I verified the factual claims against source on the PR head. Verified as correct:

  • PostgreSQL-CDC: option key is schema-name (PostgresIncrementalSourceOptions.java:46-47, read by PostgresSourceConfigFactory.java:51); server-time-zone default is ZoneId.systemDefault() (JdbcSourceOptions.java:62-65); connect.timeout.ms is Long (JdbcSourceOptions.java:83-86).
  • MongoDB-CDC: format is in the shared base rule (SourceOptions.java:107-111, getBaseRule() at :160); the debezium default map is the two *.converter.schemas.enable=false entries (MongodbIncrementalSourceOptions.java:123-132).
  • InfluxDB source: genSplitNumRange clamps to upper - lower when upperBound - lowerBound < numPartitions, i.e. when partition_num is greater than the range (InfluxDBSourceSplitEnumerator.java:219-220). The corrected sentence is right.
  • S3File sink: multi_table_sink_replica is in S3FileSinkFactory.java:120. GcsFile source: date_format, datetime_format, time_format, metalake_type (default gravitino, EnvCommonOptions.java:143-145) are in the factory, and the other new rows are read by the shared read strategies (file_filter_modified_start, csv_use_header_line, sort_files_by_modification_time), which receive the full plugin config for GCS too.
  • The age=26, Socket age: 17, SftpFile ::: closing, Feishu MAP(...) (the MAP function exists in ZetaSQLFunction) and S3File zh HOCON fixes are straightforward and correct.

Key findings:

  • The edits are precise, scoped to docs, and keep en and zh in sync.
  • One new statement is not accurate under default settings (Issue 1).
  • The PostgreSQL schema-names mistake exists in other pages that this PR does not touch (Issue 2).

1.2 Compatibility Impact

Fully compatible. Docs only; no option, default, protocol or serialization change.

1.3 Performance / Side-Effect Analysis

None (documentation only).

1.4 Error Handling and Logging

Not applicable.

Issue 1: InfluxDB sink key_time now says "epoch milliseconds", but the unit is the configured epoch precision (default nanoseconds)

  • Location: docs/en/connectors/sink/InfluxDB.md:86-91 and docs/zh/connectors/sink/InfluxDB.md:85-89; code at DefaultSerializer.java:114-141.
  • Problem description: the new text says the field must be a BIGINT "epoch-milliseconds value" (and a numeric STRING epoch value). In the serializer, BIGINT and numeric STRING values are passed straight to builder.time(value, precision), where precision comes from the epoch option (setPrecision(TimePrecision.getPrecision(config.get(InfluxDBSinkOptions.EPOCH)))). The epoch doc a few lines below states that the default n is treated as nanoseconds. So with default settings a BIGINT key_time is interpreted as nanoseconds, not milliseconds. A user who follows the new sentence and writes millisecond values with the default epoch will get timestamps near 1970.
  • Potential risk: the PR exists to remove misleading docs, and this sentence would replace one inaccuracy (ISO-8601) with another (unit), with a silent data-correctness effect for users.
  • Best improvement: describe the unit as "an integer epoch value in the precision configured by epoch (default n, nanoseconds)", for both the BIGINT and numeric STRING cases, in en and zh. For the TIMESTAMP case the code converts to epoch milliseconds and then still passes the configured epoch unit, so I would either leave the pre-existing TIMESTAMP wording as it was or add a short note that it is only consistent when epoch = MS. Please do not claim more than the code does.
  • Severity: Medium (blocks merge, small doc edit)
  • Raised by another reviewer: No

Issue 2: The same wrong schema-names key remains in other PostgreSQL examples that this PR does not touch (non-blocking)

  • Location: docs/en/connectors/cdc-production-cookbook.md:254 and docs/zh/connectors/cdc-production-cookbook.md:249 (the Postgres-CDC block), and docs/en/getting-started/recipes/postgresql-cdc-to-iceberg.md:144 plus the zh counterpart.
  • Problem description: these Postgres-CDC examples still use schema-names, which the Postgres connector does not define, so the same silent-ignore problem remains for readers of those pages. The Oracle-CDC occurrences are correct (OracleIncrementalSourceOptions.SCHEMA_NAMES is schema-names) and should stay.
  • Potential risk: low, but it is the exact user trap this PR is fixing.
  • Best improvement: change those Postgres blocks to schema-name in this PR (4 one-line edits) or in a small follow-up.
  • Severity: Low
  • Raised by another reviewer: No

2. Code Quality Assessment

2.1 Coding Standards

Docs formatting matches the surrounding tables. No code, so no Javadoc concerns.

2.2 Test Coverage and Test Stability

Not applicable (no test changes).

2.3 Documentation Updates

This is the documentation. en and zh are consistent for every item that applies to both languages; the zh-only and en-only fixes were checked against the other language as the description says. One small note on the PR description: it says the new GcsFile rows are in GcsFileSourceFactory.optionRule(), but only some are (date_format, datetime_format, time_format, metalake_type); the other four are consumed by the shared read strategies. The docs rows themselves are fine.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix.

3.2 Maintainability

Good: small, source-linked edits.

3.3 Extensibility

Not applicable.

3.4 Historical-Version Compatibility

No impact.

4. Issue Summary

# Issue Location Severity
1 InfluxDB sink key_time unit documented as milliseconds, but follows the epoch precision (default ns) docs/en/connectors/sink/InfluxDB.md:86-91, docs/zh/connectors/sink/InfluxDB.md:85-89 Medium
2 Postgres examples elsewhere still use schema-names docs/en/connectors/cdc-production-cookbook.md:254, docs/en/getting-started/recipes/postgresql-cdc-to-iceberg.md:144 (+ zh) Low

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers - must be fixed:
    • Issue 1: correct the key_time unit wording (en and zh).
  2. Recommended fixes - non-blocking:
    • Issue 2: fix the remaining Postgres schema-names examples.

CI on this head: no failing checks (docs-only change, most code jobs skipped). The branch is 2 commits behind dev and GitHub shows it as blocked only because a committer approval is still required; as a read-only reviewer I cannot give that approval. Overall this is a valuable cleanup and a very small edit away from done. Happy to re-review once you push an update!

Jelana and others added 2 commits October 20, 2026 13:39
…589f

# Conflicts:
#	docs/en/connectors/source/GcsFile.md
#	docs/en/connectors/source/MongoDB-CDC.md
#	docs/zh/connectors/source/GcsFile.md
#	docs/zh/connectors/source/MongoDB-CDC.md
…s schema-names examples

Per review feedback:
- InfluxDB sink: the BIGINT/numeric-STRING key_time value is interpreted
  in the precision configured by the epoch option (default n, nanoseconds),
  not always epoch milliseconds; a TIMESTAMP value is converted to epoch
  milliseconds and only matches the point precision when epoch is MS.
- Replace the undefined schema-names key with schema-name in the
  Postgres-CDC examples of cdc-production-cookbook and the
  postgresql-cdc-to-iceberg recipe (en and zh).

Co-authored-by: multica-agent <github@multica.ai>

@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 the quick turnaround, @zhangshenghang! I re-read the new commit on top of the merged dev and verified it against the connector source. Both items from my earlier review are resolved.

What Problem Does This PR Solve?

User pain point: Several connector and CDC docs contradicted the code (wrong option names, wrong defaults, missing options, wrong value formats), which leads users to configs that are silently ignored or behave differently than documented.

Fix approach: Source-verified doc edits across 22 files (en and zh kept in step): CDC, InfluxDB, file connectors and IM connectors.

One-sentence summary: Documentation-only accuracy pass; no code, option, default or protocol changes.

1. Code Change Review

1.1 Core Logic Analysis

Docs only. The last commit (0f665e2) changes six files: the InfluxDB sink key_time wording (en and zh) and the Postgres-CDC example key in cdc-production-cookbook.md and postgresql-cdc-to-iceberg.md (en and zh). The rest of the 22-file diff is unchanged from the head I reviewed before.

Verification against source on this head:

  • InfluxDB key_time: DefaultSerializer.createTimestampExtractor passes BIGINT, numeric STRING and TIMESTAMP (converted with toEpochMilli()) all to builder.time(value, precision), and precision comes from the epoch option via TimePrecision.getPrecision, which falls back to NS for any unrecognised value (including the default n). The new wording ("epoch value in the precision configured by epoch (default n, nanoseconds)", and TIMESTAMP "only matches the point precision when epoch is set to MS") matches the code exactly, en and zh.
  • Postgres examples now use schema-name, consistent with PostgreSQL-CDC.md (schema-name, lines 105/244/273). The remaining schema-names occurrences in docs (Oracle-CDC.md, the Oracle block in the cookbook, schema-evolution, field/table-rename transforms) are Oracle-CDC examples, where schema-names is the correct key. I did not find any remaining Postgres schema-names example.

1.2 Compatibility Impact

Fully compatible. No option, default, serialization or checkpoint change.

1.3 Performance / Side-Effect Analysis

None (documentation only).

1.4 Error Handling and Logging

Not applicable. No open issues.

2. Code Quality Assessment

2.1 Coding Standards

Formatting matches the surrounding tables and prose.

2.2 Test Coverage and Test Stability

No test changes, none needed.

2.3 Documentation Updates

This is the documentation. en and zh are consistent for every edit that applies to both languages.

3. Architectural Soundness

3.1 Elegance

Precise fix.

3.2 Maintainability

Small, source-linked edits.

3.3 Extensibility

Not applicable.

3.4 Historical-Version Compatibility

No impact.

4. Issue Summary

Number Issue Location Severity
- No open issues (previous Issue 1 and Issue 2 are fixed) - -

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers - must be fixed: none found.
  2. Recommended fixes - non-blocking: none. Residual risk: I spot-checked the unchanged part of the 22-file diff only through my previous full review; this pass focused on the delta and the two earlier findings.

Overall assessment: both of my earlier notes (InfluxDB time unit, remaining Postgres schema-names) are fixed accurately. CI on this head has no failing checks (docs-only, Build/labeler/notify all success); the branch is up to date with dev and is "blocked" only by the pending committer approval. Nice work!

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

Quick update on the CI fact cited in my previous review: the Build check on head 0f665e211 is now green. My previous review found no source-level blocker and CI was the only remaining gate, so I am updating my conclusion to approve. The formal merge still needs a committer with write access. Thanks again for the contribution!

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

Thanks for addressing the earlier notes on the InfluxDB time unit and the Postgres schema-names rows. The head is unchanged since review and Build is green. Approving and queueing for merge.

@davidzollo
davidzollo added this pull request to the merge queue Oct 24, 2026
Merged via the queue into apache:dev with commit 9ab97e1 Oct 24, 2026
4 checks passed
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