Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cubejs-schema-compiler/src/adapter/BaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -5062,7 +5062,7 @@ export class BaseQuery {
return false;
}

return dfs(root) ? path.join('.') : null;
return (root && dfs(root)) ? path.join('.') : null;
};
}

Expand All @@ -5080,7 +5080,7 @@ export class BaseQuery {
const [cube, field] = member.split('.');
if (!cube || !field) return member;

if (cube === queryJoinRoot.root) {
if (cube === queryJoinRoot?.root) {
return member;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class PreAggregations {
const { join } = this.query;
if (!join) {
// This can happen with Tesseract, or when there's no cubes to join
throw new Error('Unexpected missing join tree for query');
return [];
}
return join.joins.map(j => j.originalTo).concat([join.root]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,23 @@ cube(\`city\`, {
);
}

if (getEnv('nativeSqlPlanner')) {
it.skip('FIXME(tesseract): two regular sub-queries', () => {
// TODO: Fix in tesseract
});
} else {
it('two regular sub-queries', async () => runQueryTest({
measures: ['orders.amount', 'shipments.count'],
dimensions: [
'city.name'
],
order: [{ id: 'city.name' }]
}, [{
city__name: 'New York City',
orders__amount: '9',
shipments__count: '3',
}, {
city__name: 'San Francisco',
orders__amount: '6',
shipments__count: '1',
}, {
city__name: null,
orders__amount: '6',
shipments__count: '1',
}]));
}
it('two regular sub-queries', async () => runQueryTest({
measures: ['orders.amount', 'shipments.count'],
dimensions: [
'city.name'
],
order: [{ id: 'city.name' }]
}, [{
city__name: 'New York City',
orders__amount: '9',
shipments__count: '3',
}, {
city__name: 'San Francisco',
orders__amount: '6',
shipments__count: '1',
}, {
city__name: null,
orders__amount: '6',
shipments__count: '1',
}]));
});
Loading