Repository navigation
fix(cubejs): BigQuery rollups read-only; failed rollup downloads no longer crash the refresh worker - #88
Merged
Conversation
Cube already wraps a cube's sql as a subquery, so an extra SELECT * FROM (...) only adds a layer. On ClickHouse, a map key read in a member over a SELECT * subquery reads the whole map (293 MiB vs 28 MiB measured on cst.semantic_events); extract keys in the SELECT that reads the table. Refresh cadence should follow data arrival; Cube 1.7 rejects incremental/update_window next to refresh_key.sql. Cube Store rejects Nullable(Bool) rollup columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…worker Cube 1.7.30 pipes the BigQuery query stream into its row stream, and the pre-aggregation loader pipes that into a LargeStreamWarning; pipe() never forwards errors. A "Not found: Table" from one tenant's staging table became an uncaughtException, the process guard exited, and every team's in-flight rollup builds died with it (33 restarts in under four days). Two postinstall patches forward the errors so they reach the upload pipeline, which already fails just that build. The regression test runs the loader's real download path and failed with the uncaughtException before the patches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without readOnly, Cube stages every rollup partition as a table in the customer's BigQuery project before loading it into Cube Store. abler-web's service account may not create that dataset, so none of its rollups ever built; abler-web-prod's staging tables went missing mid-build. Read-only runs the rollup query and loads the result straight into Cube Store. Table versions do not depend on readOnly, so existing rollups stay current. Each partition's result is held in worker memory; Abler's largest is 54,796 rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acmeguy
force-pushed
the
fix/bigquery-readonly-preaggs
branch
from
October 7, 2026 14:39
eb3ad17 to
87e08c9
Compare
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The refresh worker restarted 33 times in under four days. Each crash stopped rollup builds for every team. The cause was one tenant's BigQuery rollups (Abler):
bigquery.datasets.create), so none of its rollups ever built.pipe()calls that never forward errors, so a "Not found: Table" became anuncaughtException, and the process guard exits on those.What
prepareDbParams). Cube runs the rollup query and loads the result straight into Cube Store, with no staging tables in the customer's project.readOnly, so existing Cube Store tables stay current and nothing mass-rebuilds.stream(), the other the loader'sLargeStreamWarningwrap at both of its sites. A failed download now fails only that build.Nullable(Bool)limit.Tests
cube17Regression): the test runs the real BigQuery driver throughPreAggregationLoader.getTableDataWithTempTable. Before the patches it failed withuncaughtException; with them it is a handled rejection.prepareDbParams): a BigQuery driver built from the prepared settings reportsreadOnly().Rollout
After merge, restart
synmetrix-cubejsandsynmetrix-cubejs-refresh-workertogether, so the API and the worker hash the BigQuery datasource the same way. Then watch:🤖 Generated with Claude Code