@cubejs-backend/schema-compiler 1.1.15 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/adapter/BaseQuery.d.ts +53 -5
- package/dist/src/adapter/BaseQuery.d.ts.map +1 -1
- package/dist/src/adapter/BaseQuery.js +44 -5
- package/dist/src/adapter/BaseQuery.js.map +1 -1
- package/dist/src/adapter/CubeStoreQuery.js +1 -1
- package/dist/src/adapter/CubeStoreQuery.js.map +1 -1
- package/dist/src/adapter/MysqlQuery.d.ts +9 -7
- package/dist/src/adapter/MysqlQuery.d.ts.map +1 -1
- package/dist/src/adapter/MysqlQuery.js +9 -1
- package/dist/src/adapter/MysqlQuery.js.map +1 -1
- package/dist/src/compiler/CubeEvaluator.d.ts.map +1 -1
- package/dist/src/compiler/CubeEvaluator.js +14 -11
- package/dist/src/compiler/CubeEvaluator.js.map +1 -1
- package/dist/src/compiler/CubeSymbols.d.ts.map +1 -1
- package/dist/src/compiler/CubeSymbols.js +11 -2
- package/dist/src/compiler/CubeSymbols.js.map +1 -1
- package/dist/src/compiler/CubeToMetaTransformer.js +1 -1
- package/dist/src/compiler/CubeToMetaTransformer.js.map +1 -1
- package/dist/src/compiler/CubeValidator.js +3 -3
- package/dist/src/compiler/CubeValidator.js.map +1 -1
- package/dist/src/compiler/YamlCompiler.js +1 -1
- package/dist/src/compiler/YamlCompiler.js.map +1 -1
- package/dist/src/compiler/transpilers/CubePropContextTranspiler.js +1 -1
- package/dist/src/compiler/transpilers/CubePropContextTranspiler.js.map +1 -1
- package/package.json +6 -6
|
@@ -9,6 +9,20 @@
|
|
|
9
9
|
* @property {import('../compiler/CompilerCache').CompilerCache} compilerCache
|
|
10
10
|
* @property {*} headCommitId
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} JoinRoot
|
|
14
|
+
* @property {string} sql
|
|
15
|
+
* @property {string} alias
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {Object} JoinItem
|
|
19
|
+
* @property {string} sql
|
|
20
|
+
* @property {string} alias
|
|
21
|
+
* @property {string} on
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {[JoinRoot, ...JoinItem]} JoinChain
|
|
25
|
+
*/
|
|
12
26
|
/**
|
|
13
27
|
* BaseQuery class. BaseQuery object encapsulates the logic of
|
|
14
28
|
* transforming an incoming to a specific cube request to the
|
|
@@ -90,6 +104,17 @@ export class BaseQuery {
|
|
|
90
104
|
cubeAliasPrefix: any;
|
|
91
105
|
preAggregationsSchemaOption: any;
|
|
92
106
|
externalQueryClass: any;
|
|
107
|
+
/**
|
|
108
|
+
* @type {Array<{sql: string, on: {expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}>}
|
|
109
|
+
*/
|
|
110
|
+
customSubQueryJoins: {
|
|
111
|
+
sql: string;
|
|
112
|
+
on: {
|
|
113
|
+
expression: Function;
|
|
114
|
+
};
|
|
115
|
+
joinType: 'LEFT' | 'INNER';
|
|
116
|
+
alias: string;
|
|
117
|
+
}[] | undefined;
|
|
93
118
|
order: any;
|
|
94
119
|
cacheValue(key: any, fn: any, { contextPropNames, inputProps, cache }?: {
|
|
95
120
|
contextPropNames: any;
|
|
@@ -271,11 +296,26 @@ export class BaseQuery {
|
|
|
271
296
|
rewriteInlineCubeSql(cube: any, isLeftJoinCondition: any): any[];
|
|
272
297
|
joinQuery(join: any, subQueryDimensions: any): string;
|
|
273
298
|
joinSql(toJoin: any): string;
|
|
274
|
-
|
|
299
|
+
/**
|
|
300
|
+
*
|
|
301
|
+
* @param {{sql: string, on: {cubeName: string, expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}} customJoin
|
|
302
|
+
* @returns {JoinItem}
|
|
303
|
+
*/
|
|
304
|
+
customSubQueryJoin(customJoin: {
|
|
275
305
|
sql: string;
|
|
306
|
+
on: {
|
|
307
|
+
cubeName: string;
|
|
308
|
+
expression: Function;
|
|
309
|
+
};
|
|
310
|
+
joinType: 'LEFT' | 'INNER';
|
|
276
311
|
alias: string;
|
|
277
|
-
|
|
278
|
-
|
|
312
|
+
}): JoinItem;
|
|
313
|
+
/**
|
|
314
|
+
*
|
|
315
|
+
* @param {string} dimension
|
|
316
|
+
* @returns {JoinItem}
|
|
317
|
+
*/
|
|
318
|
+
subQueryJoin(dimension: string): JoinItem;
|
|
279
319
|
get filtersWithoutSubQueries(): any;
|
|
280
320
|
filtersWithoutSubQueriesValue: any;
|
|
281
321
|
subQueryDescription(dimension: any): {
|
|
@@ -410,7 +450,6 @@ export class BaseQuery {
|
|
|
410
450
|
evaluateFiltersArray(filtersArray: any, cubeName: any): any;
|
|
411
451
|
primaryKeySql(primaryKeyName: any, cubeName: any): any;
|
|
412
452
|
multipliedJoinRowResult(cubeName: any): any;
|
|
413
|
-
inIntegrationTimeZone(date: any): moment.Moment;
|
|
414
453
|
inDbTimeZone(date: any): string;
|
|
415
454
|
/**
|
|
416
455
|
* @return {string}
|
|
@@ -559,6 +598,16 @@ export type Compilers = {
|
|
|
559
598
|
compilerCache: import('../compiler/CompilerCache').CompilerCache;
|
|
560
599
|
headCommitId: any;
|
|
561
600
|
};
|
|
601
|
+
export type JoinRoot = {
|
|
602
|
+
sql: string;
|
|
603
|
+
alias: string;
|
|
604
|
+
};
|
|
605
|
+
export type JoinItem = {
|
|
606
|
+
sql: string;
|
|
607
|
+
alias: string;
|
|
608
|
+
on: string;
|
|
609
|
+
};
|
|
610
|
+
export type JoinChain = [JoinRoot, ...JoinItem];
|
|
562
611
|
import { ParamAllocator } from './ParamAllocator';
|
|
563
612
|
import { PreAggregations } from './PreAggregations';
|
|
564
613
|
import { BaseFilter } from './BaseFilter';
|
|
@@ -568,6 +617,5 @@ import { BaseDimension } from './BaseDimension';
|
|
|
568
617
|
import { BaseSegment } from './BaseSegment';
|
|
569
618
|
import { BaseTimeDimension } from './BaseTimeDimension';
|
|
570
619
|
import R from 'ramda';
|
|
571
|
-
import moment from 'moment-timezone';
|
|
572
620
|
import cronParser from 'cron-parser';
|
|
573
621
|
//# sourceMappingURL=BaseQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseQuery.d.ts","sourceRoot":"","sources":["../../../src/adapter/BaseQuery.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;GAYG;AACH;
|
|
1
|
+
{"version":3,"file":"BaseQuery.d.ts","sourceRoot":"","sources":["../../../src/adapter/BaseQuery.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;IAuiFE,mDAEC;IAED;;MAEE;IACF,wCAEC;IAkkCD;;;;;;;MASC;IAUD,sEAgCC;IAED,8CAcC;IAED,4GAsBC;IAYD,yHAyCC;IAkCD,mHAuDC;IA11HD;;;;OAIG;IACH,uBAHW,SAAS,MAAE,gBAgBrB;IAZC,eAA0B;IAC1B,gEAAgE;IAChE,eADW,OAAO,2BAA2B,EAAE,aAAa,CAChB;IAC5C,wDAAwD;IACxD,WADW,OAAO,uBAAuB,EAAE,SAAS,CAChB;IACpC,aAA4B;IAo7D9B,4CAaC;IA3oDD;;;QA2BC;IA7UC,6BAA6B;IAC7B,gBADW,cAAc,CACiF;IAI5G,qDAoBC;IAED,sDAYC;IAED,2CAuDC;IAED;;OAEG;IACH,kCA0FC;IAzFC,oBAGC;IACD,mBAA0D;IAC1D,gBA6BE;IACF,UAA6B;IAC7B,qBAAmD;IACnD,cAAqC;IACrC,cAAqC;IACrC,YAAiC;IACjC,6CAAgD;IAChD,cAA6E;IAC7E,gBAAmF;IACnF,0BAAuG;IACvG,8BAAmH;IACnH,cAA6E;IAM7E,6CAA6C;IAC7C,sDAAwK;IACxK,oBAA6K;IAC7K,oBAc2D;IAC3D,gBAAgF;IAI9E,UAAuD;IAEzD,qBAAmD;IACnD,iCAAuG;IACvG,wB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AgC,EAAE,kBAAkB;qBAC3D,OAAO,mCAAmC,EAAE,qBAAqB;mBACjE,OAAO,2BAA2B,EAAE,aAAa;sBACjD,OAAO,8BAA8B,EAAE,gBAAgB;eACvD,OAAO,uBAAuB,EAAE,SAAS;mBACzC,OAAO,2BAA2B,EAAE,aAAa;;;;SAMjD,MAAM;WACN,MAAM;;;SAKN,MAAM;WACN,MAAM;QACN,MAAM;;wBAIP,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC;+BAnDL,kBAAkB;gCACjB,mBAAmB;2BAJxB,cAAc;gCACT,mBAAmB;4BAJvB,eAAe;8BACb,iBAAiB;4BACnB,eAAe;kCAGT,qBAAqB;cAhBzC,OAAO;uBACE,aAAa"}
|
|
@@ -55,6 +55,20 @@ const SecondsDurations = {
|
|
|
55
55
|
* @property {import('../compiler/CompilerCache').CompilerCache} compilerCache
|
|
56
56
|
* @property {*} headCommitId
|
|
57
57
|
*/
|
|
58
|
+
/**
|
|
59
|
+
* @typedef {Object} JoinRoot
|
|
60
|
+
* @property {string} sql
|
|
61
|
+
* @property {string} alias
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* @typedef {Object} JoinItem
|
|
65
|
+
* @property {string} sql
|
|
66
|
+
* @property {string} alias
|
|
67
|
+
* @property {string} on
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* @typedef {[JoinRoot, ...JoinItem]} JoinChain
|
|
71
|
+
*/
|
|
58
72
|
/**
|
|
59
73
|
* BaseQuery class. BaseQuery object encapsulates the logic of
|
|
60
74
|
* transforming an incoming to a specific cube request to the
|
|
@@ -216,6 +230,7 @@ class BaseQuery {
|
|
|
216
230
|
multiStageQuery: this.options.multiStageQuery,
|
|
217
231
|
multiStageDimensions: this.options.multiStageDimensions,
|
|
218
232
|
multiStageTimeDimensions: this.options.multiStageTimeDimensions,
|
|
233
|
+
subqueryJoins: this.options.subqueryJoins,
|
|
219
234
|
});
|
|
220
235
|
this.from = this.options.from;
|
|
221
236
|
this.multiStageQuery = this.options.multiStageQuery;
|
|
@@ -256,6 +271,10 @@ class BaseQuery {
|
|
|
256
271
|
this.cubeAliasPrefix = this.options.cubeAliasPrefix;
|
|
257
272
|
this.preAggregationsSchemaOption = this.options.preAggregationsSchema ?? DEFAULT_PREAGGREGATIONS_SCHEMA;
|
|
258
273
|
this.externalQueryClass = this.options.externalQueryClass;
|
|
274
|
+
/**
|
|
275
|
+
* @type {Array<{sql: string, on: {expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}>}
|
|
276
|
+
*/
|
|
277
|
+
this.customSubQueryJoins = this.options.subqueryJoins ?? [];
|
|
259
278
|
// Set the default order only when options.order is not provided at all
|
|
260
279
|
// if options.order is set (empty array [] or with data) - use it as is
|
|
261
280
|
this.order = this.options.order ?? this.defaultOrder();
|
|
@@ -1215,14 +1234,37 @@ class BaseQuery {
|
|
|
1215
1234
|
return this.joinSql([
|
|
1216
1235
|
{ sql: cubeSql, alias: cubeAlias },
|
|
1217
1236
|
...(subQueryDimensionsByCube[join.root] || []).map(d => this.subQueryJoin(d)),
|
|
1218
|
-
...joins
|
|
1237
|
+
...joins,
|
|
1238
|
+
...this.customSubQueryJoins.map((customJoin) => this.customSubQueryJoin(customJoin)),
|
|
1219
1239
|
]);
|
|
1220
1240
|
}
|
|
1221
1241
|
joinSql(toJoin) {
|
|
1222
1242
|
const [root, ...rest] = toJoin;
|
|
1223
|
-
const joins = rest.map(j =>
|
|
1243
|
+
const joins = rest.map(j => {
|
|
1244
|
+
const joinType = j.joinType ?? 'LEFT';
|
|
1245
|
+
return `${joinType} JOIN ${j.sql} ${this.asSyntaxJoin} ${j.alias} ON ${j.on}`;
|
|
1246
|
+
});
|
|
1224
1247
|
return [`${root.sql} ${this.asSyntaxJoin} ${root.alias}`, ...joins].join('\n');
|
|
1225
1248
|
}
|
|
1249
|
+
/**
|
|
1250
|
+
*
|
|
1251
|
+
* @param {{sql: string, on: {cubeName: string, expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}} customJoin
|
|
1252
|
+
* @returns {JoinItem}
|
|
1253
|
+
*/
|
|
1254
|
+
customSubQueryJoin(customJoin) {
|
|
1255
|
+
const on = this.evaluateSql(customJoin.on.cubeName, customJoin.on.expression);
|
|
1256
|
+
return {
|
|
1257
|
+
sql: `(${customJoin.sql})`,
|
|
1258
|
+
alias: customJoin.alias,
|
|
1259
|
+
on,
|
|
1260
|
+
joinType: customJoin.joinType,
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
*
|
|
1265
|
+
* @param {string} dimension
|
|
1266
|
+
* @returns {JoinItem}
|
|
1267
|
+
*/
|
|
1226
1268
|
subQueryJoin(dimension) {
|
|
1227
1269
|
const { prefix, subQuery, cubeName } = this.subQueryDescription(dimension);
|
|
1228
1270
|
const primaryKeys = this.cubeEvaluator.primaryKeys[cubeName];
|
|
@@ -2100,9 +2142,6 @@ class BaseQuery {
|
|
|
2100
2142
|
// this.join not initialized on collectCubeNamesForSql
|
|
2101
2143
|
return this.join && this.join.multiplicationFactor[cubeName];
|
|
2102
2144
|
}
|
|
2103
|
-
inIntegrationTimeZone(date) {
|
|
2104
|
-
return moment_timezone_1.default.tz(date, this.timezone);
|
|
2105
|
-
}
|
|
2106
2145
|
inDbTimeZone(date) {
|
|
2107
2146
|
return (0, shared_1.inDbTimeZone)(this.timezone, this.timestampFormat(), date);
|
|
2108
2147
|
}
|