feat(tesseract): Support separate pre-aggregations for different multi-stage subqueries#10684
feat(tesseract): Support separate pre-aggregations for different multi-stage subqueries#10684waralexrom wants to merge 18 commits intomasterfrom
Conversation
|
Claude finished @waralexrom's task in 5m 17s —— View job Code Review: PR #10684 — Support separate pre-aggregations for different multi-stage subqueries
SummaryThis PR enables Tesseract's multi-stage query engine to use different pre-aggregations for different subqueries within the same top-level query. Previously, all multi-stage leaf measures had to match a single pre-aggregation, or the entire optimization was skipped. Now each leaf measure can independently match its own pre-aggregation, and the system generates unique table placeholders ( The change spans three layers:
Code QualityStrengths:
Concerns:
SecurityNo security concerns identified. The changes are internal to the query planning pipeline and don't introduce any new external inputs, SQL injection vectors, or authentication/authorization changes. Performance
No performance bottlenecks identified. TestingCoverage is good for the happy path:
Potential gaps:
DocumentationThe PR doesn't include documentation updates. Since this is an internal planner optimization that doesn't change any user-facing API or configuration, that's acceptable. The code comments explaining the rollback logic and backward-compat choices are helpful. Overall AssessmentThis is a well-structured feature that enables an important optimization for multi-stage queries. The architecture (usage indices, placeholder suffixes, grouped usage info) is clean and extensible. The backward-compatibility strategy is sound. The main areas for improvement are: (1) adding tests for the rollback/failure path, (2) clarifying the |
rust/cubesqlplanner/cubesqlplanner/src/logical_plan/optimizers/pre_aggregation/optimizer.rs
Show resolved
Hide resolved
rust/cubesqlplanner/cubesqlplanner/src/logical_plan/optimizers/pre_aggregation/optimizer.rs
Show resolved
Hide resolved
packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts
Outdated
Show resolved
Hide resolved
packages/cubejs-query-orchestrator/src/orchestrator/PreAggregationPartitionRangeLoader.ts
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #10684 +/- ##
===========================================
+ Coverage 57.84% 78.79% +20.95%
===========================================
Files 215 465 +250
Lines 16609 91962 +75353
Branches 3336 3363 +27
===========================================
+ Hits 9607 72461 +62854
- Misses 6514 19010 +12496
- Partials 488 491 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Check List