Skip to content

Commit 6e225e5

Browse files
committed
fix for 'rollupJoin' pre-aggs
1 parent 84abb69 commit 6e225e5

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
@@ -710,7 +710,7 @@ export class BaseQuery {
710710
externalPreAggregationQuery() {
711711
if (!this.options.preAggregationQuery && !this.options.disableExternalPreAggregations && this.externalQueryClass) {
712712
const preAggregationForQuery = this.preAggregations.findPreAggregationForQuery();
713-
if (preAggregationForQuery && preAggregationForQuery.preAggregation.external) {
713+
if (preAggregationForQuery?.preAggregation.external) {
714714
return true;
715715
}
716716
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)