File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
cubejs-server-core/src/core Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ declare module '@cubejs-client/core' {
151151 measureToLeafMeasures ?: Record < string , LeafMeasure [ ] > ;
152152 } ;
153153
154- export type PreAggregationType = 'rollup' | 'rollupJoin' | 'originalSql' ;
154+ export type PreAggregationType = 'rollup' | 'rollupJoin' | 'rollupLambda' | ' originalSql';
155155
156156 type UsedPreAggregation = {
157157 targetTableName : string ;
Original file line number Diff line number Diff line change @@ -302,9 +302,10 @@ export class RefreshScheduler {
302302 const { timezones } = queryingOptions ;
303303 const { partitions : partitionsFilter , cacheOnly } = preAggregationsQueryingOptions [ preAggregation . id ] || { } ;
304304
305- const isRollupJoin = preAggregation ?. preAggregation ?. type === 'rollupJoin' ;
305+ const type = preAggregation ?. preAggregation ?. type ;
306+ const isEphemeralPreAggregation = type === 'rollupJoin' || type === 'rollupLambda' ;
306307
307- const queriesForPreAggregation : RefreshQueries [ ] = ! isRollupJoin && ( await Promise . all (
308+ const queriesForPreAggregation : RefreshQueries [ ] = ! isEphemeralPreAggregation && ( await Promise . all (
308309 timezones . map ( async timezone => this . refreshQueriesForPreAggregation (
309310 context ,
310311 compilerApi ,
Original file line number Diff line number Diff line change 11import R from 'ramda' ;
22import { StartedTestContainer } from 'testcontainers' ;
33import { pausePromise } from '@cubejs-backend/shared' ;
4+ import fetch from 'node-fetch' ;
45import { PostgresDBRunner } from '@cubejs-backend/testing-shared' ;
56import cubejs , { CubejsApi , Query } from '@cubejs-client/core' ;
67// eslint-disable-next-line import/no-extraneous-dependencies
@@ -278,4 +279,15 @@ describe('lambda', () => {
278279 await runScheduledRefresh ( client ) ;
279280 await checkCubestoreState ( cubestore ) ;
280281 } ) ;
282+
283+ it ( 'Pre-aggregations API' , async ( ) => {
284+ const preAggs = await fetch ( `${ birdbox . configuration . playgroundUrl } /cubejs-system/v1/pre-aggregations` , {
285+ method : 'GET' ,
286+ headers : {
287+ Authorization : ''
288+ } ,
289+ } ) ;
290+ console . log ( await preAggs . json ( ) ) ;
291+ expect ( preAggs . status ) . toBe ( 200 ) ;
292+ } ) ;
281293} ) ;
You can’t perform that action at this time.
0 commit comments