Skip to content

[Docs] Fix DuckDB, Kingbase, SmbFile, Rabbitmq and other connector doc inaccuracies verified against source code - #12951

Merged
nzw921rx merged 1 commit into
apache:devfrom
zhangshenghang:docs-fix-batch-20261022
Oct 27, 2026
Merged

nzw921rx merged 1 commit into
apache:devfrom
zhangshenghang:docs-fix-batch-20261022

Conversation

@zhangshenghang

Copy link
Copy Markdown
Member

Acknowledgment

I acknowledge that I am contributing to Apache SeaTunnel and I am happy to contribute to this project.

What documentation issues were found

While auditing connector documentation against the actual source code (Option definitions, OptionRule constraints, and type converters), I found the following real inaccuracies:

  1. DuckDB source & sink — stale data type mapping tables (4 files): The tables were copied from another dialect and contradicted DuckDBTypeConverter:
    • Source: UTINYINT was documented as SMALLINT (actually TINYINT), USMALLINT as INT (actually SMALLINT), UINTEGER as BIGINT (actually INT), UBIGINT as DECIMAL(20,0) (actually BIGINT), TIMESTAMP WITH TIME ZONE as TIMESTAMP (actually TIMESTAMP_TZ), ARRAY/STRUCT/MAP as BYTES (actually STRING); UHUGEINT/BIGNUM were missing from the DECIMAL(38,0) row; oversized DECIMAL was documented as DECIMAL(38,18) while the code preserves the original scale (DECIMAL(38,y)).
    • Sink: TINYINT/SMALLINT were documented as mapping to INTEGER (actually each keeps its own type), oversized DECIMAL as DECIMAL(38,18) (actually DECIMAL(38,y)), and ARRAY/ROW/MAP as BLOB although the converter rejects them; TIMESTAMP_TZ → TIMESTAMP WITH TIME ZONE was missing.
  2. DuckDB source — query marked as required: only url and driver are required in JdbcSourceFactory; query is optional (table_path/table_list are alternatives). The doc itself even showed examples without query.
  3. Kingbase source & sink — wrong SMALLSERIAL mapping (4 files): SMALLSERIAL maps to SMALLINT (via PostgresTypeConverter, inherited by KingbaseTypeConverter), not INT together with SERIAL/INT4.
  4. Kingbase source & sink — non-canonical SeaTunnel type names: LOCALDATETIME/LOCALTIME/LOCALDATE corrected to TIMESTAMP/TIME/DATE, matching PostgreSQL.md and the actual LocalTimeType mappings.
  5. SmbFile source — three supported options missing from the option table (2 files): excel_use_header_line, markdown_rag_metadata_enabled and pdf_rag_metadata_enabled are defined in FileBaseSourceOptions and part of the SmbFile source option rule, but were undocumented.
  6. RabbitMQ sink — misleading rabbitmq.config claims (2 files): the FAQ and two examples recommended tuning connection resilience via rabbitmq.config, but the sink parses this option without ever applying it to the RabbitMQ client (sinkOptionProps has no consumers; RabbitmqClient only applies the dedicated typed options). Examples were cleaned up and the FAQ/option description now point to the real options.
  7. Hudi sink — index_type section header said [string] while the option is an enum (HoodieIndex.IndexType) and the doc's own table says enum (2 files).
  8. HBase source — wrong wording and feature label (2 files): batch was described as limiting "columns" per scan; the code (and the doc's own table) says "cells". The feature list said "schema projection" while the connector implements SupportColumnProjection ("column projection").
  9. FakeSource — double.fake.mode description said "generating float data" (copy-paste from the float row; the code says double) (1 file).
  10. Chinese/English parity gaps: zh Opengauss-CDC was missing step 3 of the "使用步骤" section; zh Aerospike sink was missing the whole "Stream CDC Records Into Aerospike With kv Format" example; zh ClickhouseFile had the timer flush feature checkbox orphaned outside the feature list.

What was changed

All of the above were corrected so the documentation matches the code: type mapping tables rewritten per DuckDBTypeConverter / PostgresTypeConverter, required flags fixed, missing options documented with the code's own descriptions, misleading RabbitMQ guidance replaced with the options the sink actually applies, and the missing/misplaced zh content added.

Which areas/files were updated

20 files (10 en + 10 zh): docs/{en,zh}/connectors/source/{DuckDB,Kingbase,SmbFile,Hbase,FakeSource,Opengauss-CDC}.md, docs/{en,zh}/connectors/sink/{DuckDB,Kingbase,Hudi,Rabbitmq}.md, plus docs/zh/connectors/sink/{Aerospike,ClickhouseFile}.md.

Were both English and Chinese docs checked?

Yes. Every English fix was mirrored into the corresponding Chinese page, and three Chinese-only gaps (Opengauss-CDC step 3, Aerospike CDC example, ClickhouseFile layout) were fixed by aligning with the English pages.

How duplicate PRs from the last 7 days were checked

I listed all my open/merged PRs of the last 7 days (#12941, #12932, #12911, #12865, #12813, #12771, #12730) and collected every file they touch. The files and issues fixed here (DuckDB, Kingbase, SmbFile, Hbase, FakeSource, Opengauss-CDC, Rabbitmq, Hudi, Aerospike, ClickhouseFile) do not overlap with any of them. I also searched open documentation-labeled PRs from other authors and found no PR covering these connectors.

How the change was verified

  • Every corrected value was verified against the source code before editing (e.g. DuckDBTypeConverter, PostgresTypeConverter/KingbaseTypeConverter, JdbcSourceFactory option rule, FileBaseSourceOptions + SmbFileSourceFactory, RabbitmqConfig/RabbitmqClient, FakeSourceOptions, HudiSinkOptions, HbaseSourceOptions).
  • Ran a markdown table integrity check over all 20 changed files (header/row column consistency): OK.
  • Ran a relative-link existence check over all changed files: OK.
  • A full site build was not run because the Docusaurus site lives in the separate apache/seatunnel-site repository; no in-repo docs build exists.

…c inaccuracies verified against source code

@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 this careful documentation audit. Checking docs against the converters and option rules is exactly the kind of work that keeps users from getting burned, and I enjoyed reading it.

This is a static review of head 1befa0d409dfa7b1626b9b707655416cdccf541e; I did not build the docs site or execute anything locally.

What Problem Does This PR Solve?

  • User pain point: several connector pages contradicted the code (stale DuckDB type tables, query marked required for the DuckDB source, wrong Kingbase SMALLSERIAL mapping, undocumented SmbFile options, a RabbitMQ rabbitmq.config tip that has no effect), and a few zh pages lagged behind en.
  • Fix approach: docs-only edits across 20 files (10 en + 10 zh), aligned with DuckDBTypeConverter, PostgresTypeConverter/KingbaseTypeConverter, JdbcSourceFactory, FileBaseSourceOptions, RabbitmqConfig/RabbitmqClient, and HBase source options.
  • Summary: a docs-only accuracy fix; every claim I spot-checked matches the code.

1. Code Change Review

1.1 Core Logic Analysis

No src/main changes. I verified each claim against the pinned SHA:

  • DuckDB source mapping (DuckDBTypeConverter.convert): UTINYINT -> BYTE, USMALLINT -> SHORT, UINTEGER -> INT, UBIGINT -> LONG, HUGEINT/UHUGEINT/BIGNUM -> DECIMAL(38,0), TIMESTAMP WITH TIME ZONE -> OFFSET_DATE_TIME (TIMESTAMP_TZ), ARRAY/STRUCT/MAP -> STRING. Matches the new table. Oversized DECIMAL keeps scale (handleDecimalType), so DECIMAL(38,y) is right.
  • DuckDB sink mapping (reconvert): TINYINT/SMALLINT keep their own types, TIMESTAMP_TZ -> TIMESTAMP WITH TIME ZONE, and unsupported types (ARRAY/ROW/MAP) hit default -> convertToConnectorTypeError. Matches "Not supported".
  • DuckDB source query optional: JdbcSourceFactory.optionRule() requires only URL and DRIVER; QUERY is optional. Correct.
  • Kingbase: KingbaseTypeConverter extends PostgresTypeConverter, which maps smallserial -> SHORT_TYPE and serial -> INT_TYPE. The corrected rows are right.
  • SmbFile: EXCEL_USE_HEADER_LINE, MARKDOWN_RAG_METADATA_ENABLED, PDF_RAG_METADATA_ENABLED exist in FileBaseSourceOptions and are read by the Excel/Markdown/PDF read strategies.
  • RabbitMQ: RabbitmqConfig stores rabbitmq.config into sinkOptionProps and that field has no other reader in the module; RabbitmqClient only applies the typed options. The new note and FAQ wording are accurate, and network_recovery_interval, topology_recovery_enabled, AUTOMATIC_RECOVERY_ENABLED, connection_timeout are real option keys.
  • HBase: the option description in HbaseSourceOptions says "cells", and scan.setBatch(...) is used, so the wording fix is correct.
  • zh parity: the Aerospike kv example matches the en page (DataFormatType.KV, write_timeout exist), and the Opengauss-CDC step 3 matches en.

1.2 Compatibility Impact

Fully compatible: documentation only, no config, default, or serialization change.

1.3 Performance / Side-Effect Analysis

None (docs only).

1.4 Error Handling and Logging

N/A. No blocking issues found.

2. Code Quality Assessment

2.1 Coding Standards

N/A for Java. The new markdown tables are a bit loose in column alignment in a few places (for example the zh DuckDB sink table), which does not affect rendering.

2.2 Test Coverage and Test Stability

No tests touched. Stability rating: n/a.

2.3 Documentation Updates

en and zh are updated in step. Two optional, non-blocking observations:

  • Issue 1: Kingbase tables still list INT2 -> SHORT
    • Location: docs/en/connectors/{source,sink}/Kingbase.md (INT2 row, and the zh equivalents)
    • Problem: you fixed the non-canonical LOCAL* names, but SHORT is also not a canonical SeaTunnel type name (the new SMALLSERIAL row says SMALLINT), so the same table now uses two names for the same type.
    • Potential risk: minor reader confusion.
    • Best improvement: change SHORT to SMALLINT in the same table.
    • Severity: Low
    • Raised by another reviewer: No
  • Issue 2: SmbFile new option rows use file_format_type wording
    • Location: docs/en/connectors/source/SmbFile.md new rows
    • Problem: neighbouring rows say file_format; harmless but slightly inconsistent.
    • Severity: Low (cosmetic)
    • Raised by another reviewer: No

3. Architectural Soundness

3.1 Elegance

Precise fix.

3.2 Maintainability

Good: each change is traceable to a concrete code location.

3.3 Extensibility

Not applicable.

3.4 Historical-Version Compatibility

No impact.

4. Issue Summary

# Issue Severity Blocking
1 Kingbase INT2 -> SHORT naming Low No
2 SmbFile wording nit Low No

5. Merge Recommendation

Conclusion: Ready to merge

  • Blockers: none.
  • Recommended non-blocking: the two Low items above.
  • CI: the Build workflow is SUCCESS for this head. The branch is mergeable (the blocked state is only the pending required review); it is 12 commits behind dev, which is metadata only.
  • Overall: a high-quality docs audit, thanks again for the thorough source verification.

@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

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