Skip to content

Commit 5f0758d

Browse files
committed
uncomment test
1 parent 813b54f commit 5f0758d

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

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

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5215,7 +5215,7 @@ cubes:
52155215
sql: "{CUBE}.b_id = {gamma_dims.b_id}"
52165216
- name: delta_bridge
52175217
relationship: many_to_one
5218-
sql: "{beta_dims.a_name} = {delta_bridge.a_name} AND {gamma_dims.b_name} = {delta_bridge.b_name}"
5218+
sql: "{beta_dims.a_name} = {delta_bridge.a_name} AND {gamma_dims.b_name} = {delta_bridge.c_name}"
52195219
dimensions:
52205220
- name: reporting_date
52215221
sql: reporting_date
@@ -5272,11 +5272,11 @@ cubes:
52725272
- name: delta_bridge
52735273
sql: |
52745274
(
5275-
SELECT 'Alpha1' AS a_name, 'Beta1' AS b_name, 'Gamma1' AS c_name, 'Organic' AS channel
5275+
SELECT 'Alpha1' AS a_name, 'Beta1' AS b_name, 'Beta1' AS c_name, 'Organic' AS channel
52765276
UNION ALL
5277-
SELECT 'Alpha1' AS a_name, 'Beta2' AS b_name, 'Gamma2' AS c_name, 'Paid' AS channel
5277+
SELECT 'Alpha2' AS a_name, 'Beta2' AS b_name, 'Beta2' AS c_name, 'Paid' AS channel
52785278
UNION ALL
5279-
SELECT 'Alpha2' AS a_name, 'Beta1' AS b_name, 'Gamma3' AS c_name, 'Referral' AS channel
5279+
SELECT 'Alpha1' AS a_name, 'Beta1' AS b_name, 'Beta3' AS c_name, 'Referral' AS channel
52805280
)
52815281
joins:
52825282
- name: gamma_dims
@@ -5345,31 +5345,43 @@ cubes:
53455345
});
53465346
}
53475347

5348-
it('querying cube with transitive joins with a few joins to same cube', async () => {
5349-
// TODO: This is not supported atm, but it's a good case, so keeping this test
5350-
// for the future implementation
5351-
5352-
// await compiler.compile();
5353-
//
5354-
// const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
5355-
// measures: [],
5356-
// dimensions: [
5357-
// 'alpha_facts.reporting_date',
5358-
// 'delta_bridge.b_name',
5359-
// 'alpha_facts.channel'
5360-
// ],
5361-
// order: [{
5362-
// id: 'alpha_facts.reporting_date'
5363-
// }],
5364-
// timezone: 'America/Los_Angeles'
5365-
// });
5366-
//
5367-
// const res = await dbRunner.testQuery(query.buildSqlAndParams());
5368-
// console.log(JSON.stringify(res));
5369-
//
5370-
// expect(res).toEqual([
5371-
// // Fill
5372-
// ]);
5373-
});
5348+
if (!getEnv('nativeSqlPlanner')) {
5349+
it('querying cube with transitive joins with a few joins to the same cube', async () => {
5350+
await compiler.compile();
5351+
5352+
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
5353+
measures: [],
5354+
dimensions: [
5355+
'alpha_facts.reporting_date',
5356+
'delta_bridge.b_name',
5357+
'alpha_facts.channel'
5358+
],
5359+
order: [{
5360+
id: 'alpha_facts.reporting_date'
5361+
}],
5362+
timezone: 'America/Los_Angeles'
5363+
});
5364+
5365+
const res = await dbRunner.testQuery(query.buildSqlAndParams());
5366+
console.log(JSON.stringify(res));
5367+
5368+
expect(res).toEqual([
5369+
{
5370+
alpha_facts__channel: 'Organic',
5371+
alpha_facts__reporting_date: '2023-01-01T00:00:00.000Z',
5372+
delta_bridge__b_name: 'Beta1',
5373+
},
5374+
{
5375+
alpha_facts__channel: 'Paid',
5376+
alpha_facts__reporting_date: '2023-01-02T00:00:00.000Z',
5377+
delta_bridge__b_name: 'Beta2',
5378+
},
5379+
]);
5380+
});
5381+
} else {
5382+
it.skip('FIXME(tesseract): querying cube with transitive joins with a few joins to the same cube', async () => {
5383+
// FIXME should be implemented in Tesseract
5384+
});
5385+
}
53745386
});
53755387
});

0 commit comments

Comments
 (0)