docs(sql-api): correct stale claim that CASE expressions can't be pushed down - #11385
Conversation
|
Claude finished @igorlukanin's task in 2m 3s —— View job Review: docs-only correction, well-targeted — 1 medium, 3 lowThe core claim is right and the fix is a real improvement: the old "won't work / not possible to translate 4 inline comments posted. Nothing blocking. Full review — findings, verification notes, and task listFindings
Structural note (not filed inline)Lines 143–197 sit under What checks out
Not independently verifiedI did not stand up a Cube instance, so the runtime claims in your test plan (both queries executing, the Task list
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Claude finished @igorlukanin's task in 1m 2s —— View job Review complete — docs-only, accurate on the main claim; 4 prior threads still apply (0 high, 1 medium, 3 low)Full review
VerdictThe central correction is right. Link references check out: The second commit's additions read well — "or if the data source doesn't support pushing down one of the expressions used" correctly widens the failure surface, and "applied as post-processing on top of the cube query" is a more accurate framing than the old "not part of the SQL query that being rewritten". Re-affirmed prior threadsThe file is unchanged (blob
Not applicableSecurity, performance, and test-coverage dimensions are moot here — no runtime code changed, and there's no test surface for prose. The author's manual verification against v1.7.4 with pushdown on and off is the right validation for this change; I did not re-run it (no Cube instance in this environment). |
|
Claude finished @igorlukanin's task in 56s —— View job Re-review after push — all 4 prior findings addressed; nothing new blocking (0 high, 0 medium, 1 low)Full review — verification, resolved threads, one optional refinement
Prior findings — all fixed
All four threads resolved on my side. No human-reviewer threads were touched. Still checks out
One optional refinement (low, non-blocking)The caveat I suggested — "group the inner query by the same granularity you need in the output" — is sound in general but doesn't fully resolve this page's own example. Fiscal year isn't expressible as a regular-query granularity (
Entirely your call — the current text isn't wrong, just leaves that dead end implicit. Not independently verifiedI did not stand up a Cube instance, so the runtime claims (both queries executing, the |
7e8eab6 to
ed2ff99
Compare
|
Claude finished @igorlukanin's task in 54s —— View job Re-review after push — no content change since the last pass; nothing blocking (0 high, 0 medium, 0 new low)Full review — verification, prior threads, one still-open optional refinement
What changedNothing in the content. HEAD is still Re-verified against the current tree
Docs-only — no runtime code, so security, performance, and test-coverage dimensions have no surface here. Style still matches Prior threadsAll four of my earlier threads are already resolved on the PR; none were re-opened by this push, and I created no new inline comments (nothing new to raise). No human-reviewer threads touched. One optional refinement, still open (low, non-blocking)Carried over from the last pass, unaddressed and entirely your call. The additive caveat tells a reader with a
Not independently verifiedI did not stand up a Cube instance, so the runtime claims (both queries executing, the • branch |
|
Claude finished @igorlukanin's task in 44s —— View job Re-review after push — the last open refinement is now closed; nothing blocking (0 high, 0 medium, 0 low)Full review — what changed, verification, thread status
What changedOne new commit on top of the previously reviewed state:
That closes the dead end the additive caveat left implicit — a reader with a With that, I have no open findings on this PR. Re-verified against the current tree
Core claim still holds against the source: Docs-only. No runtime code, so security, performance, and test-coverage dimensions have no surface here. Style matches Prior threadsAll four of my earlier threads are resolved; none were re-opened by this push, and I created no new inline comments — nothing new to raise. No human-reviewer threads touched. Not independently verifiedI did not stand up a Cube instance, so the runtime claims (both queries executing, the • branch |
|
Took the optional refinement in |
Summary
CASEexpression "won't work" and that "it is not possible to translateCASEexpressions in measures". That has been stale since query pushdown was enabled by default (feat: EnableCUBESQL_SQL_PUSH_DOWNby default #8814, v1.0.0). Both the example the page called impossible and itsMAX(CASE ...)variant execute correctly today.CASE/EXTRACTand grouped withMEASURE()— and documented the actual failure modes forCan't detect Cube query and it may be not supported yet: query pushdown disabled viaCUBESQL_SQL_PUSH_DOWN, or a data source that doesn't support pushing down one of the expressions used.DATE_TRUNCgranularity instead ofEXTRACT, so it stays a regular-query shape; anEXTRACT-based inner query itself needs pushdown and so is useless in the exact configuration the workaround is offered for.The failure is not specific to combining
MEASUREwith an expression — aCASE/EXTRACTquery with no measure at all fails identically when pushdown is off. The boundary is that any expression over a dimension requires the pushdown wrapper. This matches the code: the error is raised inrewrite/converter.rsgated only on!wrapped, and the rules owningwrapper/case.rs/wrapper/extract.rsare registered only whensql_push_downis enabled (rewrite/rewriter.rs).Support is also driver-dependent:
expressions/extractis added per-driver (PostgresQuery.ts) rather than inBaseQuery.js, so a data source without that template can hit the same error even with pushdown enabled. The page now says so instead of implying the behavior is universal.Docs-only; no runtime code changes.
Test plan
Verified against Cube v1.7.4 with Postgres, on a minimal
orderscube:EXPLAINshowsCubeScanWrappedSqlwithEXTRACTpushed to the datasourceCUBESQL_SQL_PUSH_DOWN=false, it reproduces the documented error verbatimCUBEJS_TESSERACT_SQL_PLANNER=false), so the planner is not a factorCASEin aWHEREclause andMEASUREnested inside aCASEboth workmintlify broken-links --check-anchorsreports no new broken links (the 16 reported are pre-existing inembedding/iframe/, untouched here);docs.jsonstill valid