cube icon indicating copy to clipboard operation
cube copied to clipboard

How to get a real table name for `external: false` pre-aggregations?

Open pnedelko opened this issue 2 months ago • 0 comments

Problem I created a pre-aggregation with the flag external: false and would like to get an SQL query, which I could run myself (in BigQuery).

Unfortunately Cube.js playground and cubeApi.sql() return an SQL query with a table, that doesn't exist.

Cube.js returns table: dev_pre_aggregations.hubspot_companies_preaggtest But the real table name in BigQuery: dev_pre_aggregations.hubspot_companies_preaggtest_uzm0qrjf_ecn5d0k1_1khj9ae

Question: How to get the real table name through the Cube.js API?

Related Cube.js generated SQL

SELECT
  `hubspot_companies__id` `hubspot_companies__id`,
  `hubspot_companies__properties_name` `hubspot_companies__properties_name`
FROM
  dev_pre_aggregations.hubspot_companies_preaggtest AS `hubspot_companies__preaggtest`
GROUP BY
  1,
  2
ORDER BY
  1 ASC
LIMIT
  10000

pnedelko avatar Nov 16 '25 11:11 pnedelko