Open
Description
Describe the bug
you can't use original sql pre-aggregation and join to some non-aggregated data. When you try to, Cube attempts to join with the main, analytics database and the pre-agg database (which could be external).
To Reproduce
SELECT date_trunc('day', (cast("t1".report_date AS TIMESTAMP)::timestamptz AT TIME ZONE 'UTC')) "t1__report_date_day",
sum("t1".sales) "t1__sales"
FROM ananlytics_db.t1 AS "t1"
LEFT JOIN stb_pre_aggregations_dev.companies_main_rc4lezhz_aljrstgp_1fnp97r AS "companies" ON "t1".company_id = "companies".id
WHERE (cast("t1".report_date AS TIMESTAMP) > $1::timestamptz)
AND ("companies".company_id = $2)
GROUP BY 1
ORDER BY 1 DESC LIMIT 10000
ERROR: relation "ananlytics_db.t1" does not exist
Expected behavior
Throw a warning with a descriptive message, not try to perform a query in the preagg db that will throw an exception.
Version:
0.20.12