Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a427642
feat(meerkat-core): add join filter condition support for structured …
sree-vardhan-reddy-D Jul 5, 2026
59f6864
feat(meerkat-core): add join filter condition support for structured …
sree-vardhan-reddy-D Jul 6, 2026
933f64e
Handle bridge tables (link) appearing multiple times in a join path A…
sree-vardhan-reddy-D Jul 7, 2026
e11c310
make the alias functions modular
sree-vardhan-reddy-D Jul 7, 2026
41c8b39
remove unnecessary function quoteKey
sree-vardhan-reddy-D Jul 7, 2026
c8d9e4c
simplyfiy the implementation
sree-vardhan-reddy-D Jul 7, 2026
4501a1c
links gives An invalid path was detected
sree-vardhan-reddy-D Jul 7, 2026
bb38c05
refactor: reuse existing filter AST infrastructure for join conditions
sree-vardhan-reddy-D Jul 8, 2026
8e6db4f
refactor: reuse MeerkatQueryFilter for join conditions instead of cus…
sree-vardhan-reddy-D Jul 8, 2026
8ba6473
refactor: simplify generateSqlQueryV2
sree-vardhan-reddy-D Jul 8, 2026
7a0f4cc
refactor: cleanup the code
sree-vardhan-reddy-D Jul 8, 2026
840aecc
refactor: added isBridge to StructuredJoin
sree-vardhan-reddy-D Jul 8, 2026
f0ddfa5
bring back links to normal case while checking for Path ambiguity
sree-vardhan-reddy-D Jul 9, 2026
cf9a178
remove throw error for preivously visisted 'graph[from.table]?.[to.ta…
sree-vardhan-reddy-D Jul 9, 2026
b9cc8ea
get bridge tables through dimension, mesuares, filters only
sree-vardhan-reddy-D Jul 10, 2026
3d9e118
revert chagnes in joinsv1
sree-vardhan-reddy-D Jul 10, 2026
7456c76
revert chagnes in joinsv1
sree-vardhan-reddy-D Jul 10, 2026
0bd4af0
keep only dimensions, measures, filters in getReferencedTables
sree-vardhan-reddy-D Jul 10, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export const cubeQueryToSQL = async ({

const updatedTableSchema = await getCombinedTableSchema(
updatedTableSchemas,
query
query,
(q) => getQueryOutput(q, connection)
);

const ast = cubeToDuckdbAST(query, updatedTableSchema, {
Expand Down
8 changes: 4 additions & 4 deletions meerkat-core/src/joins/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const withArrayCols = (
});

describe('joins router', () => {
it('routes to v2 when joinPathsV2 is set', () => {
it('routes to v2 when joinPathsV2 is set', async () => {
const schemas = [
withArrayCols('issues', ['id'], ['owned_by_ids']),
scalar('users'),
Expand All @@ -58,12 +58,12 @@ describe('joins router', () => {
],
],
};
const result = getCombinedTableSchema(schemas, cubeQuery);
const result = await getCombinedTableSchema(schemas, cubeQuery);
expect(result.sql).toContain('UNNEST(owned_by_ids)');
expect(result.sql).not.toMatch(/CONTAINS/i);
});

it('routes to v1 when joinPathsV2 is absent', () => {
it('routes to v1 when joinPathsV2 is absent', async () => {
const schemas = [
{
...scalar('orders', ['id', 'customer_id']),
Expand All @@ -76,7 +76,7 @@ describe('joins router', () => {
dimensions: ['customers.id'],
joinPaths: [[{ left: 'orders', right: 'customers', on: 'customer_id' }]],
};
const result = getCombinedTableSchema(schemas, cubeQuery);
const result = await getCombinedTableSchema(schemas, cubeQuery);
expect(result.sql).toContain('orders.customer_id = customers.id');
expect(result.sql).not.toMatch(/UNNEST/);
});
Expand Down
8 changes: 5 additions & 3 deletions meerkat-core/src/joins/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import type { Query } from '../types/cube-types';
import type { GetQueryOutput } from '../utils/duckdb-ast-parse-serialize';
import { hasJoinPathsV2 } from './accessors';
import { getCombinedTableSchemaV2 } from './v2/joins';
import { getCombinedTableSchema as getCombinedTableSchemaV1 } from './v1/joins';

export { hasAnyJoinPaths, hasJoinPathsV2 } from './accessors';

export const getCombinedTableSchema = (
export const getCombinedTableSchema = async (
tableSchema: Parameters<typeof getCombinedTableSchemaV1>[0],
cubeQuery: Query
cubeQuery: Query,
getQueryOutput?: GetQueryOutput
) => {
if (hasJoinPathsV2(cubeQuery)) {
return getCombinedTableSchemaV2(tableSchema, cubeQuery);
return getCombinedTableSchemaV2(tableSchema, cubeQuery, getQueryOutput);
}
return getCombinedTableSchemaV1(tableSchema, cubeQuery);
};
Expand Down
Loading
Loading