@cubejs-backend/schema-compiler 1.2.14 → 1.2.15
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 +7 -1
- package/dist/src/adapter/BaseQuery.d.ts.map +1 -1
- package/dist/src/adapter/BaseQuery.js +56 -13
- package/dist/src/adapter/BaseQuery.js.map +1 -1
- package/dist/src/adapter/PreAggregations.d.ts.map +1 -1
- package/dist/src/adapter/PreAggregations.js +0 -4
- package/dist/src/adapter/PreAggregations.js.map +1 -1
- package/dist/src/compiler/CubeEvaluator.d.ts.map +1 -1
- package/dist/src/compiler/CubeEvaluator.js +2 -1
- package/dist/src/compiler/CubeEvaluator.js.map +1 -1
- package/dist/src/compiler/CubeSymbols.d.ts +70 -57
- package/dist/src/compiler/CubeSymbols.d.ts.map +1 -1
- package/dist/src/compiler/CubeSymbols.js +70 -37
- package/dist/src/compiler/CubeSymbols.js.map +1 -1
- package/package.json +6 -6
|
@@ -100,7 +100,7 @@ export class BaseQuery {
|
|
|
100
100
|
measureFilters: any;
|
|
101
101
|
timeDimensions: any;
|
|
102
102
|
allFilters: any;
|
|
103
|
-
|
|
103
|
+
useNativeSqlPlanner: any;
|
|
104
104
|
cubeAliasPrefix: any;
|
|
105
105
|
preAggregationsSchemaOption: any;
|
|
106
106
|
externalQueryClass: any;
|
|
@@ -116,6 +116,8 @@ export class BaseQuery {
|
|
|
116
116
|
alias: string;
|
|
117
117
|
}[] | undefined;
|
|
118
118
|
order: any;
|
|
119
|
+
prebuildJoin(): void;
|
|
120
|
+
join: any;
|
|
119
121
|
cacheValue(key: any, fn: any, { contextPropNames, inputProps, cache }?: {
|
|
120
122
|
contextPropNames: any;
|
|
121
123
|
inputProps: any;
|
|
@@ -175,6 +177,7 @@ export class BaseQuery {
|
|
|
175
177
|
countAllQuery(sql: string): string;
|
|
176
178
|
regularAndTimeSeriesRollupQuery(regularMeasures: any, multipliedMeasures: any, cumulativeMeasures: any, preAggregationForQuery: any): string;
|
|
177
179
|
externalPreAggregationQuery(): boolean;
|
|
180
|
+
newQueryWithoutNative(): any;
|
|
178
181
|
/**
|
|
179
182
|
* Returns a pair of SQL query string and parameter values for the query.
|
|
180
183
|
* @param {boolean} [exportAnnotatedSql] - returns annotated sql with not rendered params if true
|
|
@@ -581,7 +584,10 @@ export class BaseQuery {
|
|
|
581
584
|
};
|
|
582
585
|
contextSymbolsProxy(symbols: any): any;
|
|
583
586
|
filtersProxy(): {};
|
|
587
|
+
filtersProxyForRust(usedFilters: any): {};
|
|
588
|
+
filterGroupFunctionForRust(usedFilters: any): (...filterParamArgs: any[]) => string;
|
|
584
589
|
filterGroupFunction(): (...filterParamArgs: any[]) => string;
|
|
590
|
+
filterGroupFunctionImpl(allFilters: any): (...filterParamArgs: any[]) => string;
|
|
585
591
|
flattenAllMembers(excludeSegments?: boolean): any[];
|
|
586
592
|
allBackAliasMembersExceptSegments(): any;
|
|
587
593
|
allBackAliasMembers(): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseQuery.d.ts","sourceRoot":"","sources":["../../../src/adapter/BaseQuery.js"],"names":[],"mappings":"AA0DA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;
|
|
1
|
+
{"version":3,"file":"BaseQuery.d.ts","sourceRoot":"","sources":["../../../src/adapter/BaseQuery.js"],"names":[],"mappings":"AA0DA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;IAwqFE,mDAEC;IAED;;MAEE;IACF,wCAEC;IAukCD;;;;;;;MASC;IAgBD,sEAgCC;IAED,8CAcC;IAED,4GAsBC;IA6BD,yHAyCC;IAsCD,mHAuDC;IA3/HD;;;;OAIG;IACH,uBAHW,SAAS,MAAE,gBAgBrB;IAZC,eAA0B;IAC1B,gE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ED,0FAWC;IAED,iDAiBC;IAED,4EAEC;IAED,uDA6BC;IAED,qEA4CC;IAED,oEAMC;IAED,kEAEC;IAED,uFAEC;IAED;;;OAGG;IACH,uBAFa,GAAG,CAgMf;IAGD,yEAQC;IAED;;;;MA0BC;IAED;;;;MAwBC;IAED,6DAwBC;IAED,kGAoDC;IAED;;;;OAIG;IACH,kCAHW,MAAM,GACL,CAAC,MAAM,EAAE,MAAM,CAAC,CAW3B;IAED,sCAIC;IAED,2CAKC;IAED,+BAEC;IAED,8EAcC;IAED,4CAEC;IAED;;MAIC;IAED;;;;;;;;;;;;;;;OAeG;IACH,gCAHW,MAAM,GACL,MAAM,CAIjB;IAED,iGAqGC;IAED,0FAqBC;IAED,mEAcC;IAED,kCAcC;IAZG,qCASE;IAgBN,8BAEC;IAED;2BA38BW,MAAM,KACL,MAAM;MA88BjB;IAED,uCAEC;IA4ED,mBAQC;IAED,0CASC;IAED,oFAIC;IA6CD,6DAGC;IAED,gFA6BC;IA2DD,oDAUC;IAED,yCAEC;IAED,2BAEC;IAED,oCAsBC;CACF;;;;;cAhlIa,OAAO,gCAAgC,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;+BApDL,kBAAkB;gCACjB,mBAAmB;2BAJxB,cAAc;gCACT,mBAAmB;4BAJvB,eAAe;8BACb,iBAAiB;4BACnB,eAAe;kCAGT,qBAAqB;cAvBzC,OAAO;uBACE,aAAa"}
|
|
@@ -265,10 +265,8 @@ class BaseQuery {
|
|
|
265
265
|
return dimension;
|
|
266
266
|
}).filter(ramda_1.default.identity).map(this.newTimeDimension.bind(this));
|
|
267
267
|
this.allFilters = this.timeDimensions.concat(this.segments).concat(this.filters);
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
this.join = this.joinGraph.buildJoin(this.allJoinHints);
|
|
271
|
-
}
|
|
268
|
+
this.useNativeSqlPlanner = this.options.useNativeSqlPlanner ?? (0, shared_1.getEnv)('nativeSqlPlanner');
|
|
269
|
+
this.prebuildJoin();
|
|
272
270
|
this.cubeAliasPrefix = this.options.cubeAliasPrefix;
|
|
273
271
|
this.preAggregationsSchemaOption = this.options.preAggregationsSchema ?? DEFAULT_PREAGGREGATIONS_SCHEMA;
|
|
274
272
|
this.externalQueryClass = this.options.externalQueryClass;
|
|
@@ -281,6 +279,13 @@ class BaseQuery {
|
|
|
281
279
|
this.order = this.options.order ?? this.defaultOrder();
|
|
282
280
|
this.initUngrouped();
|
|
283
281
|
}
|
|
282
|
+
prebuildJoin() {
|
|
283
|
+
/* if (!this.useNativeSqlPlanner) { We still need this join for the follback to preaggregation to work properly. This condition should be returned after the tesseract starts working with pre-aggregations
|
|
284
|
+
// Tesseract doesn't require join to be prebuilt and there's a case where single join can't be built for multi-fact query
|
|
285
|
+
this.join = this.joinGraph.buildJoin(this.allJoinHints);
|
|
286
|
+
} */
|
|
287
|
+
this.join = this.joinGraph.buildJoin(this.allJoinHints);
|
|
288
|
+
}
|
|
284
289
|
cacheValue(key, fn, { contextPropNames, inputProps, cache } = {}) {
|
|
285
290
|
const currentContext = this.safeEvaluateSymbolContext();
|
|
286
291
|
if (contextPropNames) {
|
|
@@ -343,8 +348,7 @@ class BaseQuery {
|
|
|
343
348
|
initUngrouped() {
|
|
344
349
|
this.ungrouped = this.options.ungrouped;
|
|
345
350
|
if (this.ungrouped) {
|
|
346
|
-
|
|
347
|
-
if (!this.options.allowUngroupedWithoutPrimaryKey && !(0, shared_1.getEnv)('nativeSqlPlanner')) {
|
|
351
|
+
if (!this.options.allowUngroupedWithoutPrimaryKey) {
|
|
348
352
|
const cubes = ramda_1.default.uniq([this.join.root].concat(this.join.joins.map(j => j.originalTo)));
|
|
349
353
|
const primaryKeyNames = cubes.flatMap(c => this.primaryKeyNames(c));
|
|
350
354
|
const missingPrimaryKeys = primaryKeyNames.filter(key => !this.dimensions.find(d => d.dimension === key));
|
|
@@ -509,23 +513,46 @@ class BaseQuery {
|
|
|
509
513
|
}
|
|
510
514
|
return false;
|
|
511
515
|
}
|
|
516
|
+
newQueryWithoutNative() {
|
|
517
|
+
const QueryClass = this.constructor;
|
|
518
|
+
return new QueryClass(this.compilers, { ...this.options, useNativeSqlPlanner: false });
|
|
519
|
+
}
|
|
512
520
|
/**
|
|
513
521
|
* Returns a pair of SQL query string and parameter values for the query.
|
|
514
522
|
* @param {boolean} [exportAnnotatedSql] - returns annotated sql with not rendered params if true
|
|
515
523
|
* @returns {[string, Array<unknown>]}
|
|
516
524
|
*/
|
|
517
525
|
buildSqlAndParams(exportAnnotatedSql) {
|
|
518
|
-
if (
|
|
519
|
-
|
|
526
|
+
if (!this.options.preAggregationQuery && !this.options.disableExternalPreAggregations && this.externalQueryClass) {
|
|
527
|
+
if (this.externalPreAggregationQuery()) { // TODO performance
|
|
528
|
+
return this.externalQuery().buildSqlAndParams(exportAnnotatedSql);
|
|
529
|
+
}
|
|
520
530
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
531
|
+
if (this.useNativeSqlPlanner) {
|
|
532
|
+
let isRelatedToPreAggregation = false;
|
|
533
|
+
if (this.options.preAggregationQuery) {
|
|
534
|
+
isRelatedToPreAggregation = true;
|
|
535
|
+
}
|
|
536
|
+
else if (!this.options.disableExternalPreAggregations && this.externalQueryClass) {
|
|
537
|
+
if (this.externalPreAggregationQuery()) {
|
|
538
|
+
isRelatedToPreAggregation = true;
|
|
525
539
|
}
|
|
526
540
|
}
|
|
527
|
-
|
|
541
|
+
else {
|
|
542
|
+
let preAggForQuery = this.preAggregations.findPreAggregationForQuery();
|
|
543
|
+
if (this.options.disableExternalPreAggregations && preAggForQuery && preAggForQuery.preAggregation.external) {
|
|
544
|
+
preAggForQuery = undefined;
|
|
545
|
+
}
|
|
546
|
+
if (preAggForQuery) {
|
|
547
|
+
isRelatedToPreAggregation = true;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (isRelatedToPreAggregation) {
|
|
551
|
+
return this.newQueryWithoutNative().buildSqlAndParams(exportAnnotatedSql);
|
|
552
|
+
}
|
|
553
|
+
return this.buildSqlAndParamsRust(exportAnnotatedSql);
|
|
528
554
|
}
|
|
555
|
+
return this.compilers.compiler.withQuery(this, () => this.cacheValue(['buildSqlAndParams', exportAnnotatedSql], () => this.paramAllocator.buildSqlAndParams(this.buildParamAnnotatedSql(), exportAnnotatedSql, this.shouldReuseParams), { cache: this.queryCache }));
|
|
529
556
|
}
|
|
530
557
|
buildSqlAndParamsRust(exportAnnotatedSql) {
|
|
531
558
|
const order = this.options.order && ramda_1.default.pipe(ramda_1.default.map((hash) => ((!hash || !hash.id) ? null : hash)), ramda_1.default.reject(ramda_1.default.isNil))(this.options.order);
|
|
@@ -2332,6 +2359,7 @@ class BaseQuery {
|
|
|
2332
2359
|
return new QueryClass(this.compilers, this.subQueryOptions(options));
|
|
2333
2360
|
}
|
|
2334
2361
|
newSubQueryForCube(cube, options) {
|
|
2362
|
+
options = { ...options, useNativeSqlPlanner: false }; // We don't use tesseract for pre-aggregations generation yet
|
|
2335
2363
|
if (this.options.queryFactory) {
|
|
2336
2364
|
// When dealing with rollup joins, it's crucial to use the correct parameter allocator for the specific cube in use.
|
|
2337
2365
|
// By default, we'll use BaseQuery, but it's important to note that different databases (Oracle, PostgreSQL, MySQL, Druid, etc.)
|
|
@@ -2353,6 +2381,7 @@ class BaseQuery {
|
|
|
2353
2381
|
historyQueries: this.options.historyQueries,
|
|
2354
2382
|
externalQueryClass: this.options.externalQueryClass,
|
|
2355
2383
|
queryFactory: this.options.queryFactory,
|
|
2384
|
+
useNativeSqlPlanner: this.options.useNativeSqlPlanner,
|
|
2356
2385
|
...options,
|
|
2357
2386
|
};
|
|
2358
2387
|
}
|
|
@@ -2687,6 +2716,7 @@ class BaseQuery {
|
|
|
2687
2716
|
in: '{{ column }} IN ({{ values_concat }}){{ is_null_check }}',
|
|
2688
2717
|
not_in: '{{ column }} NOT IN ({{ values_concat }}){{ is_null_check }}',
|
|
2689
2718
|
time_range_filter: '{{ column }} >= {{ from_timestamp }} AND {{ column }} <= {{ to_timestamp }}',
|
|
2719
|
+
time_not_in_range_filter: '{{ column }} < {{ from_timestamp }} OR {{ column }} > {{ to_timestamp }}',
|
|
2690
2720
|
gt: '{{ column }} > {{ param }}',
|
|
2691
2721
|
gte: '{{ column }} >= {{ param }}',
|
|
2692
2722
|
lt: '{{ column }} < {{ param }}',
|
|
@@ -3127,6 +3157,16 @@ class BaseQuery {
|
|
|
3127
3157
|
const { allFilters } = this;
|
|
3128
3158
|
return BaseQuery.filterProxyFromAllFilters(allFilters, this.cubeEvaluator, this.paramAllocator.allocateParam.bind(this.paramAllocator), this.newGroupFilter.bind(this));
|
|
3129
3159
|
}
|
|
3160
|
+
filtersProxyForRust(usedFilters) {
|
|
3161
|
+
const filters = this.extractFiltersAsTree(usedFilters || []);
|
|
3162
|
+
const allFilters = filters.map(this.initFilter.bind(this));
|
|
3163
|
+
return BaseQuery.filterProxyFromAllFilters(allFilters, this.cubeEvaluator, this.paramAllocator.allocateParam.bind(this.paramAllocator), this.newGroupFilter.bind(this));
|
|
3164
|
+
}
|
|
3165
|
+
filterGroupFunctionForRust(usedFilters) {
|
|
3166
|
+
const filters = this.extractFiltersAsTree(usedFilters || []);
|
|
3167
|
+
const allFilters = filters.map(this.initFilter.bind(this));
|
|
3168
|
+
return this.filterGroupFunctionImpl(allFilters);
|
|
3169
|
+
}
|
|
3130
3170
|
static renderFilterParams(filter, filterParamArgs, allocateParam, newGroupFilter, aliases) {
|
|
3131
3171
|
if (!filter) {
|
|
3132
3172
|
return BaseFilter_1.BaseFilter.ALWAYS_TRUE;
|
|
@@ -3159,6 +3199,9 @@ class BaseQuery {
|
|
|
3159
3199
|
}
|
|
3160
3200
|
filterGroupFunction() {
|
|
3161
3201
|
const { allFilters } = this;
|
|
3202
|
+
return this.filterGroupFunctionImpl(allFilters);
|
|
3203
|
+
}
|
|
3204
|
+
filterGroupFunctionImpl(allFilters) {
|
|
3162
3205
|
const allocateParam = this.paramAllocator.allocateParam.bind(this.paramAllocator);
|
|
3163
3206
|
const newGroupFilter = this.newGroupFilter.bind(this);
|
|
3164
3207
|
return (...filterParamArgs) => {
|