fix(cubesql): Allow SQL pushdown for views spanning several data sources - #11802
Conversation
4e58650 to
d65cd19
Compare
|
Claude finished @MazterQyou's task in 4m 45s —— View job Review: approach is sound; 0 blocking, 1 test-coverage gap, 3 nits (4 inline comments)Full review
What the change does
CorrectnessThe safety argument holds up. I traced every consumer of the bound during rewrite: Two things I checked and consider fine:
Findings
Testing / CIRust CI was still running when I looked; I did not build locally (a cubesql Security / performanceNothing security-relevant: no new input parsing, no auth path touched. Performance-wise the extra allocation is a small |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11802 +/- ##
==========================================
- Coverage 84.67% 80.30% -4.37%
==========================================
Files 261 500 +239
Lines 86648 106354 +19706
Branches 0 3886 +3886
==========================================
+ Hits 73366 85409 +12043
- Misses 13282 20395 +7113
- Partials 0 550 +550
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d65cd19 to
7e2c340
Compare
|
Claude finished @MazterQyou's task in 2m 22s —— View job Re-review after force-push: all 4 prior findings addressed; 0 blocking, 1 nit (1 inline comment)Full review
Prior roundAll four are addressed; I resolved the threads.
Re-check of the coreNothing regressed in the rewrite. I re-traced every Two behavior-preserving details worth confirming rather than flagging:
The Findings
One thing I looked at and decided not to file: a Testing / CIRust CI was still in progress when I looked (Build, Build native, Drivers tests all Security / performanceUnchanged from last round: no new input parsing, no auth path touched, one small |
7e2c340 to
22b7d4e
Compare
|
Claude finished @MazterQyou's task in 1m 12s —— View job Re-review after push: last nit addressed, nothing new — 0 findings, no inline commentsFull review
Prior roundThe one open nit is addressed; I resolved the thread. let wrapped = logical_plan.find_cube_scan_wrapped_sql_deep();
assert!(!wrapped.wrapped_sql.sql.contains("OVER"), ...);
let measures = wrapped.request.measures.expect(...);
assert!(measures.len() == 1 && measures[0].contains("PatchMeasure"), ...);That reads better than my suggestion did: it pins both halves of the shape — the window function stayed above the wrapper, and the filtered measure below it still went to Cube — rather than only the absence of Re-check of the coreThis push is the previous diff plus that test change; the rewrite side is byte-identical to what I reviewed last round, and I re-confirmed the invariants rather than assuming them:
Two standing observations, neither a finding on this PR:
TestingSeven tests now cover the change: Comments / docsThe Security / performanceUnchanged: no new input parsing, no auth path touched, one small |
22b7d4e to
dd86d54
Compare
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
1 similar comment
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude finished @MazterQyou's task in 5m 0s —— View job Re-review after redesign: approach is sound — 0 blocking, 1 test-coverage gap, 3 low/nits (4 inline comments)Full review
What changed since my last reviewThis is a different design, not an increment. I like this considerably better than the CorrectnessI traced the gate for completeness, since an ungated path would put a foreign member into a bound context and turn a working plain scan into a hard
Behaviour-preserving details I checked rather than flagged: hoisting Findings
Testing / CI
Nine tests cover the change: Security / performanceNo new input parsing, no auth path touched. The multi-transform is the real cost: a scan over an N-source view is now explored under N contexts instead of not being wrapped at all, and members that do not fit stop each one early — the bound the PR description states, and the added tests confirm the cross-source shapes terminate in a plain scan rather than exploding. |
Signed-off-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com>
dd86d54 to
498a40a
Compare
|
Claude finished @MazterQyou's task in 2m 20s —— View job Re-review after push: all 4 prior findings addressed, nothing new — 0 findings, no inline commentsFull review
Prior roundAll four are addressed; I resolved the threads.
Re-check of the coreThe rewrite side is otherwise the diff I reviewed last round, and I re-confirmed the invariants rather than assuming them:
Worth noting the design now matches the repo's own rewrite guidance ( Testing / CINine tests cover the change: CI for this push was queued/in progress when I looked (Rust, Build, Build native, Drivers tests), no failures yet; the previous revision's Security / performanceUnchanged: no new input parsing, no auth path touched. The multi-transform remains the real cost — an N-source view is explored under N contexts — and hoisting |
Check List
Description of Changes Made
This PR allows SQL pushdown for queries over views whose cubes span several data sources, giving such a scan one wrapper context per data source it reaches and pushing a member only into the context of its own data source, so a pushed down select completes only when everything it references shares one.
Notes