From 77920621949f01fe2f2a67f1733f75b93ced2f40 Mon Sep 17 00:00:00 2001 From: stefanbaxter Date: Wed, 7 Oct 2026 17:06:03 +0200 Subject: [PATCH] Revert "fix(cubejs): build BigQuery rollups read-only" This reverts commit 87e08c9. Live on dev it regressed abler-web-prod: read-only downloads infer column types from the rows, so a decimal after integer-looking values fails the Cube Store upload ("Can't parse int"), and empty partitions cannot build at all. Adding readOnly to dbParams also changed the datasource's hash, and Cube Store dropped about 1,500 of its 2,198 rollup tables. Back to staging until read-only takes column types from BigQuery's schema. Co-Authored-By: Claude Opus 5.5 --- .../utils/__tests__/prepareDbParams.test.js | 19 ------------------- services/cubejs/src/utils/prepareDbParams.js | 2 -- 2 files changed, 21 deletions(-) delete mode 100644 services/cubejs/src/utils/__tests__/prepareDbParams.test.js diff --git a/services/cubejs/src/utils/__tests__/prepareDbParams.test.js b/services/cubejs/src/utils/__tests__/prepareDbParams.test.js deleted file mode 100644 index 1a953a76..00000000 --- a/services/cubejs/src/utils/__tests__/prepareDbParams.test.js +++ /dev/null @@ -1,19 +0,0 @@ -import assert from "node:assert/strict"; -import { createRequire } from "node:module"; -import { describe, it } from "node:test"; - -import prepareDbParams from "../prepareDbParams.js"; - -const require = createRequire(import.meta.url); - -describe("prepareDbParams", () => { - it("makes BigQuery drivers read-only, so rollups never write to the customer's project", () => { - const { BigQueryDriver } = require("@cubejs-backend/bigquery-driver"); - const params = prepareDbParams( - { projectId: "abler-web", keyFile: JSON.stringify({ client_email: "sa@abler-web.iam" }) }, - "bigquery", - ); - - assert.equal(new BigQueryDriver(params).readOnly(), true); - }); -}); diff --git a/services/cubejs/src/utils/prepareDbParams.js b/services/cubejs/src/utils/prepareDbParams.js index 49b428e6..d6e20d0a 100644 --- a/services/cubejs/src/utils/prepareDbParams.js +++ b/services/cubejs/src/utils/prepareDbParams.js @@ -58,8 +58,6 @@ const prepareDbParams = (dbParams, dbType) => { dbConfig = { ...dbConfig, credentials: { ...keyFile }, - // rollups load straight into Cube Store; no staging tables in the customer's project - readOnly: true, }; break; case "mssql":