Skip to content

Conversation

@shauryachats
Copy link
Collaborator

@shauryachats shauryachats commented Dec 31, 2025

Summary

This PR enables the physical optimizer to work correctly with logical tables by making the physical planning and worker assignment logic aware of logical to physical table mappings.
The leaf-stage worker assignment is updated to resolve logical tables, compute routing across all underlying physical tables, and produce deterministic worker to segment assignments, while fragment metadata is extended to carry logical-table specific segment mappings.

Figuring out a way to assign distribution for a logical table still needs some investigation - hence will be picked up in a follow-up PR.

Testing

Adds integration coverage to validate that common query patterns work with logical tables under the physical optimizer. Also added unit tests.

@codecov-commenter
Copy link

codecov-commenter commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 62.85714% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.29%. Comparing base (042549d) to head (338608b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...al/v2/opt/rules/LeafStageWorkerAssignmentRule.java 60.46% 29 Missing and 5 partials ⚠️
...t/query/planner/physical/v2/TableScanMetadata.java 81.25% 2 Missing and 1 partial ⚠️
.../physical/v2/PlanFragmentAndMailboxAssignment.java 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17447      +/-   ##
============================================
- Coverage     63.34%   63.29%   -0.05%     
  Complexity     1474     1474              
============================================
  Files          3162     3162              
  Lines        188591   188693     +102     
  Branches      28857    28873      +16     
============================================
- Hits         119454   119434      -20     
- Misses        59891    59997     +106     
- Partials       9246     9262      +16     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 55.58% <62.85%> (-7.71%) ⬇️
java-21 63.24% <62.85%> (-0.03%) ⬇️
temurin 63.29% <62.85%> (-0.05%) ⬇️
unittests 63.29% <62.85%> (-0.05%) ⬇️
unittests1 55.60% <62.85%> (-0.01%) ⬇️
unittests2 34.01% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shauryachats shauryachats force-pushed the physical_opt_logical_table_latest branch from 4342a23 to 338608b Compare January 5, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants