[improvement](fe) Reuse external scan tasks within a statement - #66530
[improvement](fe) Reuse external scan tasks within a statement#66530924060929 wants to merge 1 commit into
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
141fd94 to
cc165ac
Compare
|
run buildall |
495ee54 to
ab618f7
Compare
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 29000 ms |
TPC-DS: Total hot run time: 166728 ms |
ClickBench: Total hot run time: 23.96 s |
|
run buildall |
|
/review |
|
Codex automated review failed and did not complete. Error: All Codex review accounts are usage-limited; earliest retry is 2026-08-08T03:32:00Z. Please trigger /review again after that time. |
ab618f7 to
02b8284
Compare
|
run buildall |
|
/review |
|
Codex automated review failed and did not complete. Error: All Codex review accounts are usage-limited; earliest retry is 2026-08-08T03:32:00Z. Please trigger /review again after that time. |
Replace string-encoded cache keys with typed key classes that use
Java's equals/hashCode for comparison. All ConnectorExpression
implementations already carry structural equals, so every key field
— filter conjuncts, partition lists, option maps, file scopes — is
stored as its natural Java type (List, Map, ConnectorExpression)
rather than an encoded String.
Changes:
- ConnectorStatementScope SPI: computeIfAbsent(String) -> (Object)
- 4 connector ScanReuseKey classes: add equals/hashCode, use raw types
- ConnectorScanKeyUtils: canonicalize only filter flattening
- Remove String.join(",") aliasing bugs (4 sites)
- Deduplicate canonicalFilter/stableMapToString helpers
- Update all ConnectorStatementScope implementations for new signature
- Fix ConnectorStatementScopeImpl javadoc for re-entrancy contract
The rewrite replaces the fe-core ExternalScanTaskCache prototype
(branch fix/cir-21262-iceberg-split-reuse) with the connector-SPI
approach already on master-test, eliminating ~400 lines of duplicate
infrastructure.
02b8284 to
a008699
Compare
|
run buildall |
TPC-H: Total hot run time: 28767 ms |
TPC-DS: Total hot run time: 159489 ms |
ClickBench: Total hot run time: 23.88 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
Queries with repeated equivalent external-table relations independently plan the same remote files for every branch, duplicating connector metadata work. The connector SPI already provides statement-scoped memoization (ConnectorStatementScope) for metadata, but scan planning was not memoized — each duplicate relation re-planned through the connector SDK.
This change adds statement-scoped scan reuse to all four connectors. Each builds a typed key from the facts that affect its split set:
Equivalent scans reuse connector-native tasks within one statement execution. Iceberg streaming/lazy batch paths and transactional Hive paths remain uncached to preserve their memory and transaction semantics. Mutable Hudi/Hive scheduling objects are copied before use. ConnectorStatementScope.computeIfAbsent is widened from String to Object to accept typed keys directly.
Release note
Reuse equivalent Iceberg, Paimon, Hudi, and Hive scan-planning results within one statement execution.
Check List (For Author)