You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Support external rollups from readonly source (#395)
* Add downloadQueryResults & readOnly to base driver
* Support including field type info in pg driver
* Add support for download-only refresh strategy
* Fix linting
* Fix missing parameter
* Describe both the create table and select query
* Use correct sql
* Update docs
* Address review feedback
Copy file name to clipboardExpand all lines: docs/Schema/pre-aggregations.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ cube(`Orders`, {
97
97
sql:`amount`,
98
98
type:`sum`
99
99
},
100
-
100
+
101
101
averageRevenue: {
102
102
sql:`${revenue} / ${count}`,
103
103
type:`number`
@@ -271,6 +271,28 @@ cube(`Orders`, {
271
271
In order to make external pre-aggregations work you should set
272
272
[externalDriverFactory](@cubejs-backend-server-core#external-driver-factory) and [externalDbType](@cubejs-backend-server-core#external-db-type) params while creating your server instance.
273
273
274
+
Note that by default, Cube.js materializes the pre-aggregration query results as new tables in the source database. For external pre-aggregations, these source tables are temporary - once downloaded and uploaded to the external database, they are cleaned-up.
275
+
276
+
However, it may not be possible to stage pre-aggregation query results in materialized tables in the source database like this - for example, if the driver doesn't support it, or if your source database is read-only. To fallback to a strategy where the pre-aggreation query results are downloaded without first being materialized, set the `readOnly` param of [driverFactory](@cubejs-backend-server-core#driver-factory) in your configuration:
0 commit comments