Repository navigation
[Docs] Fix file connector doc inaccuracies, malformed tables and missing option rows verified against source code - #12499
Conversation
…ing option rows verified against source code
There was a problem hiding this comment.
What Problem Does This PR Solve?
Thanks @zhangshenghang for another careful docs-accuracy sweep. This PR corrects a batch of drift between the file-family, messaging and database connector docs (EN and ZH) and what the code does. It fixes wrong defaults and required flags, malformed or duplicated table rows and duplicated example sections. It also adds option rows that exist in code but were missing from the docs. It is docs-only: 50 files, +128/-229, no Java or config changes.
I checked each claim against the PR head source. Nearly all of them hold. I found one place where the PR adds a new inaccuracy (Issue 1) and a few small consistency gaps.
1. Code Change Review
1.1 Core Logic Analysis
No production code changes, so I traced each documented claim to the code path that backs it.
Claims verified against source
sheet_namesink defaultSheet0.ExcelGenerator.java:96-97usessheetName.orElseGet(() -> String.format("Sheet%d", 0)).FileBaseSinkOptions.SHEET_NAMEhasnoDefaultValue(), so the oldSheet${Random number}text was wrong.- Overflow sheets are
Sheet1,Sheet2, ... (ExcelGenerator.java:72-75), which is consistent. - I confirmed no
Sheet${Random number}or its Chinese-language equivalent string remains anywhere underdocs/.
tmp_pathis optional.FileBaseSinkOptions.TMP_PATHhasdefaultValue(DEFAULT_TMP_PATH).- The Hdfs, Ftp and Sftp factories declare it with
.optional(...)(for exampleFtpFileSinkFactory.java:58,SftpFileSinkFactory.java:122,HdfsFileSinkFactory.java:125). - No
tmp_path ... requiredrow remains in the docs.
- Sink
field_delimiterdefault depends on the format.BaseFileSinkConfig.java:69-77sets,when the option is absent and the format is CSV, and\001otherwise.- The new default cell
'\001' for text and ',' for csvis correct.
read_partitionsis honored by the shared read path.- It is read at
AbstractReadStrategy.java:349-352. - It is applied at
AbstractReadStrategy.java:277-284, and also in the continuous enumerator (ContinuousMultipleTableFileSourceSplitEnumerator.java:2322). - All 12 file source docs (EN and ZH) now have exactly one row.
- It is read at
- Socket
max_retries.SocketSinkFactory.java:43-44attachesConditions.greaterOrEqual(MAX_RETRIES, 0).ConfigValidator.java:138and:230evaluate value constraints, so-1is rejected beforeSocketClientever sees it. The old "-1 means infinite" wording was unreachable.
multi_table_sink_replica.- The default is
1(SinkConnectorCommonOptions.java:30-34). InfluxDBSinkFactory.java:64andSmbFileSinkFactory.java:61both declare it.
- The default is
- Milvus
rate_limit(ZH).- The reader alters
collection.queryRate.max.qpsinMilvusSourceReader.setRateLimit. close()resets it to-1(MilvusSourceReader.java:118-121).- The new ZH text matches this, including the crash-before-close caveat.
- The reader alters
- MongoDB
matchQuery(ZH).MongodbSourceOptions.java:25-30declaresmatch.querywithwithFallbackKeys("matchQuery"), so "equivalent,match.querywins" is correct. - HdfsFile source duplicate sections.
- On
dev, the "Incremental Sync" and "Continuous Discovery" blocks appear twice. I diffed EN lines 494-571 against 572-649 and they are byte-identical. The ZH file shows the same duplicated headings. - After the PR, exactly one copy of each heading remains in both languages, so the removal loses no content.
- On
- HdfsFile sink duplicate
compress_codec, S3File source duplicatecsv_use_header_line. The short duplicate rows were removed and the fuller row remains. I checked both. - S3File source
file_filter_modified_start/_end. These are honored by the sharedAbstractReadStrategy(getFileModifiedDate), so adding the rows is correct.
Key Findings
- This is a docs-only, precise fix. The normal user path (someone reading these tables to write a job config) is exactly what is corrected.
- About 95% of the changes are verified-correct and low-risk.
- One group of added rows is not accurate for the connector it was added to (Issue 1).
- A couple of sweeps are incomplete (Issue 2), and one description is imprecise (Issue 3).
Issue 1 (Medium, blocker): ObsFile source docs add enable_file_split and file_split_size, but those options have no effect on this connector.
The PR body says the ObsFile rows were added because "the read path honors" them. It also says the continuous-discovery/sync family was left out because ObsFileSource extends BaseFileSource. The same reasoning applies to file splitting:
ObsFileSource extends BaseFileSource (connector-file-obs/.../ObsFileSource.java)
createEnumerator -> new FileSourceSplitEnumerator(...) (BaseFileSource.java:183)
discoverySplits: new FileSourceSplit(filePath) (FileSourceSplitEnumerator.java:99)
=> start = 0, length = -1 (FileSourceSplit.java: field defaults)
reader gate:
Text/Csv/Json: enableSplitFile && split.getLength() > -1 -> false (TextReadStrategy.java:224, CsvReadStrategy.java:205, JsonReadStrategy.java:117)
Parquet: enableSplitFile && ... split.getLength() > 0 -> false (ParquetReadStrategy.java:141, :183)
- Real splitting only happens when a
FileSplitStrategyproduces ranged splits. FileSplitStrategyFactory.initFileSplitStrategyis only called fromBaseMultipleTableFileSource.java:82.ObsFileSourceFactory.optionRule()also does not declare either option, unlike the Hdfs, Local, S3 and Gcs factories that do (for exampleS3FileSourceFactory.java:122-126).
So a user who follows the new doc row and sets enable_file_split = true on ObsFile gets a silent no-op. The docs then claim a parallelism improvement that never happens. That is worse than the omission this PR set out to fix.
Fix: remove the enable_file_split and file_split_size rows from docs/en/connectors/source/ObsFile.md (lines 95-96) and docs/zh/connectors/source/ObsFile.md (lines 98-99). The other ten added ObsFile rows are backed by AbstractReadStrategy or per-format read strategies that BaseFileSource does drive (readStrategy.setPluginConfig(...), BaseFileSource.java:~63). Those ten are fine.
1.2 Compatibility Impact
Fully compatible. Only Markdown under docs/en and docs/zh changes. No option names, defaults, SPI or serialization change, and no runtime behavior is touched.
1.3 Performance / Side-Effect Analysis
None. It is docs only. The read_partitions and enable_file_split descriptions only matter to readers. Issue 1 is the one place where documented performance guidance would be misleading.
1.4 Error Handling and Logging
Not applicable to the diff. Issues found in this review:
- Issue 1 (Medium): ObsFile
enable_file_splitandfile_split_sizedocumented but ineffective (see 1.1). - Issue 2 (Low):
docs/en/connectors/sink/BosFile.md:69anddocs/zh/connectors/sink/BosFile.md:69still say thefield_delimiterdefault is just'\001'.BosFileSinkgoes through the sameBaseFileSinkConfig, so CSV also defaults to,. This is an incomplete sweep of the same issue fixed in 9 sibling docs. - Issue 3 (Low): the new
read_partitionstext says "only these partitions are read", but the implementation is a substring match on the full file path:filePath.contains(readPartition)(AbstractReadStrategy.java:277-284). A value likeyear=2024therefore also matches any path containing that substring, and it applies even whenparse_partition_from_path=false. One clause in the description would prevent surprises. - Issue 4 (Low): in the ZH source docs (CosFile, FtpFile, LocalFile) the malformed-row fix deletes the extra description cells (
filename_extension,sort_files_by_modification_time, FtpFilerow_delimiter, LocalFilemetalake_type) rather than relocating them. The tables have 4 columns, so those cells were already invisible to renderers. However, for ZH CosFile and FtpFile there is no### filename_extensiondetail section, and no ZHmetalake_typesection in any of the three, so the descriptions now exist nowhere in ZH.
2. Code Quality Assessment
2.1 Coding Standards
There is no Java. Markdown-level notes:
- Many inserted rows are not column-aligned with their neighbors, for example
| read_partitions | list | no | - |and theSheet0cells indocs/en/connectors/sink/HdfsFile.md:83anddocs/en/connectors/sink/CosFile.md:19. This renders correctly and is purely cosmetic. - The ZH sink default cells use English text (
'\001' for text and ',' for csv) inside Chinese tables.docs/zh/connectors/sink/SmbFile.md:60already has a localized form of this cell (the same text and csv defaults written in Chinese), which would be a better model. This is Low and non-blocking.
2.2 Test Coverage and Test Stability
No test code is touched, so the flaky-test analysis does not apply (rating: Stable / not applicable). The PR notes a structural table check and a relative-link check over the 50 files. Those are sensible substitutes for a docs build. A Docusaurus build was not run, which is acceptable for table and link fixes. The Build and labeler checks on the current head are green.
2.3 Documentation Updates
This is the deliverable. EN and ZH are kept in step for every fix, and I found no case where only one language was changed. Beyond the items in 1.4, the examples and commands are unaffected.
3. Architectural Soundness
3.1 Elegance of the Solution
Precise fix. Each change is scoped to a specific doc-versus-code discrepancy, and the PR body cites the backing source.
3.2 Maintainability
Good. Removing duplicated example blocks and stray table cells lowers future drift. Issue 1 is the reverse case: an inaccurate row will attract the same kind of follow-up PR this one is trying to avoid.
3.3 Extensibility
Not applicable to docs. As a general tip, the file-source docs are split between BaseFileSource connectors (Obs, Cos, Bos, OssJindo) and BaseMultipleTableFileSource connectors (Hdfs, Local, S3, Oss, Ftp, Sftp, Smb, Gcs). Options tied to the multi-table enumerator (splitting, sync/continuous discovery, tables_configs) should only appear on the latter.
3.4 Historical-Version Compatibility
No impact. Nothing in the diff changes behavior for existing jobs, configs or state.
4. Issue Summary
| Number | Issue | Location (path:line) | Severity |
|---|---|---|---|
| Issue 1 | ObsFile source documents enable_file_split and file_split_size, which are no-ops on BaseFileSource connectors |
docs/en/connectors/source/ObsFile.md:95-96, docs/zh/connectors/source/ObsFile.md:98-99 (code: FileSourceSplitEnumerator.java:99, BaseMultipleTableFileSource.java:82) |
Medium |
| Issue 2 | BosFile sink field_delimiter default still says only '\001' (missed in the CSV-default sweep) |
docs/en/connectors/sink/BosFile.md:69, docs/zh/connectors/sink/BosFile.md:69 |
Low |
| Issue 3 | read_partitions description hides that matching is a substring test on the full file path |
all 24 added rows, for example docs/en/connectors/source/HdfsFile.md:60 (code: AbstractReadStrategy.java:277-284) |
Low |
| Issue 4 | ZH Cos/Ftp/Local source tables drop description cells instead of relocating them; no ZH detail section holds the text | docs/zh/connectors/source/CosFile.md:81,93, docs/zh/connectors/source/FtpFile.md:62,78,106, docs/zh/connectors/source/LocalFile.md:104,106 |
Low |
"Raised by another reviewer": none. There were no prior reviews or comments on this PR from anyone else.
5. Merge Recommendation
Conclusion: Ready to merge after fixes
- Blockers (must be fixed)
- Issue 1 (Medium): remove the
enable_file_splitandfile_split_sizerows from EN and ZH ObsFile source docs. The rationale is that this PR's goal is doc accuracy, and these two rows add a claim the code does not fulfil. It is a four-line deletion.
- Issue 1 (Medium): remove the
- Recommended fixes (non-blocking)
- Issue 2: update the BosFile sink
field_delimitercell in EN and ZH so the CSV default is consistent with the 9 sibling docs. - Issue 3: add a short clause to
read_partitions, for example "matched as a substring of the file path". - Issue 4: either keep the deleted ZH descriptions by moving them to the detail sections, or accept the loss. Nothing was visible before, so this is minor.
- Optionally align the inserted table rows and translate the ZH default cells. These are cosmetic.
- Issue 2: update the BosFile sink
Overall assessment: Excellent, disciplined docs work. I verified the Sheet0, tmp_path, CSV delimiter, read_partitions, Socket, Milvus, Mongo and Hdfs duplicate-section claims against source, and they hold. Once the two ObsFile split rows are dropped, this is good to merge. I do not see a materially better alternative (Option A or B) for a change of this shape. Splitting the 50 files into per-connector PRs would be easier to review but is not required.
…osFile field_delimiter default
DanielLeens
left a comment
There was a problem hiding this comment.
Thank you @zhangshenghang for the quick turnaround. The follow-up commit addresses the ObsFile blocker I raised at b19eae5 and also picks up the BosFile field_delimiter miss. I re-read the whole PR at the new head (2c76a37) and re-checked the claims against the connector-file source, not only the delta.
What Problem Does This PR Solve?
The file-family, messaging and database connector docs (EN and ZH) had drifted from the code. Examples were wrong defaults or required flags, malformed or duplicated table rows, duplicated example sections, and option rows that exist in code but were missing from the docs. This PR fixes those in about 52 Markdown files and changes no Java or config.
Simple example: a user reading the sink docs sets file_format_type = csv and no field_delimiter. The old docs said the default was '\001'. The code actually uses , for csv, and the docs now say so.
1. Code Change Review
1.1 Core Logic Analysis
The change is docs only. The normal user path (reading option tables to write a job config) is exactly what is corrected.
Status of my previous items (b19eae5 to 2c76a37)
- Previous Issue 1, ObsFile
enable_file_splitandfile_split_sizerows: FIXED.- The rows are gone from
docs/en/connectors/source/ObsFile.mdanddocs/zh/connectors/source/ObsFile.mdat the new head. A grep for both option names in the Obs and Bos source docs returns nothing. - The reasoning still holds in source.
FileSplitStrategyFactoryis only used fromBaseMultipleTableFileSource.java:82, andObsFileSourceextendsBaseFileSource, whoseFileSourceSplitEnumeratorbuilds unsplitFileSourceSplitobjects. The option would have been a silent no-op. - The other ten shared-option rows added to ObsFile are backed by
AbstractReadStrategyand the per-format read strategies, and were already accepted.
- The rows are gone from
- Previous Issue 2, BosFile sink
field_delimiterdefault: FIXED (EN and ZH).docs/en/connectors/sink/BosFile.md:69now says'\001' for text and ',' for csv.docs/zh/connectors/sink/BosFile.md:69says the same in Chinese phrasing, matching the SmbFile ZH row.- Source confirms it.
BosFileSinkextendsBaseFileSink, which buildsnew FileSinkConfig(...)(BaseFileSink.java:55).FileSinkConfigextendsBaseFileSinkConfig, andBaseFileSinkConfig.java:69-77applies,when the format is CSV and the option is absent, and the option default (\001) otherwise. - Sweep check: every touched file sink doc (Cos, Ftp, Hdfs, Local, Obs, Oss, OssJindo, S3, Sftp, Smb, Bos) now carries the format-dependent default.
- Previous Issue 3,
read_partitionswording (Low): not changed. The rows still say "only these partitions are read". The implementation is a substring test on the full file path (AbstractReadStrategy.java:277-284). This was Low and non-blocking, and I still recommend a short clause. - Previous Issue 4, ZH Cos/Ftp/Local description cells removed rather than relocated (Low): not changed. It was already Low and non-blocking. Those cells were invisible in 4-column tables before, so nothing regressed for readers.
Fresh full-PR verification at the new head
- I re-checked the same claims as in the first round and they still hold in source:
sheet_namedefaultSheet0,tmp_pathoptional,read_partitionshonored by the shared read strategy, Socketmax_retries >= 0validation, InfluxDB and Smbmulti_table_sink_replica, Milvusrate_limit, MongoDBmatchQueryfallback, and the S3Filefile_filter_modified_start/endrows. - The HdfsFile source duplicate-section removal is still content-lossless. The removed second copy was byte-identical to the first.
- Table structure: I ran a per-block cell-count check over all 52 changed files at the new head and found 0 rows with a mismatched cell count. The same checker reports malformed rows in the dev versions of ZH CosFile, FtpFile and LocalFile, so it does detect the problem this PR fixes.
- The delta also re-padded the ObsFile EN
common-optionsrow (docs/en/connectors/source/ObsFile.md:95). It is cosmetic and harmless. - CJK: the only CJK character in an English doc among the changed files is
docs/en/connectors/source/FtpFile.md:357. It exists on dev and is not in this PR's added lines, so it is not this PR's concern (a possible follow-up). - EN and ZH stay in step. Every fix in the delta was applied to both languages.
1.2 Compatibility Impact
Fully compatible. Only Markdown under docs/en and docs/zh changes. There are no option name, default, SPI, serialization or runtime changes.
1.3 Performance / Side-Effect Analysis
None. Removing the two ObsFile rows removes the one place where the docs would have promised a parallelism benefit that the code does not deliver.
1.4 Error Handling and Logging
No blocking issues found. Remaining non-blocking items:
- Issue 1 (Low, carried over from my previous round):
read_partitionsdescription hides that matching is a substring test on the full file path.- Location: all 24 added rows, for example
docs/en/connectors/source/HdfsFile.md:60(code:AbstractReadStrategy.java:277-284). - Problem: a value like
year=2024also matches any path that merely contains that text. - Potential risk: users expect exact partition-segment matching.
- Best improvement: add "matched as a substring of the file path".
- Raised by another reviewer: No.
- Location: all 24 added rows, for example
- Issue 2 (Low, carried over): ZH Cos/Ftp/Local source tables drop description cells instead of relocating them.
- Location:
docs/zh/connectors/source/CosFile.md,docs/zh/connectors/source/FtpFile.md,docs/zh/connectors/source/LocalFile.md. - Problem: ZH has no detail section for
filename_extension(Cos, Ftp) ormetalake_type, so those descriptions now exist nowhere in ZH. - Risk: minor, since the cells never rendered.
- Best improvement: optional, either move the text into detail sections or accept the loss.
- Raised by another reviewer: No.
- Location:
There are no prior reviews from other reviewers on this PR besides mine.
2. Code Quality Assessment
2.1 Coding Standards
There is no Java. Several inserted table rows are not column-aligned with their neighbors, which is cosmetic and renders fine. The ZH sink cells for Cos, Ftp, Hdfs, Local, Obs, Oss, OssJindo, S3 and Sftp keep English text ('\001' for text and ',' for csv), whereas ZH Bos and Smb now use a localized form. Consistency is Low and optional.
2.2 Test Coverage and Test Stability
No test code is touched. Stability: Stable / not applicable. The author's structural table check and link check are appropriate substitutes for a docs build, and my independent table check agrees.
2.3 Documentation Updates
This is the deliverable. Docs and code now agree on every point I checked, and EN and ZH remain consistent.
3. Architectural Soundness
3.1 Elegance of the Solution
Precise fix. Each edit is scoped to one doc-versus-code discrepancy.
3.2 Maintainability
Good. Removing duplicated sections, stray cells and unbacked option rows lowers future drift. The removal of the ObsFile split rows also keeps the BaseFileSource versus BaseMultipleTableFileSource distinction honest in the docs.
3.3 Extensibility
Not applicable to docs.
3.4 Historical-Version Compatibility
No impact on existing jobs, configs or state.
4. Issue Summary
| Number | Issue | Location | Severity |
|---|---|---|---|
| Issue 1 | read_partitions text hides the substring-match semantics |
24 added rows, e.g. docs/en/connectors/source/HdfsFile.md:60 (code AbstractReadStrategy.java:277-284) |
Low |
| Issue 2 | ZH Cos/Ftp/Local dropped description cells have no new home | docs/zh/connectors/source/CosFile.md, FtpFile.md, LocalFile.md |
Low |
5. Merge Recommendation
Conclusion: Ready to merge
- Blockers - must be fixed
- None. My earlier blocker (ObsFile split rows) is fixed at 2c76a37 in both languages.
- Recommended fixes - non-blocking
- Issue 1: add "matched as a substring of the file path" to the
read_partitionsrows. - Issue 2: optionally relocate the dropped ZH descriptions, or accept the loss.
- Optional: localize the English default cells in the ZH sink tables.
- Issue 1: add "matched as a substring of the file path" to the
Overall assessment: Careful docs work. Every change I traced to source holds at the new head, the BosFile default is now consistent with all sibling file sinks, and the table structure is clean across all changed files. I see no better alternative for a change of this shape.
Existing maintainer state: my previous CHANGES_REQUESTED at b19eae5 is resolved by this update, and this review supersedes it.
CI / sync: Build, labeler and Notify test workflow are green on this head. The branch is 1 commit behind dev with no conflict, so no sync is needed. The PR only needs the required review approval to merge.
Purpose of the PR
This PR fixes a batch of real documentation issues in the file-family, messaging and database connector docs, all verified against the actual connector source code on
dev. It covers 50 documentation files (EN and ZH together).What was found and changed
All of the following were verified against the corresponding
*Options.java/ factoryOptionRulebefore editing:Incorrect values (doc vs code)
sheet_namesink default was documented asSheet${Random number}, but the code always names the first sheetSheet0(ExcelGenerator.java). Fixed in 10 EN + 10 ZH sink docs (HdfsFile, LocalFile, S3File, CosFile, ObsFile, OssJindoFile, OssFile, SftpFile, FtpFile, SmbFile).tmp_pathwas marked required in HdfsFile / FtpFile / SftpFile sink docs, but the code declares it optional with default/tmp/seatunnel(FileBaseSinkOptions, factory.optional(...)). Fixed in EN + ZH.field_delimiterdefault cell said only'\001', but forcsvthe effective default is,(BaseFileSinkConfig). Updated the default cell in 9 EN + 9 ZH sink docs.multi_table_sink_replicadefault shown as-, actual default is1(SinkConnectorCommonOptions). Fixed EN + ZH.max_retries = -1enables infinite retry, but the option rule validates>= 0(SocketSinkFactoryusesConditions.greaterOrEqual), so-1can never be used. Reworded table row and FAQ in EN + ZH.rate_limitas a client-side read-rate hint; the code mutates the collection-wide Milvus propertycollection.queryRate.max.qps, which affects all clients of the collection. ZH now matches the (already correct) EN description and notes.match.queryand legacymatchQuery"cannot be set together"; the code treatsmatchQueryas a fallback key andmatch.querywins. ZH now matches EN.Malformed tables / duplicated content
compress_codecrow; removed.csv_use_header_linerow; removed.row_delimiter(trailing empty cell), SftpFile EN+ZHarchive_compress_codec/encodingand HdfsFile EN+ZHarchive_compress_codec(empty description cells — descriptions added).csv_use_header_linedefault-corrected tofalse(ZH already saidfalse).Missing option rows (options exist in code / shared read path but absent from docs)
read_partitions(defined inFileBaseOptions, honored by the sharedAbstractReadStrategy) to all 12 file source docs, EN + ZH, matching each table's column layout.xml_row_tag,xml_use_attr_format,csv_use_header_line,compress_codec,archive_compress_codec,encoding,null_format,binary_chunk_size,binary_complete_file_mode,file_filter_pattern,enable_file_split,file_split_size); rows added from sibling docs. Note: the continuous-discovery/sync option family was intentionally not added becauseObsFileSourceextendsBaseFileSource, unlikeOssFileSourcewhich extendsBaseMultipleTableFileSource.file_filter_modified_start/file_filter_modified_end; rows added.file_format_typerow and examples (parquet/orc claimed by the table but missing from the feature checklist). SinceFileFormat.PARQUET/ORCmap to the filesystem-agnosticParquetReadStrategy/OrcReadStrategy, parquet and orc were added to the checklist.multi_table_sink_replicaalthoughSmbFileSinkFactorydeclares it; row added.Language check
Yes — every issue was fixed in both
docs/enanddocs/zhwhere both versions exist.Duplicate PR check
Before opening this PR I checked all PRs opened in the last 7 days (both open and merged): #12487, #12476, #12459, #12423, #12447, #12409 and collected their full changed-file lists. None of the files or issues touched by this PR overlap with them: those PRs covered transforms, Zeta engine docs, Doris/SelectDB and other connector docs (Jdbc, Kafka source, MySQL CDC, Paimon, etc.), while this PR targets the file-family connectors (Hdfs/Local/S3/OSS/OSS-Jindo/COS/OBS/BOS/FTP/SFTP/SMB/GCS), ObsFile/SmbFile gaps, plus small InfluxDB/Socket/Milvus/MongoDB fixes that no recent PR includes.
Verification
.mdlinks in the 50 modified files were checked to resolve (0 broken).apache/seatunnel-websiterepository; the checks above cover the same failure modes (broken links, malformed tables) at lower cost. No Java code was changed, sospotless/build verification is not applicable.