docs(cubestore): add a reference page for Cube Store SQL commands - #11430
docs(cubestore): add a reference page for Cube Store SQL commands#11430igorlukanin wants to merge 4 commits into
Conversation
|
Claude finished @igorlukanin's task in 4m 8s —— View job Docs-only PR; core claims check out against the Rust source. 2 medium, 6 low — nothing blocking.Full review
What I verified against masterEvery substantive semantic claim on the page holds up:
The Nav placement in FindingsMedium
Low
Not checkedCouldn't run No prior review threads on this PR to dedupe against or resolve. |
|
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 2m 22s —— View job All 4 prior findings addressed and re-verified against the Rust source. 0 new issues — 2 nits, nothing blocking.Full re-review of
|
| # | Finding | Status |
|---|---|---|
| M1 | WIPE omits the Closed failure mode |
✅ Fixed — "If the teardown then fails to finish, the cachestore is left closed and rejects every operation until the node is restarted" (sql-commands.mdx:315-317) |
| M2 | DUMP filed under "only read state" |
✅ Fixed — tier blurb reworded to "don't change cluster state", DUMP gets its own <Warning> covering the disk write, the missing cleanup, and per-partition growth |
| L3 | QUEUE synopsis gaps |
✅ Fixed — all four sub-points landed |
| L4 | Unverifiable read-only-path claim | ◐ Reworded, still unverifiable in this repo (see below) |
| L6 | Stub links hopping twice | ✅ Fixed — :343 and :787 now point at [ref-cubestore-sql-commands] directly; {#explain-queries} anchor retained on the stub for inbound links |
| L7 | Over-broad scope wording | ✅ Fixed — "administrative commands" replaces "commands beyond SELECT" |
Re-verified against master
The QUEUE corrections are precise, including the parts that were easy to get subtly wrong:
| Claim | Source | ✓ |
|---|---|---|
QUEUE ADD … [EXTERNAL_ID 'id'] |
parser.rs:666 — "external_id" => …parse_literal_string() inside parse_sql_options! |
✓ |
QUEUE RESULT [EXTERNAL_ID 'id'] key — option before key |
parser.rs:774-782 parses external_id then parse_queue_key(); the synopsis order matches |
✓ |
QUEUE ACK key { result | NULL } |
parser.rs:686-690 — parse_keyword(Keyword::NULL) → None |
✓ |
QUEUE ADD options in any order |
parse_sql_options! loops until no option matches; test parse_queue_add_options_any_order |
✓ |
key is path or numeric id for exactly GET/ACK/CANCEL/HEARTBEAT/RESULT/RESULT_BLOCKING/MERGE_EXTRA |
those seven use parse_queue_key(); ADD and RETRIEVE use parse_identifier() and are correctly excluded from the list |
✓ |
DUMP writes a metastore backup + every Parquet file read, dir never reclaimed |
sql/mod.rs:523 TempDir::new_in(…).into_path(), :527 debug_dump, :535-540 loop over all_required_files() + tokio::fs::copy |
✓ |
DUMP "returns its path" |
:553-558 — single dump_path string column |
✓ |
WIPE leaves the store closed until restart |
cachestore/lazy.rs:420-441, drain-timeout bail at :498-505 |
✓ |
Getting the RETRIEVE/ADD exclusion right is the detail I'd have expected to slip.
Links also check out: [ref-cubestore-sql-commands] is defined at using-pre-aggregations.mdx:1195 → /reference/cubestore/sql-commands, [ref-cube-store-architecture] at sql-commands.mdx:344 → a page that exists, and the {#explain-queries} stub still resolves.
Nits
sql-commands.mdx:62-63— theDUMPcarve-out sits oddly next to the sentence above it. "That path only accepts read-only statements" followed by "AvoidDUMPthere — it isn't blocked" reads as a contradiction on first pass; a reader wonders how a command that writes to disk clears a read-only gate. Presumably the gate is syntactic (DUMPwraps aSELECT). One clause — "DUMPparses as a read, so it isn't blocked, but…" — would close the gap. Separately, the underlying read-only gating still has no counterpart in this repo (grepforcache-data-source gating inpackages/finds nothing), so it remains a cloud-platform claim I can't confirm here; you resolved that thread, so I'll assume you have.using-pre-aggregations.mdx:343-344— the soft wrap falls inside a code span:[use `EXPLAIN` and `EXPLAIN\nANALYZE`]. CommonMark collapses the newline to a space so it renders correctly, but it's a fragile place to wrap. Moving the break to before`EXPLAIN ANALYZE`costs nothing.
Still open outside this PR
parser.rs:511 still advertises INC in its error message and lazy.rs:427/:433 still log SYSTEM CACHESTORE WIPE — both confirmed present at HEAD. A reader who hits either string will conclude the docs are wrong. Out of scope for a docs PR, but worth a follow-up. Fix this →
Also: the PR description still cites "the inbound link from cube-core/architecture.mdx" — no such file exists under docs-mintlify/, and explain-queries appears only in using-pre-aggregations.mdx. Description-only inaccuracy; the anchor work itself is correct.
Not checked
docs.json JSON validation and the Mintlify build — node was blocked by the sandbox. The docs.json addition is a well-formed group object matching its siblings, and the Mintlify preview deployment reports 🟢 Ready.
All four of my prior threads were already resolved by the author before this run, so nothing to resolve and no duplicate inline comments to skip. No new inline comments — everything above is either a nit or out of scope.
|
Took 1–4, 6 and 7 in On 5 — On 8 — the |
|
Both nits taken in The Rust strings are worth folding into CORE-697 — same class, and that PR is already in the parser. The description note is stale: I corrected it before this run. |
|
Claude finished @igorlukanin's task in 47s —— View job Both nits from the last round are addressed; the new
|
2478b7f to
77bdedb
Compare
|
Claude finished @igorlukanin's task in 2m 14s —— View job Rebase-only synchronize — file contents are byte-identical to the commit I approved. 0 new issues, 1 optional nit.Full re-review of
|
| File | Blob |
|---|---|
reference/cubestore/sql-commands.mdx |
cbc00ae |
docs/pre-aggregations/using-pre-aggregations.mdx |
cd540f3 |
docs.json |
d66b74b |
Both previous-round fixes are intact — sql-commands.mdx:62-63 still carries "It wraps a SELECT, so it reads as a query and gets through", and using-pre-aggregations.mdx:343-345 still has `EXPLAIN ANALYZE` unbroken on one line. Nothing regressed in the rewrite.
Spot-checks I hadn't run before
Since the diff is unchanged, I used this pass to close two gaps from earlier rounds:
| Claim | Source | ✓ |
|---|---|---|
EXPLAIN ANALYZE DETAILED "actually executes the query under per-query tracing" |
sql/explain_detailed.rs:1-4 module doc says exactly that; :57-60 calls run_router_select_detailed on a real worker node |
✓ |
Link target /docs/pre-aggregations/cube-store-architecture resolves |
docs-mintlify/docs/pre-aggregations/cube-store-architecture.mdx exists |
✓ |
| No competing Cube Store nav group | cubestore appears exactly once in docs.json (:565) — no duplicate group to merge into |
✓ |
Nit (optional, non-blocking)
sql-commands.mdx:147-163 — EXPLAIN ANALYZE DETAILED is rejected for system-table selects: explain_detailed.rs:39-42 returns "EXPLAIN ANALYZE DETAILED is not supported for selects from system tables" on QueryPlan::Meta. Since information_schema.tables is documented two sections above on the same page, a reader may well try EXPLAIN ANALYZE DETAILED SELECT * FROM information_schema.tables first. One clause would cover it — plain EXPLAIN and EXPLAIN ANALYZE don't have this restriction, so the contrast is worth a half-sentence. Entirely up to you; not worth another round on its own.
Threads
All four of my prior threads are resolved (gh list-review-threads confirms isResolved: true on each). Nothing to resolve, nothing to re-affirm, no duplicate inline comments to skip. No new inline comments posted.
Still open outside this PR
Unchanged and correctly deferred to CORE-697: parser.rs:511 advertises INC, lazy.rs:427/:433 log SYSTEM CACHESTORE WIPE.
Not checked
docs.json JSON validation and the Mintlify build — both node and python3 invocations were blocked by the sandbox this run. The docs.json hunk is a well-formed group object matching its siblings and is byte-identical to the version the Mintlify preview already built 🟢.
|
Took the nit: |
|
Claude finished @igorlukanin's task in 1m 18s —— View job One factual error in the new commit:
|
| Command | System-table select |
|---|---|
EXPLAIN |
✅ returns the logical plan (mod.rs:656-663) |
EXPLAIN ANALYZE |
❌ "EXPLAIN ANALYZE is not supported for selects from system tables" (mod.rs:664-668) |
EXPLAIN ANALYZE DETAILED |
❌ "…DETAILED is not supported…" (explain_detailed.rs:39-42) |
Plain EXPLAIN is the only one of the three that works. A reader who follows the sentence to EXPLAIN ANALYZE SELECT * FROM information_schema.tables gets an error — the exact failure the sentence was added to prevent.
This traces directly to my nit last round, which asserted "plain EXPLAIN and EXPLAIN ANALYZE don't have this restriction." I checked the DETAILED path and stopped there without reading the Meta arm of explain(). The correction belongs on my side.
Secondary: the stated reason is off by a step. The rejection fires in the router before any worker is involved — logical_plan returns QueryPlan::Meta, so there's no serialized plan to route. "Because it runs the query on a worker" is a fair gloss for DETAILED alone, but it can't explain why EXPLAIN ANALYZE — which does dispatch to workers — is refused too. "System-table selects don't produce a distributable plan" covers both cases. Suggested replacement is on the inline thread.
Everything else
Unchanged from 77bdedb, which I'd already verified. The two files this commit doesn't touch are byte-identical, and all previously confirmed claims (the CLEAR/TRUNCATE/WIPE distinction, the QUEUE synopsis including the RETRIEVE/ADD exclusion, DUMP's disk writes and read-only-gate carve-out, SYS subcommand completeness) still hold.
Threads
All four of my prior threads are resolved (isResolved: true on each) — nothing to resolve, and the new comment is on a line no existing thread covers, so no dedupe skip.
Still open outside this PR
Unchanged and correctly deferred to CORE-697: parser.rs:511 advertises INC, lazy.rs:427/:433 log SYSTEM CACHESTORE WIPE.
Not checked
docs.json JSON validation and the Mintlify build — node is blocked by the sandbox. This commit touches only sql-commands.mdx.
69e0bd0 to
1892050
Compare
|
Claude finished @igorlukanin's task in 51s —— View job The rewritten sentence is correct against the source; my prior finding is resolved. 0 new issues — LGTM, 1 optional nit.Full re-review of
|
| Claim | Source | ✓ |
|---|---|---|
EXPLAIN ANALYZE rejects system-table selects |
sql/mod.rs:664-668 — QueryPlan::Meta + analyze → "EXPLAIN ANALYZE is not supported for selects from system tables" |
✓ |
EXPLAIN ANALYZE DETAILED rejects them |
explain_detailed.rs:38-43 — QueryPlan::Meta(_) => return Err(…) |
✓ |
Plain EXPLAIN is the only one that works |
mod.rs:655-663 — if !analyze returns the logical plan |
✓ |
| Reason: no distributable plan | logical_plan yields Meta, so there's no serialized.to_serialized_plan() to route; the refusal is in the router, before any worker |
✓ |
The reason now covers both commands rather than only DETAILED — that was the part of the previous wording that couldn't be made to work, and the new framing fixes it at the root instead of patching the command list.
Everything else on the page is byte-identical to 77bdedb, which I'd already verified end to end (the CLEAR/TRUNCATE/WIPE distinction, the QUEUE synopsis including the RETRIEVE/ADD exclusion from parse_queue_key, DUMP's disk writes and its read-only-gate carve-out, SYS subcommand completeness, SYS-not-SYSTEM, CACHE INCR).
Nit (optional, non-blocking)
The note sits at the end of the ### EXPLAIN ANALYZE DETAILED section but constrains EXPLAIN ANALYZE too. A reader who scrolls to ### EXPLAIN ANALYZE, gets their answer, and stops never sees it. Half a sentence in the EXPLAIN ANALYZE section, or hoisting the note up under ## Diagnostics where it governs all three, would close that. Not worth another round on its own — the content is right either way.
Threads
All five of my threads are resolved (isResolved: true on each), including the one from last round, which is now isOutdated as well since the line was rewritten. Nothing to resolve, no duplicate inline comments to skip, no new inline comments posted.
Still open outside this PR
Unchanged and correctly deferred to CORE-697: parser.rs:511 advertises INC, lazy.rs:427/:433 log SYSTEM CACHESTORE WIPE.
Not checked
docs.json JSON validation and the Mintlify build — node is blocked by the sandbox. This commit touches only sql-commands.mdx; docs.json is unchanged from the version the preview already built 🟢.
1892050 to
4f7613f
Compare
|
Fair point — someone who stops at |
|
Claude finished @igorlukanin's task in 50s —— View job The note moved into the
|
| Claim | Source | ✓ |
|---|---|---|
EXPLAIN ANALYZE rejects system-table selects |
sql/mod.rs:654-670 — QueryPlan::Meta + analyze → "EXPLAIN ANALYZE is not supported for selects from system tables" |
✓ |
EXPLAIN ANALYZE DETAILED rejects them |
explain_detailed.rs:38-43 — QueryPlan::Meta(_) => return Err(…) |
✓ |
Plain EXPLAIN is the only one that works |
mod.rs:655-663 — if !analyze returns the logical plan |
✓ |
| Reason: no distributable plan | logical_plan yields Meta, so there's no serialized.to_serialized_plan() to route; both refusals are in the router |
✓ |
Everything else on the page is byte-identical to 77bdedb, which I'd already verified end to end: the CLEAR / TRUNCATE / WIPE distinction, the QUEUE synopsis including the RETRIEVE/ADD exclusion from parse_queue_key, DUMP's disk writes and its read-only-gate carve-out, SYS subcommand completeness, SYS-not-SYSTEM, and CACHE INCR.
Threads
All five of my threads are resolved (isResolved: true on each; the last one is isOutdated too, since the line was rewritten). Nothing to resolve, no duplicate inline comments to skip, no new inline comments posted.
Still open outside this PR
Unchanged and correctly deferred to CORE-697: parser.rs:511 advertises INC, and lazy.rs:427/:433 log SYSTEM CACHESTORE WIPE.
Not checked
docs.json JSON validation and the Mintlify build — node is blocked by the sandbox. This commit touches only sql-commands.mdx; docs.json is unchanged from the version the preview already built 🟢.
Cube Store has admin and recovery SQL commands but no page documenting any of them. This adds one, and moves the existing
EXPLAINmaterial onto it so the commands live in a single place.What's here
A new
reference/cubestore/sql-commandspage covering the whole command surface, grouped by how dangerous it is:information_schema.tables,EXPLAIN,EXPLAIN ANALYZE,EXPLAIN ANALYZE DETAILED,DUMP, plus the guidance on reading a query plan.CACHEandQUEUEfamilies.SYS METASTORE,SYS CACHESTORE, and the remainingSYScommands.Everything outside the diagnostics tier carries a warning. The names don't tell you what these do, so the page spells out the distinctions:
CACHE CLEAR/QUEUE CLEARiterate and delete rows logically.SYS METASTORE TRUNCATE/SYS CACHESTORE TRUNCATEdo a single low-level RocksDB range delete with no per-row reads — which is why they still work when the store is too stuck to iterate.SYS CACHESTORE WIPEdestroys and reopens RocksDB; past the teardown the previous state is gone, and a teardown that then fails leaves the cachestore closed until the node restarts.DUMPsits in the diagnostics tier but writes to the router's local disk, and the directory it creates is never reclaimed — called out separately so "safe to run" doesn't read as "free".Two corrections while writing it
SYS, notSYSTEM— there's noSYSTEMalias, soSYSTEM CACHESTORE WIPEisn't a real command.CACHE INCR. The parser's own error message advertisesINC, which is wrong; documented the keyword that actually works.The existing
EXPLAINsectionMoved to the new page rather than duplicated.
using-pre-aggregations.mdxkeeps the connection recipe andinformation_schema.tables, and its### EXPLAIN queriesheading stays with an explicit{#explain-queries}anchor so any external inbound links keep working. The two same-page links now point at the new page directly rather than hopping through the stub.Verified
mintlify broken-links --check-anchorsreports nothing from these changes (the 16 it finds are pre-existing inembedding/iframe/, tracked separately). Both pages render locally and the moved content is intact.Command surface and semantics checked against
rust/cubestore/cubestore/src/sql/parser.rs,sql/mod.rs,metastore/rocks_store.rs, andcachestore/lazy.rsat master.