Skip to content

[refactor](external) Remove Hive ACID, Avro and LakeSoul readers on master - #69601

Merged
Gabriel39 merged 2 commits into
apache:masterfrom
Gabriel39:dev/pick-69312-master
Oct 27, 2026
Merged

Gabriel39 merged 2 commits into
apache:masterfrom
Gabriel39:dev/pick-69312-master

Conversation

@Gabriel39

@Gabriel39 Gabriel39 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #69312

Port #69312 from branch-4.2 to current master.

  • Remove Hive ACID read transactions, shared read locks, write-ID snapshots, delta-file listing and the BE transactional reader. Reject full ACID and insert-only reads in the Hive connector.
  • Adapt the changes to master's connector modules and unified reader initialization interfaces. Preserve ordinary Hive scanning and Iceberg/Paimon ORC position-delete and deletion-vector handling.
  • Reject standalone Avro and deprecated table markers before file access or metadata-only counts. Keep LakeSoul unsupported and remove its obsolete test service and examples.
  • Keep the retired skip_checking_acid_version_file name as a compatibility no-op for client session initialization, using the existing empty-string fallback for variable reads.
  • Preserve Iceberg/Hudi Avro metadata dependencies. The Thrift changes add deprecation comments only; every definition and numeric ID is unchanged.

Release note

Remove support for Hive transactional reads, including insert-only tables, and standalone Avro file reads. LakeSoul remains unsupported. Iceberg and Hudi Avro metadata parsing remains supported. The retired skip_checking_acid_version_file session variable remains accepted as a compatibility no-op.

Validation

  • Hive connector: all 490 tests passed; HMS client: all 155 tests passed.
  • 20 targeted FE core tests passed: deprecated-read rejection, partition-path parsing, generic file scan planning and Hive streaming scans.
  • Review follow-up: reproduced the legacy ACID session-variable failure before the fix; all 8 focused compatibility, variable-export and unsupported-read tests passed after the fix.
  • FE Checkstyle passed with zero violations for every affected FE module.
  • All 12 affected C++ source/header files passed clang-format 16; build hygiene and shell syntax checks passed.
  • Syntax-only compilation passed for all 6 affected BE production translation units and all 4 affected BE test translation units. Isolated checks relaxed pre-existing unused-constant/shadow warnings. Full BE linking and runtime tests remain for CI.
  • Verified that Thrift changes are comments only and checked the affected definitions against branch-3.1/4.0/4.1/4.2. git diff --check passed.

Check List (For Author)

  • Test
    • Unit Test
    • Manual test: formatting, syntax, build hygiene and Thrift compatibility checks described above.
  • Behavior changed:
    • Yes. Reject unsupported external reads explicitly.
  • Does this need documentation?
    • No. This ports the existing removal to master.

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot 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.

Reviewed PR #69601 at efc0ccc8d70d7997316cf94357dc7bcaae93726f. One P2 compatibility issue is reported inline: retain the removed ACID session-variable name as a no-op so existing session initialization continues to work. No P0/P1 findings or previously reported blocking comments were identified.

The removal otherwise rejects Hive full-ACID and insert-only reads, standalone Avro, and deprecated LakeSoul markers before ordinary reader/count execution. Supported Hive, Iceberg, Paimon and Hudi paths retain their relevant read/delete behavior.

Required checkpoint Conclusion
1. Goal and evidence Removal guards match the stated goal; new FE/BE negative tests cover removed formats and transactional modes. Tests were inspected statically.
2. Scope and clarity Reader/API deletions, fixture/sample cleanup and release-script adjustment are related to the removal.
3. Concurrency and locks No new threads, shared state, lock order or blocking critical section; supported streaming/cache paths retain existing synchronization.
4. Lifecycle and static initialization Obsolete read-transaction/reader ownership is removed with its consumers; no new static initializer, reference cycle or cleanup path.
5. Configuration No configuration added; obsolete LakeSoul test settings have no surviving consumers. The removed session variable needs the compatibility entry described inline.
6. Compatibility and upgrades Removed reads fail explicitly. One unintended SET/SELECT session-variable compatibility regression remains; native storage formats and supported function symbols are unchanged.
7. Thrift/protobuf identities All nine touched definitions were read on HEAD and branch-3.1/4.0/4.1/4.2. Existing field IDs, optional qualifiers and enum values are retained; PR edits add only comments. No protobuf changes.
8. Parallel paths Checked synchronous/streaming/batch planning, v1/v2 scanners, native/JNI dispatch, metadata counts, schema setup and row-ID fetch; no additional removal-boundary defect confirmed.
9. Conditional checks Guards have concrete removed-format failure cases and explain the transaction/merge/count invariant; ordinary ranges preserve their dispatch.
10. Test coverage New rejection cases and retained ORC/delete/cache/path/streaming tests were inspected. The removed-variable compatibility case is missing; no end-to-end removal execution was performed.
11. Expected results The obsolete acid5k query and its test_32 output were removed together; all 42 remaining regression tags align, with no new expected data.
12. Observability Rejections identify the unsupported format and propagate exceptions/non-OK Status. No new distributed operation requires metrics or logging.
13. Transactions and persistence Hive read locks/snapshots are removed behind explicit rejection; supported write-lock APIs remain. Native visible versions, MoW bitmaps and EditLog transitions are untouched; unknown removed global variables are skipped during replay.
14. Writes, atomicity and crashes No new write/commit protocol, durable state or crash-cleanup responsibility; supported load paths keep their partition/null handling.
15. FE/BE propagation No wire fields added or removed. Obsolete IDs remain reserved, with checks at scan and range boundaries.
16. Performance and memory Added validation is bounded per scanner/range without I/O or material allocations; retained ORC hot loops match the previous non-ACID paths. No new memory-tracking issue found.
17. Other concerns and coverage All 91 changed paths covered, including Docker, packaging and removed samples. No additional actionable finding.

No additional user focus was supplied. Validation was static only: no builds, unit/regression tests, cluster execution, binary fixture decoding or final ELF/glibc runtime audit. The pure-text BE build-hygiene check passed. These execution limits are separate from completion of the required static coverage.

Review converged after 2 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 78.02% (2080/2666)
Line Coverage 66.31% (38371/57868)
Region Coverage 53.67% (35990/67054)
Branch Coverage 57.28% (11614/20276)

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Oct 26, 2026
### What problem does this PR solve?

Related PR: apache#69601

Problem Summary: Clients that still set skip_checking_acid_version_file
when initializing a connection encounter an unknown-variable error after
the Hive ACID reader removal. Register the retired name in the existing
removed-variable compatibility set so SET remains a no-op and both
variable-read paths use the empty-string fallback. Do not restore the
session field or the removed Hive read support.

### Release note

Continue accepting the retired skip_checking_acid_version_file session
variable as a compatibility no-op.

### Check List (For Author)

- Test: Targeted FE unit tests and FE Checkstyle.
- Behavior changed: Yes, preserve legacy client session initialization.
- Does this need documentation: No.
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot 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.

Static review of all 93 changed files at e0ab4f990d38fd8b735eee6468be2102abae897f: no new substantiated findings. The intentional removal of Hive transactional/insert-only and standalone Avro reads is enforced by explicit errors; supported Hive scanning and Iceberg/Paimon ORC delete handling remain intact in the inspected control flow.

Existing thread 4373671401 is fixed on this head: skip_checking_acid_version_file is in the removed-variable compatibility set, both SET paths accept it as a no-op, variable reads retain the empty-string fallback, and exports omit the deleted field. No duplicate comment is posted. No independently confirmed existing P0/P1 finding remains.

Critical checkpoint Conclusion
Goal and test evidence Full ACID and insert-only reads reject before scan planning; standalone Avro rejects during common format parsing. New negative/helper/compatibility unit tests exercise these contracts. Tests were inspected, not executed.
Scope and clarity Removal, compatibility reservations, caller updates, and obsolete fixture cleanup are focused; one shared BE validator avoids divergent gates.
Concurrency and locks No new threads, shared mutable state, lock nesting, or waits. Retained batch streaming, listing-cache ownership, and Hive writer locking are unchanged.
Lifecycle and static initialization Removed read transactions are no longer opened; deleted manager/readers/constants have no remaining Doris consumers. Supported reader/delete-vector ownership is unchanged; no new static initialization dependency.
Configuration No new production setting. The retired session variable uses the established compatibility mechanism; obsolete LakeSoul regression settings have no remaining consumers.
Symbols, formats, and rolling compatibility Deprecated read support is intentionally removed with explicit failures. Supported storage serialization and reader interfaces remain unchanged; retired wire definitions stay reserved.
Thrift/protobuf IDs Read all nine touched definitions at HEAD and branch-3.1/4.0/4.1/4.2; live branch refs matched the inspected local refs. Deprecated values/field IDs and optionality retain their meanings. All three Thrift files have unchanged non-comment tokens. No protobuf edit.
Parallel paths Traced synchronous, reused, batched, streaming, metadata-count, schema-fetch, and two-phase row-fetch paths; V1/V2 validation and supported connector routing remain consistent. Legacy/Nereids load callers and primary/follower variable handling are covered.
Conditional checks and errors Concrete removed-format checks have explanatory comments and propagate exceptions/non-OK Status before data access or metadata-count handling; no supported read falls through an ACID-only branch.
Test coverage Negative FE/BE helper tests and session compatibility tests cover the changed contracts; retained ordinary Hive streaming/partition and ORC delete/cache tests remain. Runtime and end-to-end proof are outside this static invocation.
Changed expected results The ORC regression output removes exactly the block for the deleted active query; remaining expected values are unchanged. No new golden values are introduced.
Observability Format-specific unsupported errors identify the rejected feature; retained scan profiles/logs are preserved. No new operational execution path requires extra metrics.
Transactions and persistence Hive read snapshots/shared-lock lifecycle is removed behind the rejection gate. Nontransactional Hive write exclusive-lock, heartbeat, and finally-release APIs remain. No Doris EditLog, rowset, visible-version, or delete-bitmap persistence change.
Writes, atomicity, and crashes No retained publication or crash-recovery ordering is changed; ordinary load/write paths retain their existing behavior apart from rejection of the removed format. No new resource leak identified.
FE/BE variable transport No new transported variable. The removed ACID flag is absent from exports/forwarding; retained marker IDs/fields are not reused.
Performance and memory Removed ACID RPCs, directory resolution, row filters, and allocations disappear. Added checks are constant-time; supported lazy/eager ORC logic, split sizes, caches, and streaming bounds are preserved. No new untracked large allocation.
Other issues and cleanup Deleted-symbol/build-list/fixture references, release extension enumeration, Hive HQL discovery, nested-column/null/row-position behavior, position deletes, deletion vectors, and condition-cache exclusion were rechecked. No additional issue found.

User focus: no additional focus was supplied. Initial risks about rejection shortcuts, shared ORC semantics, and compatibility/dependency closure were dismissed with concrete control-flow evidence. No unresolved candidate or uncovered static scope remains.

Convergence: converged after 2 review rounds, with both complete reviewers and the independent risk reviewer returning NO_NEW_VALUABLE_FINDINGS in the final round. Validation limit: static inspection only; no builds, tests, runtime checks, or source changes were performed. The author's reported test results were not independently executed by this review.

Review converged after 2 round(s).

@shuke987

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28832 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e0ab4f990d38fd8b735eee6468be2102abae897f, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17594	5193	5075	5075
q2	2131	310	275	275
q3	10230	1389	804	804
q4	4673	459	333	333
q5	7416	807	532	532
q6	185	190	154	154
q7	760	813	599	599
q8	9254	1329	1096	1096
q9	5591	4176	4201	4176
q10	6894	1297	1043	1043
q11	433	245	227	227
q12	648	394	281	281
q13	18128	4108	3064	3064
q14	278	274	249	249
q15	q16	740	728	658	658
q17	1217	741	575	575
q18	6990	6204	6143	6143
q19	1117	970	599	599
q20	386	348	227	227
q21	5596	2444	2492	2444
q22	393	329	278	278
Total cold run time: 100654 ms
Total hot run time: 28832 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5957	5893	6151	5893
q2	726	603	599	599
q3	5671	5706	5206	5206
q4	2016	2176	1562	1562
q5	5815	5525	5511	5511
q6	234	179	139	139
q7	2057	1877	1675	1675
q8	2836	2510	2491	2491
q9	7592	7472	7530	7472
q10	3630	3546	3160	3160
q11	580	414	390	390
q12	692	665	502	502
q13	3294	3550	3063	3063
q14	294	305	260	260
q15	q16	670	668	616	616
q17	7745	7096	6962	6962
q18	13005	12222	12886	12222
q19	891	808	824	808
q20	2128	2143	1900	1900
q21	5695	4719	4880	4719
q22	494	444	419	419
Total cold run time: 72022 ms
Total hot run time: 65569 ms

Gabriel39 added a commit to Gabriel39/incubator-doris that referenced this pull request Oct 26, 2026
### What problem does this PR solve?

Related PR: apache#69601

Remove the Elasticsearch HTTP scan implementation and its FE connector,
ES-only functions, HTTP proxy endpoints, test services, and regression
fixtures. Reject retired
formats before reader creation or metadata-only counts. Keep the old
catalog metadata readable during image loading and journal replay, but
reject catalog creation and access even when an obsolete plugin remains.
Preserve all Thrift definitions and numeric identities. Accept the retired
ES scroll session variable as a compatibility no-op for old clients.

### Release note

Elasticsearch HTTP scans and the esquery function are no longer supported.
Existing Elasticsearch metadata can still load during an upgrade.

### Check List (For Author)

- Test: Focused FE unit and upgrade tests, FE Checkstyle, clang-format 16,
  BE syntax-only compilation, build hygiene and shell syntax checks.
- Behavior changed: Yes, remove Elasticsearch reads.
- Does this need documentation: No; removal is described in the release note.
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@Gabriel39 Gabriel39 changed the title [refactor](external) Remove Hive ACID, Avro and LakeSoul readers on master [refactor](external) Remove Hive ACID, Avro, LakeSoul and Elasticsearch reads Oct 26, 2026

@github-actions github-actions Bot 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.

Static review of PR #69601 at 457bc77 found no new verified defects. All 237 paths in the supplied aggregate diff were covered by the main review and the assigned BE/infrastructure, FE/protocol, and independent risk reviews.

Existing thread disposition: P2 comment 4373671401 is fixed. skip_checking_acid_version_file now uses the removed-variable compatibility set, so both SET entry points accept it as a no-op and legacy/Nereids variable reads keep the empty-string fallback. The ES setting receives the same treatment. No duplicate comment is proposed; the supplied context contains no existing P0/P1 finding to carry forward.

Core invariants: the change does not modify partition-version visibility or MoW bitmap protocols. Traced shared ORC paths retain Iceberg/Paimon position-delete and deletion-vector filtering. Retired reads propagate explicit failures, and the added validation introduces no long-lived memory owner.

Critical checkpoint conclusions:

  1. Goal and proving tests: the traced FE planning/property and BE scanner/range paths reject the retired external reads. Negative gate, catalog replay, session compatibility, and surviving Hive/ORC tests were inspected; they were not executed in this review.
  2. Scope and clarity: implementation, build, service, fixture, and suite removals follow the retired features, with a shared BE rejection helper. No unrelated functional change was identified.
  3. Concurrency and locks: new validation reads existing parameters without adding threads, shared mutable state, locks, or lock-order edges. Supported Hive write locking/heartbeat/release and existing split/cache synchronization remain.
  4. Lifecycle and static initialization: removed read-transaction/client owners have no surviving consumers. Legacy ES metadata stays lazy; rejected directory providers are discarded. No new ownership cycle or cross-translation-unit initializer dependency is introduced.
  5. Configuration: two ES-only BE settings are removed, and both retired FE session names remain compatibility no-ops. No new dynamic configuration or propagation requirement is added.
  6. Compatibility and rolling upgrades: the external-read removals are deliberate and release-noted. ES image aliases and journal placeholders remain loadable, while first access rejects ES even with an obsolete provider installed. Legacy scan markers fail explicitly.
  7. Thrift/protobuf: all three touched Thrift files change comments only. Touched definitions were compared with live-matching branch-3.1/4.0/4.1/4.2 refs; field/enum meanings, IDs, types, and optionality remain compatible. No protobuf change.
  8. Parallel paths: synchronous, batch, streaming, scan-property, V1/V2, metadata-count, schema-discovery, and row-id fetch routes were traced. Full ACID and insert-only are both gated. Supported Paimon JNI reads and Iceberg/Hudi Avro metadata dependencies remain available.
  9. Conditional checks: retirement guards document concrete visibility/merge/count failure scenarios. Scan/range marker checks and effective format precedence match the traced producers and readers.
  10. Test coverage: focused negative tests cover removed formats at scan/range levels, both transactional modes, ES catalog creation/replay, and removed settings; supported scan/partition/write tests retain their core behavior. Runtime and assembled-artifact validation remain for CI.
  11. Test results: the ORC golden-output deletion matches the removed test_32 query; removed ES outputs accompany removed suites. No new expected result values were added. Deleted binary Avro fixtures have no textual payload in the supplied diff; their removed consumer and provisioning dependencies were checked.
  12. Observability: retirement errors identify the unsupported source/format; supported reader counters and logging remain. No new hot logging or critical runtime operation requiring additional metrics was identified.
  13. Transactions and persistence: retired Hive read transactions cannot open through the guarded planning paths. Nontransactional HMS commit locking remains, ES image/journal loading is retained, and no new EditLog mutation or publish protocol is added.
  14. Writes and atomicity: supported load, file-output, and storage-write logic is preserved. No new partial-write or crash-cleanup path is introduced.
  15. FE/BE variables: no new transmitted variable or numeric protocol value is introduced. Retired carriers remain reserved, and both scan-level and per-range representations are checked.
  16. Performance and memory: added checks are bounded string/enum comparisons per scanner/range, with no per-row work, large allocation, or additional locked I/O. Surviving plain-Hive listing/splitting and non-ACID ORC filtering retain their prior structure.
  17. Further-issue sweep: removed-symbol/build/service/fixture dependencies, Hive provisioning, empty/pruned scans, stale providers, schema RPCs, row-id markers, and delete-aware condition-cache behavior were rechecked without a substantiated additional defect.

User focus: no additional focus points were supplied. R1-R4 are dismissed with recorded evidence; there are no unresolved code candidates or unassigned changed paths. The review converged in one round: all three assigned reviewers returned NO_NEW_VALUABLE_FINDINGS and the final main sweep confirmed the dispositions. This was static-only: no builds, tests, Docker startup, release artifact/ELF audit, or live upgrade validation was performed.

Review converged after 1 round(s).

@Gabriel39
Gabriel39 force-pushed the dev/pick-69312-master branch from 457bc77 to e0ab4f9 Compare October 26, 2026 05:58
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@Gabriel39 Gabriel39 changed the title [refactor](external) Remove Hive ACID, Avro, LakeSoul and Elasticsearch reads [refactor](external) Remove Hive ACID, Avro and LakeSoul readers on master Oct 26, 2026

@github-actions github-actions Bot 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.

Reviewed all 93 changed paths at e0ab4f9. No new actionable findings.

The existing P2 session-variable compatibility comment is fixed at this head: the retired name is accepted by both SET paths, both variable-read paths preserve the empty-string fallback, and the added test covers case variants and export exclusion. It is not reposted. No existing P0/P1 finding remains to carry forward from the supplied threads. No additional user focus was supplied.

Critical checkpoint Conclusion
Goal and correctness Hive full-ACID and insert-only reads reject before reuse, scan properties and file planning. Standalone Avro and retired LakeSoul markers fail explicitly. Negative unit assertions are present.
Scope and reuse Deletions, shared rejection helper, compatibility handling and associated fixture cleanup form a focused removal.
Concurrency and locks No new threads, locks or shared mutable state. Retained streaming/listing synchronization and standalone Hive write locks are preserved.
Lifecycle and static initialization Removed read-transaction owners and callers disappear together; retained filesystem/reader ownership remains intact. No new static-initialization dependency.
Configuration No new setting. The retired ACID session name remains a compatibility no-op; obsolete LakeSoul test settings are removed.
Behavioral and format compatibility Read-support retirement is intentional. Ordinary Hive, Iceberg/Paimon ORC deletion handling and Iceberg/Hudi Avro metadata consumers retain their independent paths.
Thrift/protobuf All three Thrift changes are comments only. All nine touched definitions were compared at HEAD and current branch-3.1/4.0/4.1/4.2 refs: IDs retain their meanings; no new required field or reuse. No protobuf change.
Parallel execution paths Checked V1/V2, initial/later ranges, metadata counts, row-ID fetch, synchronous/reused/batched/streamed Hive planning, and both legacy/Nereids load callers.
Conditional checks and errors New checks address concrete retired payloads and propagate explicit failures before reader creation; retained non-ACID partition/NULL parsing is equivalent to the old false-ACID branch.
Test coverage Inspected added full-ACID/insert-only, Avro/LakeSoul and session-compatibility cases, adapted supported-path tests, and retained ORC position-delete/cache tests. No tests executed.
Expected results The removed ORC test_32 query matches its removed output block. No new expected result values are introduced.
Observability Errors identify the retired format. Removed ACID counters belong to the removed feature; no new distributed work needs metrics.
Transactions and persistence Read-side HMS snapshots/locks are removed after FE rejection. Retained Hive write lock/heartbeat/release operations and Doris EditLog/visibility/MoW paths are unchanged.
Writes, atomicity and crash cleanup No production data-write behavior is added or changed; no new crash-cleanup ownership.
FE/BE state passing No new transmitted variable. Deprecated definitions remain available; BE validates both scan-level and per-range markers.
Performance and memory Checks are bounded per scan/range, outside row loops. Removed ACID state/filter work adds no retained-path allocation or memory owner.
Further recheck Rechecked stale class/header/build/fixture references, shared ORC lazy/eager/no-predicate deletion and condition-cache handling, late materialization, mixed-version requests and metadata Avro dependencies. No remaining concrete candidate.

Static review only, as required: no builds, tests, source edits or runtime validation. Compilation, full linking, final-artifact glibc compatibility and end-to-end/mixed-binary execution were not verified. These are validation limits; there is no unreviewed changed path or unresolved code candidate.

Review converged in 2 rounds after the main review, two complete-scope reviewers and a separate risk reviewer, including recheck of this frozen summary and empty new-comment set.

Review converged after 2 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.94% (2099/2728)
Line Coverage 66.04% (38643/58515)
Region Coverage 53.76% (36314/67549)
Branch Coverage 57.29% (11813/20618)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28767 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e0ab4f990d38fd8b735eee6468be2102abae897f, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17379	5213	5072	5072
q2	2146	311	253	253
q3	10135	1397	823	823
q4	4687	464	335	335
q5	7432	799	543	543
q6	189	183	152	152
q7	765	821	592	592
q8	9260	1347	1042	1042
q9	5570	4251	4195	4195
q10	6829	1293	1030	1030
q11	442	248	238	238
q12	645	397	276	276
q13	18139	3628	3024	3024
q14	283	271	243	243
q15	q16	749	715	677	677
q17	1225	750	579	579
q18	6980	6174	6132	6132
q19	1115	962	630	630
q20	418	328	223	223
q21	5196	2432	2513	2432
q22	369	330	276	276
Total cold run time: 99953 ms
Total hot run time: 28767 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5968	5925	5924	5924
q2	687	580	563	563
q3	5532	5670	5224	5224
q4	2078	2192	1586	1586
q5	5919	5708	5792	5708
q6	252	191	147	147
q7	2210	2023	1875	1875
q8	3003	2599	2672	2599
q9	7467	7457	7495	7457
q10	3647	3637	3157	3157
q11	597	435	416	416
q12	664	669	530	530
q13	3376	3623	3030	3030
q14	281	305	279	279
q15	q16	661	685	613	613
q17	7773	7025	6919	6919
q18	13000	12190	12928	12190
q19	898	802	812	802
q20	2163	2144	1939	1939
q21	5669	4639	4778	4639
q22	500	464	450	450
Total cold run time: 72345 ms
Total hot run time: 66047 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 97.30% (36/37) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 66.80% (32102/48059)
Line Coverage 51.61% (339233/657283)
Region Coverage 47.06% (275079/584552)
Branch Coverage 48.74% (129638/265989)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 151954 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e0ab4f990d38fd8b735eee6468be2102abae897f, data reload: false

query5	4315	573	432	432
query6	423	209	201	201
query7	4816	428	219	219
query8	329	163	150	150
query9	8765	3090	3109	3090
query10	483	299	255	255
query11	5968	3890	3603	3603
query12	147	91	87	87
query13	1246	449	324	324
query14	6097	3978	3713	3713
query14_1	3480	3418	3438	3418
query15	210	218	181	181
query16	938	449	371	371
query17	865	658	541	541
query18	2426	426	311	311
query19	201	175	137	137
query20	84	85	84	84
query21	202	133	108	108
query22	13040	13184	12852	12852
query23	13454	12880	12603	12603
query23_1	12667	12598	12608	12598
query24	7343	820	477	477
query24_1	469	497	484	484
query25	540	427	368	368
query26	1276	262	142	142
query27	2764	440	312	312
query28	4561	1947	1931	1931
query29	1530	590	428	428
query30	296	214	186	186
query31	1016	930	822	822
query32	146	88	88	88
query33	528	295	219	219
query34	908	844	490	490
query35	726	763	639	639
query36	804	786	752	752
query37	118	97	77	77
query38	1764	1799	1694	1694
query39	790	790	747	747
query39_1	729	722	751	722
query40	211	108	94	94
query41	67	64	63	63
query42	85	79	80	79
query43	346	356	313	313
query44	1296	687	703	687
query45	173	179	168	168
query46	833	989	567	567
query47	2963	2862	2934	2862
query48	292	304	212	212
query49	566	387	281	281
query50	674	270	211	211
query51	10579	10639	10543	10543
query52	80	80	68	68
query53	210	204	150	150
query54	256	189	176	176
query55	74	67	66	66
query56	227	223	223	223
query57	1659	1602	1613	1602
query58	279	262	257	257
query59	2063	2150	1994	1994
query60	292	241	210	210
query61	148	147	145	145
query62	383	334	287	287
query63	188	161	155	155
query64	2753	930	756	756
query65	3345	3288	3259	3259
query66	1782	420	300	300
query67	20711	20450	20186	20186
query68	2941	1009	614	614
query69	385	298	248	248
query70	862	760	756	756
query71	297	232	207	207
query72	2765	2608	2392	2392
query73	528	525	298	298
query74	4630	4541	4378	4378
query75	2338	2287	1947	1947
query76	2299	1019	604	604
query77	366	385	280	280
query78	10005	9748	9286	9286
query79	1005	871	524	524
query80	1240	466	385	385
query81	579	327	279	279
query82	592	135	105	105
query83	306	202	189	189
query84	312	129	152	129
query85	873	421	366	366
query86	398	239	235	235
query87	2031	1987	1796	1796
query88	3680	2648	2635	2635
query89	321	282	242	242
query90	1907	166	158	158
query91	163	153	123	123
query92	95	87	88	87
query93	1077	1001	580	580
query94	621	302	273	273
query95	578	325	301	301
query96	648	494	232	232
query97	2422	2425	2299	2299
query98	169	156	149	149
query99	783	759	652	652
Total cold run time: 235966 ms
Total hot run time: 151954 ms

morningman
morningman previously approved these changes Oct 26, 2026
@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 97.30% (36/37) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.34% (36016/46567)
Line Coverage 62.57% (406876/650256)
Region Coverage 59.08% (344074/582432)
Branch Coverage 59.98% (159150/265337)

924060929
924060929 previously approved these changes Oct 26, 2026
@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 2.21% (3/136) 🎉
Increment coverage report
Complete coverage report

Gabriel39 added a commit that referenced this pull request Oct 26, 2026
…#69614)

### What problem does this PR solve?

Related PR: #69601

Problem Summary:

Elasticsearch HTTP scans always use FileScanner v1, even when
`enable_file_scanner_v2` is enabled. Add an ES TableReader/FileReader
pair and route `FORMAT_ES_HTTP` queries through FileScannerV2 when that
session option is enabled.

The reader exposes a file-local schema, uses MaterializedColumnMapper
for projection and predicate localization, and applies residual filters
with v2 row accounting. It reuses the existing ES query builder, HTTP
scroll transport, authentication, SSL settings, catalog-provided
endpoints, and type conversions. Shared host selection and materialized
complex-schema helpers keep the two scanner paths consistent.

Parse the initial cached response during open so early
LIMIT/cancellation can clear its scroll context. Close the stream on
EOF, cancellation, open/read errors, and split changes, and report close
failures once.

The RLE header reach baseline increases by two for the new ES reader and
test translation units, which use the existing table/expr header
closure. The shared parser retains its existing type dispatch, with a
documented complexity suppression on the new projection overload.

### Release note

Support Elasticsearch HTTP queries in FileScannerV2 when
`enable_file_scanner_v2` is enabled. Disabling the option continues to
select FileScanner v1.

### Check List (For Author)

- Test
- [x] Unit Test: 61 ASAN BE tests covering ES v2 projection, doc values,
`_id`, nullable values/arrays, multi-page batching, zero-column row
counting, residual filtering, split advancement, cancellation, error
cleanup, and a real local HTTP scroll server; existing scanner dispatch,
legacy ES, and Remote Doris tests also pass.
- [ ] Regression test: added ES 5/6/7/8 v1/v2 differential coverage with
source/docvalue scans and small batches. Groovy syntax checked; live
external ES regression not run locally.
- [x] clang-format 16, clang-tidy on changed C++ lines, and BE
build-hygiene checks.
- Behavior changed:
    - [x] Yes. ES queries honor the v2 session option.
- Does this need documentation?
- [x] No. Uses the existing scanner session option and ES catalog
properties.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 50.00% (5/10) 🎉
Increment coverage report
Complete coverage report

…aster

### What problem does this PR solve?

Related PR: apache#69312

Problem Summary: Port the removal of unsupported external readers to master.
Adapt Hive transaction cleanup to the connector modules and preserve the
unified reader initialization interfaces. Reject deprecated reads before
file access or metadata-only count shortcuts, and remove obsolete fixtures
and examples. Preserve Iceberg and Hudi Avro metadata dependencies.

### Release note

Remove Hive transactional table reads, including insert-only tables, and
standalone Avro file reads. LakeSoul remains unsupported. Iceberg and Hudi
Avro metadata parsing is preserved. All Thrift definitions and IDs remain
unchanged.

### Check List (For Author)

- Test: Hive connector and HMS unit tests; targeted FE core unit tests;
  FE Checkstyle; clang-format 16; BE syntax checks; build hygiene;
  shell syntax and Thrift definition checks.
- Behavior changed: Yes, reject unsupported external reads explicitly.
- Does this need documentation: No, this ports the existing removal.

(cherry picked from commit 518be1a,
 adapted to master)
### What problem does this PR solve?

Related PR: apache#69601

Problem Summary: Clients that still set skip_checking_acid_version_file
when initializing a connection encounter an unknown-variable error after
the Hive ACID reader removal. Register the retired name in the existing
removed-variable compatibility set so SET remains a no-op and both
variable-read paths use the empty-string fallback. Do not restore the
session field or the removed Hive read support.

### Release note

Continue accepting the retired skip_checking_acid_version_file session
variable as a compatibility no-op.

### Check List (For Author)

- Test: Targeted FE unit tests and FE Checkstyle.
- Behavior changed: Yes, preserve legacy client session initialization.
- Does this need documentation: No.
@Gabriel39
Gabriel39 dismissed stale reviews from 924060929 and morningman via 31d7e91 October 26, 2026 13:45
@Gabriel39
Gabriel39 force-pushed the dev/pick-69312-master branch from e0ab4f9 to 31d7e91 Compare October 26, 2026 13:45
@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot 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.

Static review of #69601 at 31d7e91: no new actionable findings.

The existing P2 thread 4373671401 is fixed: the retired skip_checking_acid_version_file name now uses VariableMgr's compatibility no-op for master/follower SET and empty-string variable reads, and stays out of session export. No existing P0/P1 finding remains to carry forward. No additional user focus was supplied.

Critical checkpoint conclusions:

  1. Goal and proof: full-ACID and insert-only Hive reads are rejected at connector planning entrances; standalone Avro is rejected by the file-format factory and BE support checks; deprecated Hive/LakeSoul markers cannot become ordinary data or metadata-count reads. New unit tests encode rejection and legacy-session compatibility. Runtime behavior was not tested in this review.
  2. Scope and clarity: implementation changes remove retired readers/transactions and update their callers; obsolete LakeSoul services, fixtures and samples are removed consistently.
  3. Concurrency and locking: no new workers, shared mutable state or lock ordering; ordinary listing/cache/streaming synchronization is preserved. Surviving Hive write acquisition, heartbeat and lock release are unchanged.
  4. Lifecycle and initialization: read-transaction ownership disappears with its callers; filesystem borrowing and remaining reader/cache lifetimes are preserved. No new static-initialization dependency or ownership cycle found.
  5. Configuration: no new configuration. The removed ACID session setting retains compatibility; removed LakeSoul regression settings have no remaining consumer.
  6. Compatibility: existing session initialization remains accepted. Deleted internal read APIs have no remaining repository callers; retained Avro metadata dependencies for Iceberg/Hudi are unaffected. Unsupported reads are an intentional documented behavior change.
  7. Thrift/protobuf: all three touched Thrift files differ only in comments. Touched definitions were compared on HEAD and branch-3.1/4.0/4.1/4.2; field IDs, types, enum meanings and optionality remain compatible. No protobuf changes.
  8. Parallel paths: synchronous, reused, partition-batch and streaming Hive planning; BE v1/v2; row-id fetch; both load planners; eager/lazy ORC predicates; Iceberg position deletes and Paimon deletion vectors were checked. Retained ordinary read paths are preserved.
  9. Conditions: the transactional guard explains why both Hive layouts need visibility handling; BE guards precede range pruning/reader/count setup. Removing ACID branches preserves the former non-ACID behavior.
  10. Test coverage: added JUnit/BE unit cases cover unsupported inputs and session compatibility; retained scan/cache/partition tests cover ordinary paths. End-to-end rejection and runtime delete behavior remain CI validation responsibilities under this static-only contract.
  11. Test results: the removed ORC golden-output block matches the removed query; no replacement expected-result values are introduced. Test code and results were inspected, not executed.
  12. Observability: removed formats fail explicitly with actionable unsupported-read messages; retained scan profiles/logs remain. No new distributed operation requiring metrics was added.
  13. Persistence and failover: no EditLog, storage publication, visible-version or failover state machine changes; the removed-variable compatibility path covers old names.
  14. Writes and atomicity: no data-write/commit algorithm changes; nontransactional Hive writes retain their independent standalone HMS locks, and transactional writes remain rejected. No introduced write/crash atomicity issue found.
  15. FE-BE propagation: no new transmitted variable or wire field; deprecated definitions remain reserved. Scan-level/range checks reject retired markers while supported table formats retain their payload handling.
  16. Performance and other invariants: no new large allocation, untracked buffer, hot-loop copy or repeated listing introduced. Existing ORC row-position/delete/cache behavior is retained; build.sh no longer enumerates avro-scanner, so removing its obsolete release-build ignore argument is consistent.

Coverage: all 93 changed paths and relevant upstream/downstream mechanisms were inspected. No unresolved candidate or uncovered review scope remains. Validation was static only: no builds, tests, service startup or source modifications were performed.

Convergence: true after 1 review round; both complete reviewers and the additional rejection/ORC risk reviewer returned NO_NEW_VALUABLE_FINDINGS on the final review set.

Review converged after 1 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28615 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 31d7e91ccc09da051218d8bbd27166a2d138100e, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17389	5211	5110	5110
q2	2128	315	252	252
q3	10160	1397	811	811
q4	4676	459	335	335
q5	7441	789	531	531
q6	189	183	151	151
q7	742	805	596	596
q8	9266	1346	1104	1104
q9	5521	4217	4211	4211
q10	6840	1296	1045	1045
q11	432	248	235	235
q12	637	404	284	284
q13	18079	3538	3086	3086
q14	272	286	253	253
q15	q16	726	728	666	666
q17	1206	739	582	582
q18	7050	6174	6125	6125
q19	1100	954	600	600
q20	382	335	233	233
q21	4668	2150	2334	2150
q22	345	295	255	255
Total cold run time: 99249 ms
Total hot run time: 28615 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5676	5624	5667	5624
q2	684	567	524	524
q3	5250	5354	4993	4993
q4	2000	2187	1574	1574
q5	5292	5180	5564	5180
q6	271	210	162	162
q7	2374	2083	1837	1837
q8	3067	2684	2666	2666
q9	8069	7967	7921	7921
q10	3848	3743	3240	3240
q11	648	471	441	441
q12	736	717	536	536
q13	3671	3937	3299	3299
q14	328	325	311	311
q15	q16	691	731	652	652
q17	8262	7044	6969	6969
q18	13046	12228	12942	12228
q19	946	832	837	832
q20	2157	2174	1945	1945
q21	5794	4595	4833	4595
q22	484	447	407	407
Total cold run time: 73294 ms
Total hot run time: 65936 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 151149 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 31d7e91ccc09da051218d8bbd27166a2d138100e, data reload: false

query5	4308	584	443	443
query6	425	204	192	192
query7	4815	429	227	227
query8	325	163	157	157
query9	8766	3085	3104	3085
query10	495	299	272	272
query11	6040	3864	3592	3592
query12	152	99	87	87
query13	1273	436	324	324
query14	6131	3956	3652	3652
query14_1	3451	3455	3495	3455
query15	208	198	189	189
query16	958	433	427	427
query17	849	676	535	535
query18	2442	436	313	313
query19	197	166	138	138
query20	83	84	84	84
query21	207	134	108	108
query22	12955	12981	12932	12932
query23	13424	12897	12447	12447
query23_1	12707	12556	12539	12539
query24	7276	817	482	482
query24_1	478	473	479	473
query25	532	427	363	363
query26	1257	256	144	144
query27	2770	438	269	269
query28	4582	1964	1995	1964
query29	1577	610	450	450
query30	295	225	186	186
query31	1015	932	822	822
query32	149	87	89	87
query33	523	299	235	235
query34	878	849	493	493
query35	740	768	639	639
query36	812	805	730	730
query37	120	95	88	88
query38	1783	1784	1682	1682
query39	792	792	746	746
query39_1	756	735	743	735
query40	218	116	101	101
query41	73	68	70	68
query42	86	85	82	82
query43	343	362	312	312
query44	1302	684	684	684
query45	185	190	165	165
query46	832	972	561	561
query47	2783	2936	2847	2847
query48	288	301	212	212
query49	573	396	287	287
query50	659	268	207	207
query51	10597	10552	10403	10403
query52	78	78	69	69
query53	179	207	150	150
query54	229	187	183	183
query55	68	65	65	65
query56	250	209	205	205
query57	1652	1621	1550	1550
query58	280	262	250	250
query59	2114	2154	2010	2010
query60	288	240	265	240
query61	150	145	146	145
query62	387	328	299	299
query63	184	159	153	153
query64	2719	939	768	768
query65	3356	3249	3273	3249
query66	1774	422	294	294
query67	20221	20205	19948	19948
query68	3064	1001	609	609
query69	379	294	256	256
query70	849	762	774	762
query71	296	241	210	210
query72	2840	2609	2290	2290
query73	513	522	293	293
query74	4664	4502	4339	4339
query75	2322	2293	1911	1911
query76	2282	1007	595	595
query77	325	378	261	261
query78	9923	9742	9170	9170
query79	965	876	517	517
query80	965	429	343	343
query81	578	315	275	275
query82	570	133	107	107
query83	305	192	188	188
query84	300	124	106	106
query85	886	421	395	395
query86	362	271	237	237
query87	1987	1964	1796	1796
query88	3610	2680	2672	2672
query89	328	274	242	242
query90	1830	167	178	167
query91	152	151	126	126
query92	95	92	82	82
query93	995	1012	588	588
query94	542	309	273	273
query95	580	324	296	296
query96	662	485	234	234
query97	2435	2420	2322	2322
query98	175	154	149	149
query99	775	770	658	658
Total cold run time: 234721 ms
Total hot run time: 151149 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.11 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 31d7e91ccc09da051218d8bbd27166a2d138100e, data reload: false

query1	0.00	0.00	0.01
query2	0.13	0.08	0.08
query3	0.34	0.13	0.14
query4	1.60	0.14	0.14
query5	0.27	0.24	0.26
query6	1.15	0.66	0.66
query7	0.04	0.01	0.01
query8	0.08	0.06	0.07
query9	0.44	0.37	0.36
query10	0.56	0.56	0.59
query11	0.32	0.18	0.18
query12	0.32	0.18	0.18
query13	0.56	0.51	0.52
query14	0.92	0.90	0.95
query15	0.66	0.59	0.59
query16	0.36	0.36	0.35
query17	1.02	1.01	1.00
query18	0.29	0.27	0.27
query19	1.94	1.78	1.83
query20	0.02	0.02	0.01
query21	15.40	0.35	0.30
query22	4.89	0.13	0.12
query23	15.88	0.51	0.29
query24	2.31	0.52	0.40
query25	0.16	0.11	0.10
query26	0.76	0.27	0.21
query27	0.09	0.10	0.10
query28	3.46	0.85	0.39
query29	12.60	4.40	3.40
query30	0.35	0.16	0.15
query31	2.75	0.62	0.32
query32	3.23	0.61	0.48
query33	3.01	2.98	2.98
query34	15.94	4.11	3.46
query35	3.41	3.38	3.38
query36	0.60	0.54	0.50
query37	0.11	0.10	0.10
query38	0.07	0.07	0.07
query39	0.05	0.06	0.05
query40	0.19	0.18	0.16
query41	0.11	0.06	0.04
query42	0.06	0.06	0.05
query43	0.06	0.05	0.06
Total cold run time: 96.51 s
Total hot run time: 25.11 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 97.30% (36/37) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.37% (35131/46611)
Line Coverage 60.38% (393095/650995)
Region Coverage 56.40% (328995/583349)
Branch Coverage 57.53% (152908/265806)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 18.75% (3/16) 🎉
Increment coverage report
Complete coverage report

@Gabriel39
Gabriel39 merged commit b68d1d5 into apache:master Oct 27, 2026
47 of 62 checks passed
morningman added a commit to morningman/doris that referenced this pull request Oct 31, 2026
… in the suite comment

### What problem does this PR solve?

Issue Number: None

Related PR: apache#61141, apache#69601

Problem Summary: The header comment of test_tvf_avro_format_rejected said
that apache#69601 removed the BE Avro reader. On master the reader was removed by
apache#61141; apache#69601 made FE reject format=avro during analysis and added a BE-side
guard. Correct the PR number in the comment. Comment only.

### Release note

None

### Check List (For Author)

- Test: No need to test (comment-only change); the suite still passes the
  offline Groovy parse check
- Behavior changed: No
- Does this need documentation: No

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
morningman added a commit that referenced this pull request Oct 31, 2026
…69849)

### What problem does this PR solve?

Issue Number: None

Related PR: #69601, #64699

Problem Summary:

**In short.** #69601 made FE reject `format=avro` while it parses file
format properties. This PR adds end-to-end coverage for that: a
regression suite that runs `s3()` and `hdfs()` with `format=avro` and
checks that they fail during analysis, and a unit test for the two
table-function constructors. Test only, no code change.

**Background.** Master no longer reads standalone Avro files: #61141
removed the BE reader, #65733 the scanner module, and #69601 made
`FileFormatProperties.createFileFormatProperties` throw `Avro file reads
are no longer supported`. Before #69601, FE accepted the format and the
query failed later in BE with `Not supported file format in fetch table
schema: 12`. branch-4.2 still reads Avro through the JNI scanner (#64699
fixed a crash in it), so users who upgrade from 4.x with Avro table
functions or loads get this error.

**What was missing.** #69601's unit test calls
`createFileFormatProperties` directly. Nothing checks that a table
function reaches that check before it validates storage properties or
lists files. If a constructor validated the location first,
`format=avro` against an unreachable location would report a storage
error instead, and no test would notice.

**What this PR adds.**

- `external_table_p0/tvf/test_tvf_avro_format_rejected`: `s3()` and
`hdfs()` with `format` set to `avro` and to `AVRO`, against a made-up
bucket, made-up credentials and an HDFS address nothing listens on. Each
call must fail with `Avro file reads are no longer supported`.
-
`UnsupportedExternalReadsTest#testAvroTableFunctionsAreRejectedBeforeStorageAccess`:
constructs `S3TableValuedFunction` and `HdfsTableValuedFunction` with
`format=avro` / `AVRO` and checks the same message.

**Results.** On master `2a4191c1dc9` with this change, all four
statements of the suite fail during analysis with `Can not build s3():
Avro file reads are no longer supported` / `Can not build hdfs(): ...`,
and the unit test passes. Before #69601 the same `s3()` call would have
gone on to validate and list the made-up location, so the suite pins the
order as well as the message.
yiguolei pushed a commit that referenced this pull request Nov 6, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: #65730 #66608 #66805 #66841 #66999 #67005 #67011 #67110
#67268 #67289 #67325 #67650 #67921 #68028 #68335 #68375 #68615 #68690
#68813 #68815 #68707 #68649

Problem Summary:

**In short.** This ports the Lance BE read path of branch-4.1 /
branch-4.2 to master, in its branch-4.2 form as of `cabcf45c1af`, plus
the BE side of three 4.x changes merged after that snapshot: the search
filter `prefilter` flag and profile layout (#68813), distance bounds for
`vector_search` (#68815), and the split-level index rule of #68707 that
#68815 relies on. It gathers the BE parts of the PRs listed above.
Master links `liblance_c` but has no Lance reader, so every
`FORMAT_LANCE` scan fails today. With this PR the BE reads Lance
datasets through FileScannerV2: plain scans, vector search and full-text
search, predicate and runtime-filter pushdown, the schema fetch of a
local Lance TVF, and the second phase of TopN lazy materialization. The
PR is BE only. The FE connector plugin and the regression suites come in
separate PRs, so until then nothing on master plans a Lance scan, and
the BE unit tests carry the proof.

Original authors: @zhangstar333 @Gabriel39 @wangzhaobo957-cloud @Jay-ju
@FANNG1

**Background.** Lance shipped in 4.1.4: the Lance catalog, `local()` /
`s3()` with `format=lance`, and the `vector_search` / `full_text_search`
TVFs. On master the FE side is being rebuilt as a connector plugin
(`fe-connector-lance`), and the BE needs the reader from 4.x. The thrift
ids are the branch-4.1 / 4.2 ones, including `TExternalSearchRequest.5`
(`prefilter`) and `TVectorSearchParams.6/7` (distance bounds) added
after the snapshot, so a BE built from master also reads the Lance scan
ranges and search requests that a 4.x FE sends during a rolling upgrade.
The one exception is `TVectorSearchOptions` 6, branch-4.2's
`approx_mode` (#69852, merged into branch-4.2 after the snapshot and not
ported): it is reserved in a comment, and a master BE ignores it, so
during a rolling upgrade a 4.2 FE that asks for `fast` or `accurate`
gets Lance's default (`normal`).

**The problem, and what it cost.**

| | master today | with this PR |
|---|---|---|
| A `FORMAT_LANCE` scan | FileScannerV2 has no Lance reader, so the scan
fails with "FileScannerV2 does not support file format" | read by
`LanceTableReader` in FileScannerV2 |
| `fetch_table_schema` for a local Lance TVF | not handled | returns the
Arrow schema mapped to Doris types; Null leaves keep `NULL_TYPE` |
| The row location of a Lance row in TopN lazy materialization |
`GlobalRowLoacationV2` only has a 32-bit row id, but a Lance row id is a
64-bit id within the snapshot | a version 1 layout carries the 64-bit
row id; phase two reads the rows with the dataset's `take_rows` |

**How this PR fixes it.**

- Reader: `be/src/format_v2/lance/*` and
`be/src/format_v2/table/lance_reader.*`, as on branch-4.2 except one
local renamed for master's `-Wshadow`. The unit tests construct
`RuntimeState(TQueryOptions(), globals)`, because master removed the
globals-only constructor.
- FileScannerV2: the reader dispatch and `_to_file_format` handle
`FORMAT_LANCE` / `"lance"`; `FileFormat::LANCE` is added to its two
exhaustive switches. Since #69723 every file scan uses FileScannerV2, so
nothing else routes Lance scans (on branch-4.2 a Lance query fails with
NotSupported when `enable_file_scanner_v2` is off).
- Row locations: `ROW_VERSION {FILE_LOCAL_ROW_ID = 0,
LANCE_DATASET_ROW_ID = 1}` and a union layout for
`GlobalRowLoacationV2`. Version 0 keeps its byte layout, which static
asserts pin. `PRequestBlockDesc.row_id` becomes `uint64` (a proto2
varint, so the wire format is compatible). The materialization operator
decodes row locations by version, rejects an unknown version or a wrong
size, and stamps `row_location_version`. `RowIdStorageReader` validates
the counts and the version, range-checks internal row ids against
`uint32`, and groups Lance rows by plan node, snapshot version and
dataset URI, so each dataset is read with one `take_rows`. Master's
segment batching, scan-slot dedup and fetch concurrency stay as they
are.
- Thrift (`PlanNodes.thrift`): the external search request body
(`TVectorElementType`, `TVectorMetric`, `TSearchVector`,
`TVectorSearchParams` 1-7, `TFtsCoverageMode`, `TFtsQueryType`,
`TFtsMatchOperator`, `TFullTextSearchParams`, `TSearchFilterFormat`,
`TSearchFilter`, `TVectorSearchOptions`, `TExternalSearchQuery`),
`TExternalSearchRequest` 2-5 and `TLanceFileDesc` 4-6, all with the
branch-4.1 / 4.2 ids. The enums spell out their 4.x values. No id is
reused. On master, #70075 reserved `TExternalSearchRequest` 2-5 in
comments and added 6 (`paimon_options`); this PR replaces those comments
with the fields and leaves 6 as it is. `TVectorSearchOptions` 6 is
reserved in a comment for branch-4.2's `approx_mode` (#69852).
- After the snapshot (one commit each):
- #68813: `prefilter` decides whether the TVF search filter runs before
(true) or after (unset / false) candidate selection, for vector and
full-text search. The profile groups the Lance counters under
`LanceTiming`, `LanceIO`, `LanceIndex`, `LanceVectorIndex`,
`LanceScalarIndex`, `LanceExecutionPlan`, `LanceScan`, `LanceSearchPlan`
and `LanceDataCache`, uses the 4.x counter names, and registers every
scan metric before the statistics callback is installed, so the
callback, which Lance invokes from its execution streams, never adds
counters. #68813's FE tweak that hides `TUnit.NONE` labels in
`AggCounter` belongs to the FE port.
- #68707 (part): a vector split searches exactly the index segments FE
planned for it, and a split without segments is searched flat whatever
`use_index` says; a split with segments under `use_index = false` is
rejected. 4.x FEs plan segments only when `use_index` allows them.
- #68815: `distance_lower_bound` (inclusive) and `distance_upper_bound`
(exclusive) are validated (finite FLOAT values, lower < upper at FLOAT
precision, single-vector only) and installed with
`lance_scanner_set_distance_range()`, which master's pinned lance-c
provides.
- Review fixes:
- A nested array goes to the Doris SerDes without a copy only when it
and every descendant start at offset 0 and reference exactly their child
ranges. Lance's legacy (v1) decoder can return a struct or list that is
tight at its own level over a Boolean child with a bit offset (a batch
that starts mid-byte in the bitmap), and the SerDes reject that under
Arrow input validation.
- A zero-field `STRUCT<>`, which Lance decodes, is reported as an
unsupported column at any nesting level, like the other unsupported
Lance types. It used to be typed as a STRUCT that `ColumnStruct` cannot
hold (its row count comes from its first child).
- A Lance Decimal256 field with precision <= 38 is narrowed to
Decimal128 by a safe Arrow cast before decoding. Doris types it
DECIMAL32/64/128I by precision, and those SerDes read only Decimal128
arrays; the BE used to crash on the first value, also for nested leaves.
Only values a reader can see are cast: before a nested leaf is narrowed,
every child slot that no visible row references (under a NULL list,
fixed-size-list, map or struct row, or outside a sliced parent) is
marked NULL, so a hidden value does not fail the cast and a visible
value outside the declared precision still does; map keys, which cannot
be NULL, stay checked.
- FLOAT / DOUBLE `>=` runtime filters stay residual-only. Lance compares
floats by totalOrder, so a pushed `x >= c` dropped negative-NaN rows
that Doris keeps.
- Runtime filters that mention INT64_MIN stay residual-only. The pinned
Lance SQL parser reads `-9223372036854775808` as the negation of a
magnitude that it parses as i64 first; the overflow turns the literal
into a Float64, which the planner cannot coerce to Int64 or Decimal, so
a pushed IN, `>=` or `<=` filter on an INT64 or scale-zero decimal
column failed planning and the query failed. Every other i64 is still
pushed.
- The shared Arrow DATE32 decoding
(`DataTypeDateV2SerDe::read_column_from_arrow`) rejects days outside
0000-01-01..9999-12-31 instead of returning a non-null `0000-00-00`,
skips null slots and adds the epoch in 64 bits: the DATE32 range part of
branch-4.1 / 4.2 #68649. It also changes ADBC, Arrow stream load and
paimon-rust reads.
- Child values hidden by a NULL list, fixed-size-list, map or struct row
are not decoded: the array, map and struct SerDes give the element SerDe
a validity bitmap that also clears those slots
(`mask_arrow_children_hidden_by_null_parents()`). Arrow leaves them
unspecified, and Lance's v2.1 miniblock encoding keeps them, so a hidden
10000-01-01 under a NULL fixed-size list used to fail the DATE32 range
check above. Visible values are unchanged; this applies to ADBC, Arrow
stream load and paimon-rust as well. The masks come from ExecEnv's
tracked Arrow pool. A nested Lance array that is compacted before
decoding is masked the same way, at every level, before its
`ValidateFull()`, so a hidden invalid UTF-8 string, out-of-precision
decimal, Date64 or time no longer fails the batch while a visible one
still does. Since #69697 the same masks keep hidden DATETIMEV2 /
TIMESTAMPTZ values out of its range checks. A mask costs at most one
pass per batch: a NULL row that owns no child slots, or only NULL ones,
allocates nothing, and Arrow stream load masks each retained IPC batch
once (`mask_arrow_descendants_not_visible()`) before it hands row ranges
to the SerDes, so its per-block reads allocate nothing. The one
per-block mask left is for map keys under a NULL map row that still owns
entries, since a MapArray cannot hold NULL keys; Arrow's map builder
writes NULL map rows without entries.
- Core: `to_protobuf` keeps `NULL_TYPE` for a NULL literal type, so a
Null leaf in ARRAY / MAP / STRUCT no longer comes back as BOOLEAN. The
nullable serde reads an Arrow Null array as NULLs without touching
buffers that the array does not have.
- Configs, caches and metrics, with the 4.x names and defaults:

  | Config | Default |
  |---|---|
  | `lance_index_cache_size_bytes` | 10 GiB |
  | `lance_metadata_cache_size_bytes` | 1 GiB |
  | `enable_lance_data_cache` | true |
  | `lance_data_cache_path` | `${DORIS_HOME}/lance_data_cache` |
  | `lance_data_cache_disk_capacity_bytes` | 100 GiB |
  | `lance_data_cache_read_block_size_bytes` | 1 MiB |
  | `lance_io_buffer_size_bytes` (mutable) | 2 GiB |
  | `lance_batch_readahead` (mutable) | 5 |
  | `lance_fragment_readahead` (mutable) | 5 |

The BE-wide Lance session (index cache, metadata cache and the optional
Foyer disk cache) is created by the first Lance scan, so a BE that never
reads Lance creates no cache directory. The first six configs take
effect after a restart. A negative cache size (and, while the data cache
is enabled, a negative disk capacity or read block size) fails the first
Lance scan with a message that names the setting, as does any data-cache
value lance-c rejects; the rest of the BE keeps serving. Ten
`lance_session_*` metrics report the two in-memory caches. With the
defaults, the disk tier keeps 51,200 sparse 2 MiB block files open from
the first Lance scan on (100 GiB in blocks of twice the read block
size), the same as on branch-4.1 / 4.2. Size
`lance_data_cache_disk_capacity_bytes` and
`lance_data_cache_read_block_size_bytes` against the BE's open-file
limit, or set `enable_lance_data_cache = false`.

The index and metadata caches live in lance-c memory: they are not
charged to a MemTracker or registered with CacheManager, so memory GC,
the cache capacity adjustment under memory pressure and
`/api/clear_cache/all` do not shrink them, and `enable_lance_data_cache
= false` does not turn them off. lance-c has no call to clear, evict or
resize them, so size them with the two configs. The disk tier keys
blocks by Lance's store prefix (`scheme$bucket` for S3, GCS and OSS,
without the endpoint) and the object path
(`thirdparty/patches/lance-c-foyer.patch`). Several endpoints that serve
the same bucket name and data-file path with different bytes (data files
registered under chosen names or replaced in place; Lance's writers use
random file names) share entries, also across a BE restart; such a
deployment should set `enable_lance_data_cache = false`. Both are as on
branch-4.1 / 4.2 and tracked as follow-ups.

A Lance scan's native working set, that is the I/O buffered up to
`lance_io_buffer_size_bytes` per scanner, the decode readahead and the
operators of a search plan such as the top-k of a flat vector search, is
allocated inside lance-c and is charged to neither the query nor its
workload group. It counts toward the BE process memory only, so memory
GC, which ranks queries by tracked memory, does not attribute it to the
Lance query. lance-c accepts no memory budget, so on BEs with little
memory headroom size `lance_io_buffer_size_bytes`,
`lance_batch_readahead` and `lance_fragment_readahead` for the number of
concurrent Lance scanners. As on branch-4.1 / 4.2; tracked as a
follow-up.
- Build: macOS links `-framework IOKit`. This is the first time objects
of `liblance_c.a` are pulled into `doris_be`, so the binary and the link
time grow. With this PR `util/rle_encoding.h` reaches 231 TUs and
`util/threadpool.h` 589, the same as master `315c2e00331` alone (limits
275 and 660 since #69717), and `gen_cpp/internal_service.pb.h` 562
(master alone 559, limit 660); the reach budgets are unchanged.

Not included: the Lance index metadata scanner (`LANCE_INDEX_ENTRIES`);
the FE side, including the rolling-upgrade guard that keeps Lance lazy
materialization off while an old BE could decode a version 1 row
location as version 0; the regression suites; the rest of #68707
(searching historical versions, tags and branches, rejecting fragment
ids missing from the snapshot, naming the snapshot in errors and the
profile). The `InitReaderAvgTime` / `GetBlockAvgTime` profile fix that
#67005 carried goes in a separate PR.

**Results.**

| | master | with this PR |
|---|---|---|
| A `FORMAT_LANCE` query | fails before reading anything | read by
`LanceTableReader` in FileScannerV2 |
| A Lance row in the second phase of TopN lazy materialization | cannot
be represented | a version 1 row location, read back with `take_rows` |
| A row location of an unknown version or size in phase two | decoded as
version 0 | rejected with an error |
| An Arrow DATE32 day outside 0000-01-01..9999-12-31 (ADBC, Arrow stream
load, paimon-rust, Lance) | read as a non-null `0000-00-00` | the read
fails with `InvalidArgument` |

BE unit tests (ASAN, macOS arm64, against master's pinned lance-c), on
the head rebased onto master `378404eeb12`: 1029 cases in 54 suites run,
1027 pass and 2 Parquet microbenchmarks skip by design. They cover the
Lance suites (107: `LanceTableReader*` 83, `LanceNestedNullTest` 10,
`LanceRuntimeFilterHelperTest` 10, `LanceSessionManagerTest` 4); the
row-location protocol (`MaterializationSharedStateTest`,
`RowIdStorageReaderTest`, and the new `RowIdFetchRequestValidationTest`:
count mismatch, unknown version, a Lance version on an internal mapping,
an internal row id of 2^32); `FileScannerV2Test` (28); the ORC and
Parquet reader suites (`NewOrcReaderTest`, `NewParquetReaderTest`,
`ParquetScanTest` and the other `Parquet*` suites), whose row ids now go
through `file_local`; and the Arrow / protobuf / DATE serde suites with
the new `ArrowParentNullsTest`, plus the Iceberg and Parquet reader
suites that decode Arrow dates. Reverting any of the review fixes, the
#68813 flag, the #68707 split rule or the #68815 bounds makes its new
tests fail. The sixth review round adds 13 cases (`ArrowParentNullsTest`
10, `LanceTableReaderTypeTest` 3) and extends one; with them the Arrow
SerDe, Lance, ADBC and `IcebergV2ReaderTest` suites run 317 cases: 310
pass and the 7 ADBC SQLite cases skip without a local SQLite driver. The
ninth review round adds
`LanceRuntimeFilterHelperTest.KeepsInt64MinFiltersResidualOnly` and
`LanceTableReaderFilterTest.KeepsInt64MinRuntimeFiltersOutOfLanceScanner`:
both pass with the 106 Lance cases (`Lance*`) on the branch rebased onto
`339e087b11f`, and restoring `parse_int64()` in either check makes
exactly these two fail. On the head rebased onto master `315c2e00331`,
with the per-block mask fix (`42cf4e3e5d1`), 328 cases in 24 suites
pass: the Arrow SerDe and validation suites, `ArrowParentNullsTest`
(15), `LoadArrowPipeTest` (47), the DATETIMEV2 / TIMESTAMPTZ SerDe
suites, `ArrowColumnToDorisColumnTest`, `ArrowBlockConvertorTest`,
`AdbcReaderTest`, `RemoteDorisV2ReaderTest`, `PaimonRustTableReaderTest`
and the Lance suites. Allocating at the first NULL row of each call
again fails the new `ArrowParentNullsTest` case and the four new
`LoadArrowPipeTest` block cases, dropping the per-batch mask fails the
LIST and STRUCT block cases, and returning the child unmasked fails the
new timestamp case, four `ArrowParentNullsTest` cases and
`LanceTableReaderTypeTest.IgnoresDate32PayloadHiddenByNullParents`.

### Release note

Add nine `lance_*` BE configs and `lance_session_*` BE metrics. They
take effect once the FE can plan Lance scans. Reading an Arrow DATE32
value outside 0000-01-01..9999-12-31 through ADBC, Arrow stream load or
paimon-rust now fails instead of returning 0000-00-00.

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [x] Unit Test
- `run-be-ut.sh --run --filter=...` with the suites listed under
Results: 420 of 420 pass on macOS arm64 (ASAN) on the content before the
rebases, and the Lance and Arrow SerDe suites pass again with the
nested-offset, zero-field struct, hidden-child, hidden-Decimal256 and
compaction-mask fixes (the ADBC SQLite cases skip without a local SQLite
driver). Rebased onto master `43f9ceb48d7`: #69668 conflicted in the
scanner selection and in `fetch_table_schema`, which now hands every
file format to `format::fetch_file_schema()`, so the Lance branch runs
ahead of that call; #69646 added a TopN row-group test that reads the
version 0 row location fields, which now go through `file_local` (the
earlier rebase onto `5caaeb3e3d4` resolved #69614 and #69601 in the
scanner selection, the `FileFormat` enum, its test and the reach budget
table). The 95 TUs that this PR changes or that master changed since
`5caaeb3e3d4` were syntax-checked against the rebased tree with the UT
build flags, and CI runs the suites again. Rebased again onto master
`8d88f1cc6f7`: the only conflict was the budget table, where #65858
moved the `util/rle_encoding.h` baseline to 828, and the 163 TUs that
this PR changes or that master changed since `43f9ceb48d7` pass the same
syntax check. Rebased again onto master `339e087b11f`: the only conflict
was the budget table again, where #67292 moved the `util/rle_encoding.h`
baseline to 834; #69872 added Arrow type checks ahead of the NULL-parent
masking in the map and struct readers and merged cleanly. Of the 114
sources that this PR changes or that master changed since `8d88f1cc6f7`,
111 pass the same syntax check. The other three are master's: two new
#67292 files under `storage/segment` fail the same way on master alone,
since they compile only inside their unity batch, and this PR adds no
source to that target; the #69818 benchmark is not in the UT build and
includes only `util/simd` headers that this PR does not touch. Reverting
any of the review fixes, the #68813 flag, the #68707 split rule or the
#68815 bounds makes its new tests fail. Rebased again onto master
`378404eeb12`, which removed the legacy file scanner (#69723): the
conflicts were in the scanner-selection code and tests that #69723
deleted, so this PR's Lance lines there went with them (including its
`LanceQueriesAlwaysUseScannerV2` test), in the profile keys of
`materialization_opertor.cpp`, and in the row fetch of
`rowid_fetcher.cpp`, whose non-Lance path is now only
`FileScannerV2::read_by_rows`; the deleted V1 ORC / Parquet row id tests
took this PR's `file_local` rename with them, and the
`util/rle_encoding.h` budget commit is dropped because master is no
longer near that limit. Of the 100 sources that this PR changes or that
master changed since `339e087b11f`, 99 pass the same syntax check; the
other, `format_v2/orc/orc_reader.cpp`, fails the same way on master
alone. On the rebased head the suites listed under Results run 1029
cases: 1027 pass and 2 microbenchmarks skip. The test-utility fix that
`DataTypeDateTimeV2SerDeTest` needed on macOS (#69695) is now on master.
Rebased again onto master `315c2e00331`: the only conflict was
`TExternalSearchRequest` in `PlanNodes.thrift`, where #70075 had
reserved fields 2-5 in comments; the two commits that add the fields
replace those comments, and field 6 stays #70075's `paimon_options`.
#69717 cut transitive includes from shared headers: of the 160 sources
that this PR changes or that master changed since `378404eeb12`, 156
pass the same syntax check; the two `jemalloc_hook` tests have no
compile command on macOS, `runtime/memory/jemalloc_hook.cpp` uses glibc
aliases that macOS cannot build (#69819), and
`format_v2/table_reader.cpp` alone fails the same way on master alone
while its unity batch compiles. The full `doris_be_test` builds and
links on the rebased head; `ArrowParentNulls*` and `Lance*` (121 cases)
pass before the mask fix, and the 328 cases above with it.
- `build-support/check-build-hygiene.sh` (on this branch rebased onto
master `315c2e00331`), clang-format 16 and
`build-support/run-clang-tidy.sh` on the changed files: all pass; on the
changed lines clang-tidy (llvm 22) reports only
`readability-inconsistent-ifelse-braces` on the `DORIS_CHECK` lines of
the masking functions, the macro's expansion that master's existing
`DORIS_CHECK`s report too.
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- Behavior changed:
    - [ ] No.
- [x] Yes. `PRequestBlockDesc.row_id` is `uint64`; phase two of TopN
lazy materialization rejects row locations of an unknown version or
size; `FORMAT_LANCE` scans run on FileScannerV2; an Arrow DATE32 day
outside the Doris DATE range fails the read instead of becoming
`0000-00-00`.
- Does this need documentation?
    - [x] No. Lance is documented with the FE connector.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->

---------

Co-authored-by: zhangstar333 <zhangsida@selectdb.com>
Co-authored-by: Gabriel <liwenqiang@selectdb.com>
Co-authored-by: zhaobo wang <wangzhaobo957@gmail.com>
Co-authored-by: jay <qingfengyouchen@163.com>
Co-authored-by: FANNG <fanng@apache.org>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: zy-kkk <zhongyk10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants