feat(cubesql): Separate env var for non-streaming query max row limit - #11418
Conversation
|
Claude finished @ovr's task in 2m 50s —— View job Review: looks good to merge — 0 blocking, 1 medium, 3 lowFull review (click to expand)
SummaryThe change is small, correct, and fixes a genuine conflation: Verified all four readers pick the change up through the
No Node-side mirroring is needed (cubesql reads env directly in-process), and FindingsMedium — misconfiguration is fatal rather than harmless (inline, Because Low — default column requires two hops (inline, The table lists the default as Low — no test for the resolution order Nothing covers "override wins / falls back to Low —
Not an issue
I did not run |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Claude encountered an error after 24s —— View job I'll analyze this and get back to you. |
…ng cap exceeds it Addresses review on #11418: the cap is also injected into queries that carry no `LIMIT` of their own (`scan.rs:534-536`), so setting `CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT` above `CUBEJS_DB_QUERY_LIMIT` made the gateway reject those queries too, not just oversized ones — a hostile failure mode for an env var typo, since it surfaced per query with no hint at the cause. An override above `CUBEJS_DB_QUERY_LIMIT` is never useful, since the gateway rejects anything above it anyway, so it now falls back to that value and logs a warning once at startup. Both entry points install the logger before building the config (`cubesqld.rs:33-36`, `sql-server.ts:50` vs `:131`), so the warning is visible. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude encountered an error after 29s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 27s —— View job I'll analyze this and get back to you. |
|
Claude finished @ovr's task in 2m 29s —— View job Re-review after
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11418 +/- ##
==========================================
- Coverage 83.95% 79.43% -4.53%
==========================================
Files 257 480 +223
Lines 80877 98778 +17901
Branches 0 3636 +3636
==========================================
+ Hits 67904 78464 +10560
- Misses 12973 19796 +6823
- Partials 0 518 +518
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:
|
`CUBEJS_DB_QUERY_LIMIT` was read by two layers that mean different things by it: - the API gateway rejects non-streaming queries above it (`query.js:439-453`); - cubesql uses it as `non_streaming_query_max_row_limit`, which is both the clamp on one-shot queries *and* the threshold above which `CUBESQL_STREAM_MODE` switches a query to streaming (`scan.rs:524-536`, `wrapper.rs:912`). So raising it to allow large REST result sets also raises how many rows the SQL API materializes in a single batch (large one-shot responses then fail with `write: EPIPE`) and pushes the streaming threshold up, so queries that used to stream go one-shot instead. Excel hits the same clamp, since it goes through the non-streaming SQL API path. cubesql now resolves its cap from `CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT` first, falling back to `CUBEJS_DB_QUERY_LIMIT` and then to 50000, so the two can be tuned independently with no behavior change on upgrade: | `CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT` | `CUBEJS_DB_QUERY_LIMIT` | cubesql cap | | ------------------------------------------- | ----------------------- | ----------- | | unset | unset | 50000 | | unset | 500000 | 500000 | | 50000 | 500000 | 50000 |
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
…ng cap exceeds it Addresses review on #11418: the cap is also injected into queries that carry no `LIMIT` of their own (`scan.rs:534-536`), so setting `CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT` above `CUBEJS_DB_QUERY_LIMIT` made the gateway reject those queries too, not just oversized ones — a hostile failure mode for an env var typo, since it surfaced per query with no hint at the cause. An override above `CUBEJS_DB_QUERY_LIMIT` is never useful, since the gateway rejects anything above it anyway, so it now falls back to that value and logs a warning once at startup. Both entry points install the logger before building the config (`cubesqld.rs:33-36`, `sql-server.ts:50` vs `:131`), so the warning is visible. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
c2e287e to
cfdb3f5
Compare
|
Claude finished @ovr's task in 1m 33s —— View job Re-review after
|
CUBEJS_DB_QUERY_LIMITwas read by two layers, which mean different things by it:non_streaming_query_max_row_limit, which is both the clamp on one-shot queries and the threshold above whichCUBESQL_STREAM_MODEswitches a query to streaming