Skip to content

Commit cbf9c46

Browse files
committed
Don't try to match pre-aggs if there are MemberExpressions
1 parent f33cd5f commit cbf9c46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,9 @@ export class BaseQuery {
633633
if (this.from) {
634634
return this.simpleQuery();
635635
}
636-
if (!this.options.preAggregationQuery && !this.customSubQueryJoins.length) {
636+
const hasMemberExpressions = this.allMembersConcat(false).some(m => m.isMemberExpression);
637+
638+
if (!this.options.preAggregationQuery && !this.customSubQueryJoins.length && !hasMemberExpressions) {
637639
preAggForQuery =
638640
this.preAggregations.findPreAggregationForQuery();
639641
if (this.options.disableExternalPreAggregations && preAggForQuery?.preAggregation.external) {

0 commit comments

Comments
 (0)