Skip to content

Commit b3bdc3b

Browse files
committed
fix(gateway): skip query rewrite during dry run
1 parent 646bd9d commit b3bdc3b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/cubejs-api-gateway/src/gateway.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,7 @@ class ApiGateway {
11611161
context: RequestContext,
11621162
persistent = false,
11631163
memberExpressions: boolean = false,
1164+
skipQueryRewrite: boolean = false,
11641165
): Promise<[QueryType, NormalizedQuery[]]> {
11651166
let query = this.parseQueryParam(inputQuery);
11661167

@@ -1199,6 +1200,11 @@ class ApiGateway {
11991200
}
12001201

12011202
const normalizedQuery = normalizeQuery(currentQuery, persistent);
1203+
1204+
if (skipQueryRewrite) {
1205+
return normalizedQuery;
1206+
}
1207+
12021208
let evaluatedQuery = normalizedQuery;
12031209

12041210
if (hasExpressionsInQuery) {
@@ -1454,7 +1460,7 @@ class ApiGateway {
14541460
try {
14551461
await this.assertApiScope('data', context.securityContext);
14561462

1457-
const [queryType, normalizedQueries] = await this.getNormalizedQueries(query, context);
1463+
const [queryType, normalizedQueries] = await this.getNormalizedQueries(query, context, undefined, undefined, true);
14581464

14591465
const sqlQueries = await Promise.all<any>(
14601466
normalizedQueries.map(async (normalizedQuery) => (await this.getCompilerApi(context)).getSql(

0 commit comments

Comments
 (0)