@cubejs-backend/schema-compiler 1.2.0 → 1.2.2
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 -5
- package/dist/src/adapter/BaseQuery.d.ts.map +1 -1
- package/dist/src/adapter/BaseQuery.js +44 -3
- package/dist/src/adapter/BaseQuery.js.map +1 -1
- package/dist/src/adapter/BaseTimeDimension.d.ts +5 -6
- package/dist/src/adapter/BaseTimeDimension.d.ts.map +1 -1
- package/dist/src/adapter/BaseTimeDimension.js +11 -5
- package/dist/src/adapter/BaseTimeDimension.js.map +1 -1
- package/dist/src/adapter/Granularity.d.ts +1 -0
- package/dist/src/adapter/Granularity.d.ts.map +1 -1
- package/dist/src/adapter/Granularity.js +19 -0
- package/dist/src/adapter/Granularity.js.map +1 -1
- package/dist/src/adapter/PreAggregations.d.ts +0 -2
- package/dist/src/adapter/PreAggregations.d.ts.map +1 -1
- package/dist/src/adapter/PreAggregations.js +12 -39
- package/dist/src/adapter/PreAggregations.js.map +1 -1
- package/dist/src/compiler/CubeEvaluator.d.ts +2 -1
- package/dist/src/compiler/CubeEvaluator.d.ts.map +1 -1
- package/dist/src/compiler/CubeEvaluator.js +5 -2
- package/dist/src/compiler/CubeEvaluator.js.map +1 -1
- package/dist/src/compiler/CubeSymbols.d.ts +9 -0
- package/dist/src/compiler/CubeSymbols.d.ts.map +1 -1
- package/dist/src/compiler/CubeSymbols.js +10 -7
- package/dist/src/compiler/CubeSymbols.js.map +1 -1
- package/dist/src/compiler/DataSchemaCompiler.d.ts +11 -5
- package/dist/src/compiler/DataSchemaCompiler.d.ts.map +1 -1
- package/dist/src/compiler/DataSchemaCompiler.js +62 -19
- package/dist/src/compiler/DataSchemaCompiler.js.map +1 -1
- package/dist/src/compiler/ErrorReporter.d.ts +4 -0
- package/dist/src/compiler/ErrorReporter.d.ts.map +1 -1
- package/dist/src/compiler/ErrorReporter.js +12 -0
- package/dist/src/compiler/ErrorReporter.js.map +1 -1
- package/dist/src/compiler/PrepareCompiler.d.ts.map +1 -1
- package/dist/src/compiler/PrepareCompiler.js +2 -0
- package/dist/src/compiler/PrepareCompiler.js.map +1 -1
- package/dist/src/compiler/transpilers/CubePropContextTranspiler.d.ts +5 -7
- package/dist/src/compiler/transpilers/CubePropContextTranspiler.d.ts.map +1 -1
- package/dist/src/compiler/transpilers/CubePropContextTranspiler.js.map +1 -1
- package/dist/src/compiler/transpilers/LightweightNodeCubeDictionary.d.ts +8 -0
- package/dist/src/compiler/transpilers/LightweightNodeCubeDictionary.d.ts.map +1 -0
- package/dist/src/compiler/transpilers/LightweightNodeCubeDictionary.js +17 -0
- package/dist/src/compiler/transpilers/LightweightNodeCubeDictionary.js.map +1 -0
- package/dist/src/compiler/transpilers/LightweightSymbolResolver.d.ts +11 -0
- package/dist/src/compiler/transpilers/LightweightSymbolResolver.d.ts.map +1 -0
- package/dist/src/compiler/transpilers/LightweightSymbolResolver.js +28 -0
- package/dist/src/compiler/transpilers/LightweightSymbolResolver.js.map +1 -0
- package/dist/src/compiler/transpilers/transpiler.interface.d.ts +7 -0
- package/dist/src/compiler/transpilers/transpiler.interface.d.ts.map +1 -1
- package/dist/src/compiler/transpilers/transpiler_worker.d.ts +2 -0
- package/dist/src/compiler/transpilers/transpiler_worker.d.ts.map +1 -0
- package/dist/src/compiler/transpilers/transpiler_worker.js +54 -0
- package/dist/src/compiler/transpilers/transpiler_worker.js.map +1 -0
- package/package.json +8 -7
|
@@ -181,7 +181,7 @@ export class BaseQuery {
|
|
|
181
181
|
* @returns {[string, Array<unknown>]}
|
|
182
182
|
*/
|
|
183
183
|
buildSqlAndParams(exportAnnotatedSql?: boolean | undefined): [string, Array<unknown>];
|
|
184
|
-
buildSqlAndParamsRust(exportAnnotatedSql: any):
|
|
184
|
+
buildSqlAndParamsRust(exportAnnotatedSql: any): any;
|
|
185
185
|
allCubeMembers(path: any): string[];
|
|
186
186
|
getAllocatedParams(): unknown[];
|
|
187
187
|
generateTimeSeries(granularity: any, dateRange: any): import("@cubejs-backend/shared").QueryDateRange[];
|
|
@@ -255,9 +255,7 @@ export class BaseQuery {
|
|
|
255
255
|
baseWhere(filters: any): string;
|
|
256
256
|
baseHaving(filters: any): string;
|
|
257
257
|
timeStampInClientTz(dateParam: any): string;
|
|
258
|
-
granularityHierarchies():
|
|
259
|
-
[index: string]: any;
|
|
260
|
-
};
|
|
258
|
+
granularityHierarchies(): any;
|
|
261
259
|
granularityParentHierarchy(granularity: any): any;
|
|
262
260
|
minGranularity(granularityA: any, granularityB: any): any;
|
|
263
261
|
overTimeSeriesQuery(baseQueryFn: any, cumulativeMeasure: any, fromRollup: any): any;
|
|
@@ -298,7 +296,8 @@ export class BaseQuery {
|
|
|
298
296
|
joinSql(toJoin: any): string;
|
|
299
297
|
/**
|
|
300
298
|
*
|
|
301
|
-
* @param {{sql: string, on: {cubeName: string, expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}}
|
|
299
|
+
* @param {{sql: string, on: {cubeName: string, expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}}
|
|
300
|
+
* customJoin
|
|
302
301
|
* @returns {JoinItem}
|
|
303
302
|
*/
|
|
304
303
|
customSubQueryJoin(customJoin: {
|
|
@@ -578,6 +577,9 @@ export class BaseQuery {
|
|
|
578
577
|
parametrizedContextSymbols(): any;
|
|
579
578
|
parametrizedContextSymbolsValue: any;
|
|
580
579
|
securityContextForRust(): any;
|
|
580
|
+
sqlUtilsForRust(): {
|
|
581
|
+
convertTz: (field: string) => string;
|
|
582
|
+
};
|
|
581
583
|
contextSymbolsProxy(symbols: any): any;
|
|
582
584
|
filtersProxy(): {};
|
|
583
585
|
filterGroupFunction(): (...filterParamArgs: any[]) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseQuery.d.ts","sourceRoot":"","sources":["../../../src/adapter/BaseQuery.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseQuery.d.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AAM;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;cAhBzC,OAAO;uBACE,aAAa"}
|
|
@@ -26,6 +26,7 @@ const BaseTimeDimension_1 = require("./BaseTimeDimension");
|
|
|
26
26
|
const ParamAllocator_1 = require("./ParamAllocator");
|
|
27
27
|
const PreAggregations_1 = require("./PreAggregations");
|
|
28
28
|
const SqlParser_1 = require("../parser/SqlParser");
|
|
29
|
+
const Granularity_1 = require("./Granularity");
|
|
29
30
|
const DEFAULT_PREAGGREGATIONS_SCHEMA = 'stb_pre_aggregations';
|
|
30
31
|
const standardGranularitiesParents = {
|
|
31
32
|
year: ['year', 'quarter', 'month', 'day', 'hour', 'minute', 'second'],
|
|
@@ -543,7 +544,16 @@ class BaseQuery {
|
|
|
543
544
|
baseTools: this,
|
|
544
545
|
ungrouped: this.options.ungrouped
|
|
545
546
|
};
|
|
546
|
-
const
|
|
547
|
+
const buildResult = (0, native_1.buildSqlAndParams)(queryParams);
|
|
548
|
+
if (buildResult.error) {
|
|
549
|
+
if (buildResult.error.cause && buildResult.error.cause === 'User') {
|
|
550
|
+
throw new UserError_1.UserError(buildResult.error.message);
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
throw new Error(buildResult.error.message);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
const res = buildResult.result;
|
|
547
557
|
// FIXME
|
|
548
558
|
res[1] = [...res[1]];
|
|
549
559
|
return res;
|
|
@@ -1060,7 +1070,30 @@ class BaseQuery {
|
|
|
1060
1070
|
return this.convertTz(dateParam);
|
|
1061
1071
|
}
|
|
1062
1072
|
granularityHierarchies() {
|
|
1063
|
-
return
|
|
1073
|
+
return this.cacheValue(
|
|
1074
|
+
// If time dimension custom granularity in data model is defined without
|
|
1075
|
+
// timezone information they are treated in query timezone.
|
|
1076
|
+
// Because of that it's not possible to correctly precalculate
|
|
1077
|
+
// granularities hierarchies on startup as they are specific for each timezone.
|
|
1078
|
+
['granularityHierarchies', this.timezone], () => ramda_1.default.reduce((hierarchies, cube) => ramda_1.default.reduce((acc, [tdName, td]) => {
|
|
1079
|
+
const dimensionKey = `${cube}.${tdName}`;
|
|
1080
|
+
// constructing standard granularities for time dimension
|
|
1081
|
+
const standardEntries = ramda_1.default.fromPairs(ramda_1.default.keys(standardGranularitiesParents).map(gr => [
|
|
1082
|
+
`${dimensionKey}.${gr}`,
|
|
1083
|
+
standardGranularitiesParents[gr],
|
|
1084
|
+
]));
|
|
1085
|
+
// If we have custom granularities in time dimension
|
|
1086
|
+
const customEntries = td.granularities
|
|
1087
|
+
? ramda_1.default.fromPairs(ramda_1.default.keys(td.granularities).map(granularityName => {
|
|
1088
|
+
const grObj = new Granularity_1.Granularity(this, { dimension: dimensionKey, granularity: granularityName });
|
|
1089
|
+
return [
|
|
1090
|
+
`${dimensionKey}.${granularityName}`,
|
|
1091
|
+
[granularityName, ...standardGranularitiesParents[grObj.minGranularity()]],
|
|
1092
|
+
];
|
|
1093
|
+
}))
|
|
1094
|
+
: {};
|
|
1095
|
+
return { ...acc, ...standardEntries, ...customEntries };
|
|
1096
|
+
}, hierarchies, ramda_1.default.toPairs(this.cubeEvaluator.timeDimensionsForCube(cube))), {}, ramda_1.default.keys(this.cubeEvaluator.evaluatedCubes)));
|
|
1064
1097
|
}
|
|
1065
1098
|
granularityParentHierarchy(granularity) {
|
|
1066
1099
|
return standardGranularitiesParents[granularity];
|
|
@@ -1248,7 +1281,8 @@ class BaseQuery {
|
|
|
1248
1281
|
}
|
|
1249
1282
|
/**
|
|
1250
1283
|
*
|
|
1251
|
-
* @param {{sql: string, on: {cubeName: string, expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}}
|
|
1284
|
+
* @param {{sql: string, on: {cubeName: string, expression: Function}, joinType: 'LEFT' | 'INNER', alias: string}}
|
|
1285
|
+
* customJoin
|
|
1252
1286
|
* @returns {JoinItem}
|
|
1253
1287
|
*/
|
|
1254
1288
|
customSubQueryJoin(customJoin) {
|
|
@@ -2593,6 +2627,7 @@ class BaseQuery {
|
|
|
2593
2627
|
sort: '{{ expr }} {% if asc %}ASC{% else %}DESC{% endif %} NULLS {% if nulls_first %}FIRST{% else %}LAST{% endif %}',
|
|
2594
2628
|
order_by: '{% if index %} {{ index }} {% else %} {{ expr }} {% endif %} {% if asc %}ASC{% else %}DESC{% endif %}{% if nulls_first %} NULLS FIRST{% endif %}',
|
|
2595
2629
|
cast: 'CAST({{ expr }} AS {{ data_type }})',
|
|
2630
|
+
cast_to_string: 'CAST({{ expr }} AS TEXT)',
|
|
2596
2631
|
window_function: '{{ fun_call }} OVER ({% if partition_by_concat %}PARTITION BY {{ partition_by_concat }}{% if order_by_concat or window_frame %} {% endif %}{% endif %}{% if order_by_concat %}ORDER BY {{ order_by_concat }}{% if window_frame %} {% endif %}{% endif %}{% if window_frame %}{{ window_frame }}{% endif %})',
|
|
2597
2632
|
window_frame_bounds: '{{ frame_type }} BETWEEN {{ frame_start }} AND {{ frame_end }}',
|
|
2598
2633
|
in_list: '{{ expr }} {% if negated %}NOT {% endif %}IN ({{ in_exprs_concat }})',
|
|
@@ -2609,6 +2644,7 @@ class BaseQuery {
|
|
|
2609
2644
|
like: '{{ expr }} {% if negated %}NOT {% endif %}LIKE {{ pattern }}',
|
|
2610
2645
|
ilike: '{{ expr }} {% if negated %}NOT {% endif %}ILIKE {{ pattern }}',
|
|
2611
2646
|
like_escape: '{{ like_expr }} ESCAPE {{ escape_char }}',
|
|
2647
|
+
concat_strings: '{{ strings | join(\' || \' ) }}',
|
|
2612
2648
|
},
|
|
2613
2649
|
filters: {
|
|
2614
2650
|
equals: '{{ column }} = {{ value }}{{ is_null_check }}',
|
|
@@ -2971,6 +3007,11 @@ class BaseQuery {
|
|
|
2971
3007
|
securityContextForRust() {
|
|
2972
3008
|
return this.contextSymbolsProxy(this.contextSymbols.securityContext);
|
|
2973
3009
|
}
|
|
3010
|
+
sqlUtilsForRust() {
|
|
3011
|
+
return {
|
|
3012
|
+
convertTz: this.convertTz.bind(this)
|
|
3013
|
+
};
|
|
3014
|
+
}
|
|
2974
3015
|
contextSymbolsProxy(symbols) {
|
|
2975
3016
|
return BaseQuery.contextSymbolsProxyFrom(symbols, this.paramAllocator.allocateParam.bind(this.paramAllocator));
|
|
2976
3017
|
}
|