Skip to content

Commit 7e12e4e

Browse files
committed
fix: More descriptive error message for incorrect incremental: true non-partitioned setting
1 parent a52c4d6 commit 7e12e4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/cubejs-schema-compiler/src/adapter/BaseQuery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,7 +2687,7 @@ class BaseQuery {
26872687
return `SELECT ${sql} as refresh_key`;
26882688
}
26892689

2690-
preAggregationInvalidateKeyQueries(cube, preAggregation) {
2690+
preAggregationInvalidateKeyQueries(cube, preAggregation, preAggregationName) {
26912691
return this.cacheValue(
26922692
['preAggregationInvalidateKeyQueries', cube, JSON.stringify(preAggregation)],
26932693
() => {
@@ -2711,7 +2711,7 @@ class BaseQuery {
27112711
const renewalThreshold = this.refreshKeyRenewalThresholdForInterval(preAggregation.refreshKey);
27122712
if (preAggregation.refreshKey.incremental) {
27132713
if (!preAggregation.partitionGranularity) {
2714-
throw new UserError('Incremental refresh key can only be used for partitioned pre-aggregations');
2714+
throw new UserError(`Incremental refresh key can only be used for partitioned pre-aggregations but set for non-partitioned '${cube}.${preAggregationName}'`);
27152715
}
27162716
// TODO Case when partitioned originalSql is resolved for query without time dimension.
27172717
// Consider fallback to not using such originalSql for consistency?

packages/cubejs-schema-compiler/src/adapter/PreAggregations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class PreAggregations {
147147
const { preAggregationName, preAggregation, references } = foundPreAggregation;
148148

149149
const tableName = this.preAggregationTableName(cube, preAggregationName, preAggregation);
150-
const invalidateKeyQueries = this.query.preAggregationInvalidateKeyQueries(cube, preAggregation);
150+
const invalidateKeyQueries = this.query.preAggregationInvalidateKeyQueries(cube, preAggregation, preAggregationName);
151151
const queryForSqlEvaluation = this.query.preAggregationQueryForSqlEvaluation(cube, preAggregation);
152152
const partitionInvalidateKeyQueries = queryForSqlEvaluation.partitionInvalidateKeyQueries && queryForSqlEvaluation.partitionInvalidateKeyQueries(cube, preAggregation);
153153

0 commit comments

Comments
 (0)