Skip to content

Commit 14e1b6d

Browse files
committed
fix for 'rollupJoin' pre-aggs
1 parent bf4abc3 commit 14e1b6d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ export class BaseQuery {
709709
externalPreAggregationQuery() {
710710
if (!this.options.preAggregationQuery && !this.options.disableExternalPreAggregations && this.externalQueryClass) {
711711
const preAggregationForQuery = this.preAggregations.findPreAggregationForQuery();
712-
if (preAggregationForQuery && preAggregationForQuery.preAggregation.external) {
712+
if (preAggregationForQuery?.preAggregation.external) {
713713
return true;
714714
}
715715
const preAggregationsDescription = this.preAggregations.preAggregationsDescription();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,8 @@ export class PreAggregations {
10701070
preAggregationName,
10711071
preAggregation,
10721072
cube,
1073-
canUsePreAggregation: canUsePreAggregation(references) && this.doesQueryAndPreAggJoinTreeMatch(references),
1073+
// There are no connections in the joinTree between cubes from different datasources for 'rollupJoin' pre-aggs
1074+
canUsePreAggregation: canUsePreAggregation(references) && (preAggregation.type === 'rollupJoin' || this.doesQueryAndPreAggJoinTreeMatch(references)),
10741075
references,
10751076
preAggregationId: `${cube}.${preAggregationName}`
10761077
};

0 commit comments

Comments
 (0)