Skip to content

Commit 209f995

Browse files
committed
code polish
1 parent aa36bde commit 209f995

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export class BaseQuery {
429429
// join path will be constructed in join graph.
430430
// It is important to use queryLevelJoinHints during the calculation if it is set.
431431

432-
const constructJP = () => {
432+
const constructJH = () => {
433433
const filteredJoinMembersJoinHints = joinMembersJoinHints.filter(m => !allMembersJoinHints.includes(m));
434434
return [
435435
...this.queryLevelJoinHints,
@@ -441,15 +441,15 @@ export class BaseQuery {
441441
};
442442

443443
let prevJoins = this.join;
444-
let newJoin = this.joinGraph.buildJoin(constructJP());
444+
let newJoin = this.joinGraph.buildJoin(constructJH());
445445

446446
while (newJoin?.joins.length > 0 && !R.equals(prevJoins, newJoin)) {
447447
prevJoins = newJoin;
448448
joinMembersJoinHints = this.collectJoinHintsFromMembers(this.joinMembersFromJoin(newJoin));
449-
newJoin = this.joinGraph.buildJoin(constructJP());
449+
newJoin = this.joinGraph.buildJoin(constructJH());
450450
}
451451

452-
this.collectedJoinHints = R.uniq(constructJP());
452+
this.collectedJoinHints = R.uniq(constructJH());
453453
}
454454
return this.collectedJoinHints;
455455
}

packages/cubejs-schema-compiler/test/integration/postgres/cube-views.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { dbRunner } from './PostgresDBRunner';
66
describe('Cube Views', () => {
77
jest.setTimeout(200000);
88

9+
// language=JavaScript
910
const { compiler, joinGraph, cubeEvaluator, metaTransformer } = prepareJsCompiler(`
1011
cube(\`Orders\`, {
1112
sql: \`

packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { testWithPreAggregation } from './pre-aggregation-utils';
1111
describe('SQL Generation', () => {
1212
jest.setTimeout(200000);
1313

14+
// language=JavaScript
1415
const { compiler, joinGraph, cubeEvaluator } = prepareJsCompiler(`
1516
const perVisitorRevenueMeasure = {
1617
type: 'number',
@@ -4090,7 +4091,9 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
40904091

40914092
describe('Transitive join paths', () => {
40924093
// eslint-disable-next-line @typescript-eslint/no-shadow
4093-
const { compiler, joinGraph, cubeEvaluator } = prepareYamlCompiler(`
4094+
const { compiler, joinGraph, cubeEvaluator } =
4095+
// language=yaml
4096+
prepareYamlCompiler(`
40944097
cubes:
40954098
- name: merchant_dims
40964099
sql: |

0 commit comments

Comments
 (0)