Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/cubejs-api-gateway/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ class ApiGateway {
app.get('/cubejs-system/v1/pre-aggregations', systemMiddlewares, systemAsyncHandler(async (req, res) => {
await this.getPreAggregations({
cacheOnly: !!req.query.cacheOnly,
metaOnly: !!req.query.metaOnly,
context: req.context,
res: this.resToResultFn(res)
});
Expand Down Expand Up @@ -619,7 +620,7 @@ class ApiGateway {
}
}

public async getPreAggregations({ cacheOnly, context, res }: { cacheOnly?: boolean, context: RequestContext, res: ResponseResultFn }) {
public async getPreAggregations({ cacheOnly, metaOnly, context, res }: { cacheOnly?: boolean, metaOnly?: boolean, context: RequestContext, res: ResponseResultFn }) {
const requestStarted = new Date();
try {
const compilerApi = await this.getCompilerApi(context);
Expand All @@ -634,6 +635,7 @@ class ApiGateway {
preAggregations: preAggregations.map(p => ({
id: p.id,
cacheOnly,
metaOnly
}))
},
)
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-api-gateway/src/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ const queryPreAggregationsSchema = Joi.object().keys({
preAggregations: Joi.array().items(Joi.object().keys({
id: Joi.string().required(),
cacheOnly: Joi.boolean(),
metaOnly: Joi.boolean(),
partitions: Joi.array().items(Joi.string()),
refreshRange: Joi.array().items(Joi.string()).length(2), // TODO: Deprecate after cloud changes
}))
Expand Down
13 changes: 12 additions & 1 deletion packages/cubejs-server-core/src/core/RefreshScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type PreAggregationsQueryingOptions = {
preAggregations: {
id: string,
cacheOnly?: boolean,
metaOnly?: boolean,
partitions?: string[]
}[],
forceBuildPreAggregations?: boolean,
Expand Down Expand Up @@ -391,7 +392,17 @@ export class RefreshScheduler {

return Promise.all(preAggregations.map(preAggregation => async () => {
const { timezones } = queryingOptions;
const { partitions: partitionsFilter, cacheOnly } = preAggregationsQueryingOptions[preAggregation.id] || {};
const { partitions: partitionsFilter, cacheOnly, metaOnly } = preAggregationsQueryingOptions[preAggregation.id] || {};

if (metaOnly) {
return {
timezones,
preAggregation,
partitions: [],
errors: [],
partitionsWithDependencies: []
};
}

const type = preAggregation?.preAggregation?.type;
const isEphemeralPreAggregation = type === 'rollupJoin' || type === 'rollupLambda';
Expand Down
Loading