Skip to content

Commit 42f36f4

Browse files
committed
fix tests and remove unneeded magic
1 parent d0e8bc1 commit 42f36f4

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,26 +2497,6 @@ export class BaseQuery {
24972497
joinHints = joinHints.filter(e => e !== targetCube);
24982498
joinHints.push(targetCube);
24992499
this.safeEvaluateSymbolContext().joinHints = joinHints;
2500-
2501-
// Special processing is required when one cube extends another, because in this case
2502-
// cube names collected during joins evaluation might belong to ancestors which are out of scope of
2503-
// the current query and thus will lead to `Can't find join path to join cubes` error.
2504-
// To work around this we change the all ancestors cube names in collected join hints to the original one.
2505-
if (s.cube().extends) {
2506-
const cubeName = s.cube().name;
2507-
let parentCube = this.cubeEvaluator.resolveSymbolsCall(s.cube().extends, (name) => this.cubeEvaluator.cubeFromPath(name));
2508-
while (parentCube) {
2509-
// eslint-disable-next-line no-loop-func
2510-
joinHints.forEach((item, index, array) => {
2511-
if (item === parentCube.name) {
2512-
array[index] = cubeName;
2513-
}
2514-
});
2515-
parentCube = parentCube.extends ?
2516-
this.cubeEvaluator.resolveSymbolsCall(parentCube.extends, (name) => this.cubeEvaluator.cubeFromPath(name))
2517-
: null;
2518-
}
2519-
}
25202500
}
25212501
return res;
25222502
}

packages/cubejs-schema-compiler/test/integration/postgres/pre-aggregations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('PreAggregations', () => {
2626
2727
cards: {
2828
relationship: 'hasMany',
29-
sql: \`\${visitors.id} = \${cards.visitorId}\`
29+
sql: \`\${CUBE.id} = \${cards.visitorId}\`
3030
}
3131
},
3232

packages/cubejs-testing/birdbox-fixtures/postgresql/schema/PreAggregationTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cube(`visitors`, {
1212

1313
cards: {
1414
relationship: 'hasMany',
15-
sql: `${visitors.id} = ${cards.visitorId}`
15+
sql: `${CUBE.id} = ${cards.visitorId}`
1616
}
1717
},
1818

0 commit comments

Comments
 (0)