Repository navigation
[feature](be) Add file scanner v2 readers - #65046
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
6fa6952 to
47c9df5
Compare
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
|
/review |
There was a problem hiding this comment.
Automated review for PR 65046. I found four issues that should be addressed before merge: a FileScannerV2 runtime-filter rewrite correctness bug, a default-on rollout mismatch for enable_file_scanner_v2, a removed timezone regression assertion, and generated output whitespace that fails git diff --check.
### What problem does this PR solve? Issue Number: close #xxx Related PR: #63893 Problem Summary: Add the file scanner v2 reader stack for external file scans, including native readers for Parquet, CSV/TEXT, JSON, JNI-backed table readers, schema projection, column mapping, predicate handling, reader statistics, page cache support, and related BE/FE integration. This also restores affected Parquet LZO regression cases by adding Doris thirdparty Arrow LZO page decompression support for file scanner v2. The change keeps VDirectInPredicate source-compatible with existing ordinary two-argument construction by defaulting the new HybridSet child-type flag to true. Dictionary-code rewrites can still pass false explicitly, while existing runtime filter tests continue to compile with the old call shape. Review follow-up fixes make RuntimeFilterExpr global-index slot rewriting update the executable _impl tree, document enable_file_scanner_v2 as default-on to match the FE default, and trim generated regression outputs so diff hygiene passes. ### Release note Support file scanner v2 readers for external file scan paths, including LZO-compressed Parquet reads in the new Parquet reader path. ### Check List (For Author) - Test: Manual test - Verified apache-arrow-17.0.0-lzo.patch applies with patch -p1 --dry-run against Arrow 17 column_reader.cc - Ran bash -n thirdparty/build-thirdparty.sh thirdparty/download-thirdparty.sh - Ran build-support/clang-format.sh - Ran git diff --check - Attempted ./run-be-ut.sh --run --filter='RuntimeFilterExprSamplingTest.deep_clone_clones_impl_tree'; local sandboxed run could not complete because the BE UT script required JDK 17 setup first, then needed submodule metadata writes and GitHub access for thirdparty dependencies. Escalated retry was not approved before timeout. - Attempted ./run-be-ut.sh --run --filter='FileScannerV2Test.RewriteSlotRefsToGlobalIndexMatrix'; local sandboxed run could not complete because the BE UT script needed submodule metadata writes and GitHub access for thirdparty dependencies. Escalated retry was not approved before timeout. - Full BE unit tests and external regression tests were not run in this local environment - Behavior changed: Yes. Adds file scanner v2 reader behavior and enables LZO-compressed Parquet reads through the new reader path - Does this need documentation: No
47c9df5 to
8fe2181
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Review complete. I did not find a new in-scope, non-duplicate issue to add beyond the existing inline review threads.
Scope and duplicate handling: I checked the provided review prompt, repo review skill, required AGENTS files, existing review threads/comments, focus file, changed-file list, and shared ledger before submitting. The already-raised scanner V2 runtime-filter rewrite, scanner default/docs, timezone-test, and whitespace comments were treated as duplicate-suppression context. One initially suspicious local diff in StmtExecutor was dismissed because it is absent from the authoritative live PR file list and GitHub rejected the path as unresolved.
Critical checkpoints: scanner V2 selection/session propagation, FE format planning, runtime-filter rewrite handling, aggregate/count pushdown, file-reader paths, changed tests/outputs, and style hygiene were reviewed statically. git diff --check 9d7d3a2c4f437e0c2962bde1a49848ed0535063c..HEAD is clean. I did not run builds or test suites because this worktree is not initialized and thirdparty/installed is missing in the runner.
Subagent conclusions: optimizer-rewrite and tests-session-config both completed the final convergence round on the corrected no-inline-comment set with NO_NEW_VALUABLE_FINDINGS.
| int64_t conversion_failure_null_map_offset = 0; | ||
| }; | ||
|
|
||
| inline bool decoded_column_view_row_is_null(const DecodedColumnView& view, int64_t row) { |
There was a problem hiding this comment.
这里为什么不把DecodedColumnView ,变成一个class? 然后底下这堆方法是这个class的member?
| std::dynamic_pointer_cast<VSlotRef>(get_child(0)) != nullptr; | ||
| } | ||
|
|
||
| Status clone_node(VExprSPtr* cloned_expr) const override { |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
| return slot_info.is_file_slot; | ||
| } | ||
|
|
||
| Status rewrite_slot_refs_to_global_index( |
There was a problem hiding this comment.
- 这个方法需要加注释,并且注释里得有例子
- 这个runtime filter 会不会被共享,所以我们修改他的结构是有风险的?
| Status FileScannerV2::_build_table_conjuncts(VExprContextSPtrs* conjuncts) const { | ||
| DORIS_CHECK(conjuncts != nullptr); | ||
| conjuncts->clear(); | ||
| conjuncts->reserve(_conjuncts.size()); |
There was a problem hiding this comment.
这里为啥拿到conjuncts 之后要rewrite 一下? 为啥rewrite 是在每个scanner 都rewrite 一次,而不是file scan operator rewrite 一次?
|
PR approved by anyone and no changes requested. |
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
FE Regression Coverage ReportIncrement line coverage |
|
skip check_coverage |
### What problem does this PR solve? Issue Number: None Related PR: #65046 Problem Summary: Branch 4.1 shares the rebuilt Doris thirdparty artifacts with master. PR #65046 added Parquet LZO page decompression support to the Arrow/Parquet thirdparty patch, which introduces lzo symbols from libparquet.a. Branch 4.1 already builds lzo2 as a thirdparty package, but its BE CMake thirdparty list did not link lzo2, so builds using the shared updated libparquet.a can fail with unresolved lzo symbols. This backports the thirdparty-related changes from #65046: the Arrow LZO patch, lzo2 linkage, FlatBuffers version update and include cleanup, and Arrow include path setup during thirdparty build. ### Release note None ### Check List (For Author) - Test: Manual test - `git diff --cached --check` - `bash -n thirdparty/build-thirdparty.sh thirdparty/download-thirdparty.sh thirdparty/vars.sh` - Behavior changed: No - Does this need documentation: No
Problem Summary: Add the file scanner v2 reader stack for external file scans, including native readers for Parquet, CSV/TEXT, JSON, JNI-backed table readers, schema projection, column mapping, predicate handling, reader statistics, page cache support, and related BE/FE integration. This also restores affected Parquet LZO regression cases by adding Doris thirdparty Arrow LZO page decompression support for file scanner v2. Support file scanner v2 readers for external file scan paths, including LZO-compressed Parquet reads in the new Parquet reader path.
## Summary Backport the FileScannerV2 / format_v2 series to `branch-4.1` in the requested order. - Includes 28 unique source PRs, including #65502. - FileScannerV2 and format_v2 use their native implementations. - #62306 is intentionally not cherry-picked. FileScannerV2 and format_v2 do not depend on it; the V1 behavior required by this series is adapted manually on top of the existing branch-4.1 code. - The V1 adaptations cover TopN validation, deletion-vector handling, runtime-filter cloning/type semantics, JNI cleanup retry, Paimon IOManager/metrics, text-reader fixes, and the branch-4.1 expression API used by equality-delete predicates. - Native format_v2 JDBC and Iceberg system-table paths remain on the branch-4.1 legacy/unsupported routing because the newer thrift split protocols are not present on this branch. ## Source PRs #65046, #65130, #65151, #65175, #65194, #65218, #65281, #65326, #65328, #65332, #65354, #65094, #65351, #65359, #65370, #65183, #65369, #65449, #65437, #65451, #65475, #65495, #65496, #65501, #65500, #65478, #65503, #65502. ## Branch-specific fixes - Adapted #65502 to the branch-4.1 expression selector API and fixed the associated FE checkstyle issues. - Fixed TeamCity External Regression 994576 and P0/CloudP0 995015/995017: schema discovery does not create a `RuntimeState`, so V1 CSV, JSON, Native, ORC, and Parquet readers now fall back to default `TQueryOptions` instead of dereferencing a null state. - Fixed TeamCity BE UT 994856, which crashed in the same V1 ORC reader-options path. - Restored only the small V1 schema-reader fallback required on branch-4.1; #62306 remains intentionally excluded. - Added null-`RuntimeState` regression coverage for CSV and Native schema discovery. - Initialized the format_v2 ORC test suite timezone cache once at suite setup, covering session-timezone and DST timestamp assertions that become reachable after the V1 ORC core is fixed. ## Validation - Full ASAN `doris_be_test` build compiled and linked successfully; the post-#65502 incremental verification completed 1,091/1,091 build targets. - 313/313 focused BE tests passed across FileScannerV2, TableReader, ColumnMapper, condition cache, deletion vectors/predicates, JNI, Hive/Paimon/Iceberg readers, zonemap filtering, and casts. - The latest ASAN verification passed 232/232 focused Iceberg reader, equality-delete, ColumnMapper, and TableReader tests. - 215/215 affected reader tests passed across V1 CSV/JSON/Native/ORC/Parquet and format_v2 ORC/Parquet, including the TeamCity ORC core reproducer. - The three format_v2 ORC session-timezone assertions passed 3/3 under ASAN. - 88/88 original focused FE tests passed; the post-#65502 FE verification passed an additional 40/40 tests covering ExternalUtil and Iceberg planning/utilities. - 10/10 `PaimonJniScannerTest` tests passed. - Maven reactor completed with `BUILD SUCCESS`; checkstyle reported 0 violations. - `build-support/check-format.sh` passed across 4,136 files. --------- Co-authored-by: Chenjunwei <138805230+xylaaaaa@users.noreply.github.com>
… (#65845) ### What problem does this PR solve? Issue Number: None Related PRs: #65046, #65143, #65559 Problem Summary: PR #65559 backported the FileScannerV2 series, including #65046, to `branch-4.1`, but did not include the follow-up Release compilation fix #65143. With `NDEBUG`, the diagnostic uses of the two caught exceptions are compiled out, so clang reports `-Werror,-Wunused-exception-parameter` while compiling `be/src/format_v2/column_mapper.cpp`. This PR marks both catch parameters as `[[maybe_unused]]`. Debug diagnostics and Release fallback behavior are unchanged. Cherry-picked from #65143. ### Release note None. ### Check List (For Author) - Test - [ ] Regression test - [ ] Unit Test - [x] Manual test - TeamCity Doris Compile build 1001872 passed on current head `be72438f77af633fdd9d5d84b11e30a9b8202bd1`. - [ ] No need to test or manual test. - Behavior changed: - [x] No. - [ ] Yes. - Does this need documentation? - [x] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label Co-authored-by: bobhan1 <baohan@selectdb.com> Co-authored-by: Dongyang Li <lidongyang@selectdb.com>
…he keys (#70936) ### Background The external condition cache stores whether each file granule has surviving rows after file-level predicates run. Its scanner digest carries query, session and runtime-filter identity, while schema mapping determines which predicates actually run against each physical file. ### What problem does this PR solve? Issue Number: None Related PR: #65046 (introduced the file scanner v2 path), #65496 (source-range granule cache coordination) PR Type: Bugfix Problem Summary: Iceberg can delete a nested field and recreate its name with a new field ID and initial default without rewriting historical files. A predicate that previously ran in the file reader then becomes residual, but its old cache bitmap can still suppress rows before the default is materialized. Include localized predicates in cache identity; most changes are tests. For one unchanged file, query the whole struct and filter `mod(element_at(s,'x'),2)=1 AND mod(k,3)=1`. Replacing the old `x=0` child with a new BIGINT child defaulting to `9` gives: | Evolved schema query | Before fix | After fix | |---|---|---| | Condition cache disabled | 4096 rows | 4096 rows | | Condition cache enabled after warming the old schema | 0 rows | 4096 rows | ### Details - **Change map:** Production code +31/-21 lines; tests +435/-20; generated regression output +10/-0; no documentation changes. The production change reuses one eligibility digest and preserves the Iceberg positional-binding exclusion. Publication tests now inspect complete keys. - **Frequency:** Always when a cached false granule from local predicates P AND Q is reused after schema evolution leaves only Q localized under the same scanner digest. - **Root cause:** `TableReader` computed a localized digest only to decide cache eligibility, then keyed the bitmap solely by the scanner digest. It misses the changed file-local subset. - **Why existing tests missed it:** `TableReaderTest.ConditionCache*` omits localized-subset changes under one scanner seed. `IcebergV2ReaderTest.ReusedNestedNameReadsNewFieldInitialDefault` verifies default materialization without warming condition cache. Iceberg schema-evolution regressions verify binding without requiring a positive cache hit across child replacement. - **Fix:** Return the existing localized digest from cache admission and mix it into the scanner seed before the existing INT96 key adjustment. Existing cache exclusions are preserved. Do not use the separately memoized scanner predicate snapshot digest or hash large RF payloads twice. - **Other paths and branches:** The native `TableReader` key is shared by ORC/Parquet table-format readers. Iceberg's positional fallback still rejects unstable field bindings. Internal-table cache is separate; legacy external readers have no condition-cache integration. Static inspection finds the scanner-only key on branch-4.1 and branch-4.2; branch-3.1 and branch-4.0 lack this native path. Release branches were not executed locally. ### Testing - Local ASAN: 277 tests passed across `TableReaderTest`, `IcebergV2ReaderTest` and ORC condition-cache tests. Two new tests cover P AND Q versus Q under the same seed, different scanner seeds with the same local predicates, positive reuse, zero-digest rejection and exactly one localized hash. The identity test fails against the original key. - Local launcher reproduction: interpolated Groovy arguments fail before normalization and pass after it, including literal argument preservation and child-command errors. - Local native SQL: `test_iceberg_nested_predicate_cache` fails before the fix with 4096 rows from the cache-disabled oracle versus zero with the warmed cache. The candidate passes full-row comparison after evolution and positive cache-hit/pruning assertions; generated output is independently checked and replayed normally. - Standard Iceberg 1.12 and stock 1.10.1 SDK helpers author and read back all 8192 rows before and after public delete/add-column operations. Assertions preserve the parent ID, replace the child ID, retain the data snapshot/path/size, and check the new default, NULL parents and nonmatching granules. ### Notes for Reviewers BIGINT inputs avoid the implicit modulo cast whose zero digest deliberately disables caching. It supports an existing Spark/REST Docker environment or an explicitly configured local SDK/file warehouse. External CI exposed the launcher’s GString failure. ### Release note Fix missing Iceberg query results caused by stale condition-cache bitmaps after a nested field is deleted and recreated with an initial default. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Partially verified: full Docker fixture execution after argument normalization awaits CI; command-boundary checks and the SQL suite passed locally ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Code, unit tests, regression tests and this description - Human review: not stated
What problem does this PR solve?
Problem Summary: Add the file scanner v2 reader stack for external file scans, including native readers for Parquet, CSV/TEXT, JSON, JNI-backed table readers, schema projection, column mapping, predicate handling, reader statistics, page cache support, and related BE/FE integration. This also restores affected Parquet LZO regression cases by adding Doris thirdparty Arrow LZO page decompression support for file scanner v2.
Support file scanner v2 readers for external file scan paths, including LZO-compressed Parquet reads in the new Parquet reader path.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)