Gabriel39 opened a new pull request, #70919:
URL: https://github.com/apache/doris/pull/70919

   ### Background
   
   File table-valued functions read external CSV, JSON and Hive Text files. A 
compression property overrides the codec inferred from the file name; the scan 
planner also divides splittable files into ranges for parallel reading.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #19530 (introduced explicit TVF compression)
   PR Type: Bugfix
   
   Problem Summary:
   
   An explicitly compressed file without a compression suffix can be divided 
into ranges, causing the BE to reject the scan with `For now we do not support 
split compressed file.` Conversely, explicitly uncompressed data named `.gz` 
cannot be split. This PR makes range splitting use the same explicit 
compression choice as schema inference and execution. Most additions cover 
conflicting codec and suffix combinations and complete row results.
   
   ### Details
   
   - **Frequency:** Always when explicit compression disagrees with the suffix 
and the file exceeds the requested split size.
   - **Root cause:** `TVFScanNode` did not pass its declared compression to 
`FileSplitter`, which inferred compression exclusively from the path, unlike 
schema inference and execution ranges.
   - **Why existing tests missed it:** `FileSplitterTest` checks suffix-based 
splitting and range boundaries; `TVFScanNodeTest` previously covered coarse 
columnar ranges and count gates. `test_s3_tvf_compression` and 
`test_hdfs_tvf_compression` use matching suffixes and codec declarations; none 
forces conflicting codec choices across multiple ranges.
   - **Fix:** Pass the TVF compression into a new splitter overload. Keep the 
original overload's suffix inference and normalize the unset envelope codec 
used by Parquet/ORC to that same behavior. Retain metadata unsplittable and 
count pushdown gates.
   - **Other paths and branches:** The shared TVF path covers S3 and HDFS, 
including CSV, JSON and Hive Text. Hive's connector has a separate splitter. 
Parquet/ORC retain their existing coarse ranges because their compression is 
internal. Static inspection found the same mismatch in branch-3.1, branch-4.0, 
branch-4.1 and branch-4.2; no release-branch runtime validation was performed.
   
   ### Testing
   
   - Local FE unit tests: 54 tests passed, including 36 explicit/inferred codec 
cases across S3/HDFS and CSV/JSON/Text, columnar unset-codec controls, range 
offsets, effective execution codecs and existing count/splitting gates. The 
unfixed baseline failed 12 of the new cases.
   - Local SQL regression `test_tvf_explicit_compression_splits`: all 12 S3 
variants passed full ordered 4096-row value comparisons plus counts/sums on an 
ASAN BE. Generated counts match 4096 rows and sum 8386560. The unfixed baseline 
fails on the first complete gzip CSV read without a suffix. Normal result-file 
replay also passed.
   
   ### Notes for Reviewers
   
   - The optional HDFS portion runs when the external test lane enables Hive's 
HDFS service. The local SQL run uses S3; HDFS and Azure execution are not 
claimed.
   
   ### Release note
   
   Fix file TVF scans using an explicit compression type that differs from the 
file suffix, preventing invalid compressed-file splits and allowing explicitly 
uncompressed files to be split.
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Partially verified: HDFS and Azure SQL variants 
have not run locally
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: Code, unit tests, regression tests and this description
   - Human review: not stated
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to