Skip to content

Commit d9421d0

Browse files
committed
[WIP] ungrouped fullKeyQueryAggregate debug
1 parent 4276f1b commit d9421d0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ export class BaseQuery {
950950
] : [])
951951
.concat(
952952
R.pipe(
953+
// TODO for member expressions this can be misleading: it can be a name of view, which does not have PK
953954
R.groupBy(m => m.cube().name),
954955
R.toPairs,
955956
R.map(
@@ -1068,11 +1069,15 @@ export class BaseQuery {
10681069
};
10691070

10701071
const join = R.drop(1, toJoin)
1071-
.map(
1072-
(q, i) => (this.dimensionAliasNames().length ?
1073-
`INNER JOIN ${this.wrapInParenthesis((q))} as q_${i + 1} ON ${this.dimensionsJoinCondition(`q_${i}`, `q_${i + 1}`)}` :
1074-
`, ${this.wrapInParenthesis(q)} as q_${i + 1}`),
1075-
).join('\n');
1072+
.map((q, i) => {
1073+
console.log("outerMeasuresJoinFullKeyQueryAggregate generating join, this.dimensionAliasNames()", this.dimensionAliasNames());
1074+
return this.dimensionAliasNames().length
1075+
? `INNER JOIN ${this.wrapInParenthesis(q)} as q_${
1076+
i + 1
1077+
} ON ${this.dimensionsJoinCondition(`q_${i}`, `q_${i + 1}`)}`
1078+
: `, ${this.wrapInParenthesis(q)} as q_${i + 1}`;
1079+
})
1080+
.join("\n");
10761081

10771082
const columnsToSelect = this.evaluateSymbolSqlWithContext(
10781083
() => this.dimensionColumns('q_0').concat(outerMembers.map(m => m.selectColumns())).join(', '),
@@ -1151,9 +1156,10 @@ export class BaseQuery {
11511156
R.map(m => this.newMeasure(m))
11521157
);
11531158

1154-
const multipliedMeasures = measuresToRender(true, false)(measureToHierarchy);
1155-
const regularMeasures = measuresToRender(false, false)(measureToHierarchy)
1159+
const multipliedMeasures = measuresToRender(true, false)(measureToHierarchy)
11561160
.concat(dimensionOnlyMeasures);
1161+
const regularMeasures = measuresToRender(false, false)(measureToHierarchy)
1162+
// .concat(dimensionOnlyMeasures);
11571163

11581164
const cumulativeMeasures =
11591165
R.pipe(

0 commit comments

Comments
 (0)