@finos/legend-query-builder 4.14.20 → 4.14.22
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/QueryBuilderTesting.d.ts +1 -0
- package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderTesting.js +1 -0
- package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +2 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +132 -67
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.js +1 -0
- package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js +4 -2
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderResultState.d.ts +9 -4
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js +27 -4
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +4 -2
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +13 -2
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.d.ts +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.js +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +6 -3
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +7 -2
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js +46 -29
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -1
- package/package.json +6 -6
- package/src/__lib__/QueryBuilderTesting.ts +1 -0
- package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +2 -1
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +1 -0
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +232 -140
- package/src/components/result/QueryBuilderResultPanel.tsx +1 -1
- package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +4 -2
- package/src/stores/QueryBuilderResultState.ts +36 -7
- package/src/stores/QueryBuilderState.ts +19 -2
- package/src/stores/QueryBuilderStateHashUtils.ts +1 -1
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +16 -3
- package/src/stores/fetch-structure/tds/window/QueryBuilderWindowState.ts +70 -38
- package/src/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.ts +1 -1
@@ -31,6 +31,7 @@ import {
|
|
31
31
|
type ExecutionResult,
|
32
32
|
type RawLambda,
|
33
33
|
type EXECUTION_SERIALIZATION_FORMAT,
|
34
|
+
type QueryGridConfig,
|
34
35
|
GRAPH_MANAGER_EVENT,
|
35
36
|
buildRawLambdaFromLambdaFunction,
|
36
37
|
reportGraphAnalytics,
|
@@ -79,7 +80,9 @@ export interface QueryBuilderTDSResultCellCoordinate {
|
|
79
80
|
|
80
81
|
type QueryBuilderDataGridConfig = {
|
81
82
|
columns: DataGridColumnState[];
|
82
|
-
isPivotModeEnabled: boolean;
|
83
|
+
isPivotModeEnabled: boolean | undefined;
|
84
|
+
isLocalModeEnabled: boolean | undefined;
|
85
|
+
previewLimit?: number | undefined;
|
83
86
|
};
|
84
87
|
|
85
88
|
export class QueryBuilderResultState {
|
@@ -101,7 +104,7 @@ export class QueryBuilderResultState {
|
|
101
104
|
mousedOverCell: QueryBuilderTDSResultCellData | null = null;
|
102
105
|
isSelectingCells: boolean;
|
103
106
|
|
104
|
-
gridConfig
|
107
|
+
gridConfig: QueryBuilderDataGridConfig | undefined;
|
105
108
|
|
106
109
|
constructor(queryBuilderState: QueryBuilderState) {
|
107
110
|
makeObservable(this, {
|
@@ -128,6 +131,8 @@ export class QueryBuilderResultState {
|
|
128
131
|
setMouseOverCell: action,
|
129
132
|
setQueryRunPromise: action,
|
130
133
|
setIsQueryUsageViewerOpened: action,
|
134
|
+
handlePreConfiguredGridConfig: action,
|
135
|
+
updatePreviewLimitInConfig: action,
|
131
136
|
exportData: flow,
|
132
137
|
runQuery: flow,
|
133
138
|
cancelQuery: flow,
|
@@ -136,10 +141,7 @@ export class QueryBuilderResultState {
|
|
136
141
|
this.isSelectingCells = false;
|
137
142
|
|
138
143
|
this.selectedCells = [];
|
139
|
-
this.gridConfig =
|
140
|
-
columns: [],
|
141
|
-
isPivotModeEnabled: false,
|
142
|
-
};
|
144
|
+
this.gridConfig = undefined;
|
143
145
|
this.queryBuilderState = queryBuilderState;
|
144
146
|
this.executionPlanState = new ExecutionPlanState(
|
145
147
|
this.queryBuilderState.applicationStore,
|
@@ -147,7 +149,7 @@ export class QueryBuilderResultState {
|
|
147
149
|
);
|
148
150
|
}
|
149
151
|
|
150
|
-
setGridConfig(val: QueryBuilderDataGridConfig): void {
|
152
|
+
setGridConfig(val: QueryBuilderDataGridConfig | undefined): void {
|
151
153
|
this.gridConfig = val;
|
152
154
|
}
|
153
155
|
|
@@ -191,6 +193,33 @@ export class QueryBuilderResultState {
|
|
191
193
|
this.isQueryUsageViewerOpened = val;
|
192
194
|
}
|
193
195
|
|
196
|
+
updatePreviewLimitInConfig(): void {
|
197
|
+
if (this.gridConfig) {
|
198
|
+
this.gridConfig.previewLimit = this.previewLimit;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
handlePreConfiguredGridConfig(config: QueryGridConfig): void {
|
203
|
+
const newConfig = {
|
204
|
+
...config,
|
205
|
+
columns: config.columns as DataGridColumnState[],
|
206
|
+
};
|
207
|
+
if (config.previewLimit) {
|
208
|
+
this.setPreviewLimit(config.previewLimit);
|
209
|
+
}
|
210
|
+
this.setGridConfig(newConfig);
|
211
|
+
}
|
212
|
+
|
213
|
+
getQueryGridConfig(): QueryGridConfig | undefined {
|
214
|
+
if (this.gridConfig) {
|
215
|
+
return {
|
216
|
+
...this.gridConfig,
|
217
|
+
columns: this.gridConfig.columns as object[],
|
218
|
+
};
|
219
|
+
}
|
220
|
+
return undefined;
|
221
|
+
}
|
222
|
+
|
194
223
|
get checkForStaleResults(): boolean {
|
195
224
|
if (this.latestRunHashCode !== this.queryBuilderState.hashCode) {
|
196
225
|
return true;
|
@@ -53,6 +53,7 @@ import {
|
|
53
53
|
type GraphManagerState,
|
54
54
|
type ValueSpecification,
|
55
55
|
type Type,
|
56
|
+
type QueryGridConfig,
|
56
57
|
GRAPH_MANAGER_EVENT,
|
57
58
|
CompilationError,
|
58
59
|
extractSourceInformationCoordinates,
|
@@ -393,7 +394,10 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
393
394
|
);
|
394
395
|
}
|
395
396
|
|
396
|
-
resetQueryResult(options?: {
|
397
|
+
resetQueryResult(options?: {
|
398
|
+
preserveResult?: boolean | undefined;
|
399
|
+
gridConfig?: QueryGridConfig | undefined;
|
400
|
+
}): void {
|
397
401
|
const resultState = new QueryBuilderResultState(this);
|
398
402
|
resultState.setPreviewLimit(this.resultState.previewLimit);
|
399
403
|
if (options?.preserveResult) {
|
@@ -401,6 +405,10 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
401
405
|
resultState.setExecutionDuration(this.resultState.executionDuration);
|
402
406
|
resultState.latestRunHashCode = this.resultState.latestRunHashCode;
|
403
407
|
}
|
408
|
+
if (options?.gridConfig) {
|
409
|
+
this.isLocalModeEnabled = true;
|
410
|
+
resultState.handlePreConfiguredGridConfig(options.gridConfig);
|
411
|
+
}
|
404
412
|
this.resultState = resultState;
|
405
413
|
}
|
406
414
|
|
@@ -476,6 +484,14 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
476
484
|
return undefined;
|
477
485
|
}
|
478
486
|
|
487
|
+
getGridConfig(): QueryGridConfig | undefined {
|
488
|
+
// for now we will only save in local mode
|
489
|
+
if (this.isLocalModeEnabled && this.resultState.gridConfig) {
|
490
|
+
return this.resultState.getQueryGridConfig();
|
491
|
+
}
|
492
|
+
return undefined;
|
493
|
+
}
|
494
|
+
|
479
495
|
buildQuery(options?: { keepSourceInformation: boolean }): RawLambda {
|
480
496
|
if (!this.isQuerySupported) {
|
481
497
|
const parameters = this.parametersState.parameterStates.map((e) =>
|
@@ -552,11 +568,12 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
552
568
|
initializeWithQuery(
|
553
569
|
query: RawLambda,
|
554
570
|
defaultParameterValues?: Map<string, ValueSpecification>,
|
571
|
+
gridConfig?: QueryGridConfig,
|
555
572
|
): void {
|
556
573
|
this.rebuildWithQuery(query, {
|
557
574
|
defaultParameterValues,
|
558
575
|
});
|
559
|
-
this.resetQueryResult();
|
576
|
+
this.resetQueryResult({ gridConfig });
|
560
577
|
this.changeDetectionState.initialize(query);
|
561
578
|
this.changeHistoryState.initialize(query);
|
562
579
|
}
|
@@ -71,7 +71,7 @@ export enum QUERY_BUILDER_STATE_HASH_STRUCTURE {
|
|
71
71
|
// OLAPGroup state
|
72
72
|
TDS_WINDOW_GROUPBY_STATE = 'TDS_WINDOW_STATE',
|
73
73
|
TDS_WINDOW_GROUPBY_OPERATION_STATE = 'TDS_WINDOW_OPERATION_STATE',
|
74
|
-
|
74
|
+
TDS_WINDOW_GROUPBY_AGG_OPERATOR_STATE = 'TDS_WINDOW_AGG_OPERATOR_STATE',
|
75
75
|
TDS_WINDOW_COLUMN_STATE = 'TDS_WINDOW_COLUMN_STATE',
|
76
76
|
TDS_WINDOW_COLUMN_SORTBY_STATE = 'TDS_WINDOW_COLUMN_SORTBY_STATE',
|
77
77
|
TDS_WINDOW_OPERATOR_RANK = 'TDS_WINDOW_OPERATOR_RANK',
|
@@ -278,6 +278,7 @@ export class QueryBuilderTDSState
|
|
278
278
|
|
279
279
|
get fetchStructureValidationIssues(): string[] {
|
280
280
|
const validationIssues: string[] = [];
|
281
|
+
|
281
282
|
const hasInValidCalendarAggregateColumns =
|
282
283
|
this.aggregationState.columns.some(
|
283
284
|
(column) =>
|
@@ -289,6 +290,7 @@ export class QueryBuilderTDSState
|
|
289
290
|
'Query has calendar function with no date column specified',
|
290
291
|
);
|
291
292
|
}
|
293
|
+
|
292
294
|
const hasDuplicatedProjectionColumns = this.projectionColumns.some(
|
293
295
|
(column) =>
|
294
296
|
this.projectionColumns.filter((c) => c.columnName === column.columnName)
|
@@ -296,12 +298,23 @@ export class QueryBuilderTDSState
|
|
296
298
|
);
|
297
299
|
if (hasDuplicatedProjectionColumns) {
|
298
300
|
validationIssues.push('Query has duplicated projection columns');
|
299
|
-
return validationIssues;
|
300
301
|
}
|
301
|
-
|
302
|
+
|
303
|
+
const hasDuplicatedProjectionWindowColumns = this.projectionColumns.some(
|
304
|
+
(column) =>
|
305
|
+
this.windowState.windowColumns.filter(
|
306
|
+
(c) => c.columnName === column.columnName,
|
307
|
+
).length > 0,
|
308
|
+
);
|
309
|
+
if (hasDuplicatedProjectionWindowColumns) {
|
310
|
+
validationIssues.push('Query has duplicated projection/window columns');
|
311
|
+
}
|
312
|
+
|
313
|
+
const hasNoProjectionColumns =
|
314
|
+
this.projectionColumns.length === 0 &&
|
315
|
+
this.queryBuilderState.changeHistoryState.canUndo;
|
302
316
|
if (hasNoProjectionColumns) {
|
303
317
|
validationIssues.push('Query has no projection columns');
|
304
|
-
return validationIssues;
|
305
318
|
}
|
306
319
|
return validationIssues;
|
307
320
|
}
|
@@ -147,7 +147,7 @@ export class QueryBuilderTDS_WindowAggreationOperatorState extends QueryBuilderT
|
|
147
147
|
|
148
148
|
override get hashCode(): string {
|
149
149
|
return hashArray([
|
150
|
-
QUERY_BUILDER_STATE_HASH_STRUCTURE.
|
150
|
+
QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_GROUPBY_AGG_OPERATOR_STATE,
|
151
151
|
this.lambdaParameterName,
|
152
152
|
this.operator,
|
153
153
|
this.columnState.columnName,
|
@@ -162,21 +162,21 @@ export class QueryBuilderWindowColumnState
|
|
162
162
|
readonly windowState: QueryBuilderWindowState;
|
163
163
|
windowColumns: QueryBuilderTDSColumnState[] = [];
|
164
164
|
sortByState: WindowGroupByColumnSortByState | undefined;
|
165
|
-
|
165
|
+
operatorState: QueryBuilderTDS_WindowOperatorState;
|
166
166
|
columnName: string;
|
167
167
|
|
168
168
|
constructor(
|
169
169
|
windowState: QueryBuilderWindowState,
|
170
170
|
windowColumns: QueryBuilderTDSColumnState[],
|
171
171
|
sortType: WindowGroupByColumnSortByState | undefined,
|
172
|
-
|
172
|
+
operatorState: QueryBuilderTDS_WindowOperatorState,
|
173
173
|
columnName: string,
|
174
174
|
) {
|
175
175
|
super();
|
176
176
|
makeObservable(this, {
|
177
177
|
windowColumns: observable,
|
178
178
|
sortByState: observable,
|
179
|
-
|
179
|
+
operatorState: observable,
|
180
180
|
columnName: observable,
|
181
181
|
setOperatorState: observable,
|
182
182
|
setColumnName: action,
|
@@ -184,13 +184,14 @@ export class QueryBuilderWindowColumnState
|
|
184
184
|
changeWindow: action,
|
185
185
|
deleteWindow: action,
|
186
186
|
addWindow: action,
|
187
|
+
setWindows: action,
|
187
188
|
changeOperator: action,
|
188
189
|
changeSortBy: action,
|
189
190
|
});
|
190
191
|
this.windowState = windowState;
|
191
192
|
this.windowColumns = windowColumns;
|
192
193
|
this.sortByState = sortType;
|
193
|
-
this.
|
194
|
+
this.operatorState = operatorState;
|
194
195
|
this.columnName = columnName;
|
195
196
|
}
|
196
197
|
|
@@ -211,9 +212,9 @@ export class QueryBuilderWindowColumnState
|
|
211
212
|
|
212
213
|
get referencedTDSColumns(): QueryBuilderTDSColumnState[] {
|
213
214
|
const operatorReference =
|
214
|
-
this.
|
215
|
+
this.operatorState instanceof
|
215
216
|
QueryBuilderTDS_WindowAggreationOperatorState
|
216
|
-
? [this.
|
217
|
+
? [this.operatorState.columnState]
|
217
218
|
: [];
|
218
219
|
const soryByReference = this.sortByState
|
219
220
|
? [this.sortByState.columnState]
|
@@ -222,7 +223,7 @@ export class QueryBuilderWindowColumnState
|
|
222
223
|
}
|
223
224
|
|
224
225
|
getColumnType(): Type | undefined {
|
225
|
-
return this.
|
226
|
+
return this.operatorState.operator.getOperatorReturnType(
|
226
227
|
this.windowState.tdsState.queryBuilderState.graphManagerState.graph,
|
227
228
|
);
|
228
229
|
}
|
@@ -232,7 +233,7 @@ export class QueryBuilderWindowColumnState
|
|
232
233
|
}
|
233
234
|
|
234
235
|
setOperatorState(op: QueryBuilderTDS_WindowOperatorState): void {
|
235
|
-
this.
|
236
|
+
this.operatorState = op;
|
236
237
|
}
|
237
238
|
|
238
239
|
setSortBy(val: WindowGroupByColumnSortByState | undefined): void {
|
@@ -247,6 +248,10 @@ export class QueryBuilderWindowColumnState
|
|
247
248
|
addUniqueEntry(this.windowColumns, val);
|
248
249
|
}
|
249
250
|
|
251
|
+
setWindows(val: QueryBuilderTDSColumnState[]): void {
|
252
|
+
this.windowColumns = val;
|
253
|
+
}
|
254
|
+
|
250
255
|
deleteWindow(val: QueryBuilderTDSColumnState): void {
|
251
256
|
deleteEntry(this.windowColumns, val);
|
252
257
|
}
|
@@ -262,42 +267,58 @@ export class QueryBuilderWindowColumnState
|
|
262
267
|
return [];
|
263
268
|
}
|
264
269
|
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
if (currentOperator !==
|
273
|
-
if (
|
270
|
+
getChangeOperatorStateAndColumnName(
|
271
|
+
currentOperator: QueryBuilderTDS_WindowOperator,
|
272
|
+
currentColumn: QueryBuilderTDSColumnState | undefined,
|
273
|
+
newOperator: QueryBuilderTDS_WindowOperator,
|
274
|
+
):
|
275
|
+
| { operatorState: QueryBuilderTDS_WindowOperatorState; columnName: string }
|
276
|
+
| undefined {
|
277
|
+
if (currentOperator !== newOperator) {
|
278
|
+
if (newOperator.isColumnAggregator()) {
|
274
279
|
const compatibleAggCol =
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
: this.possibleAggregatedColumns(windowOp)[0];
|
280
|
+
currentColumn && newOperator.isCompatibleWithColumn(currentColumn)
|
281
|
+
? currentColumn
|
282
|
+
: this.possibleAggregatedColumns(newOperator)[0];
|
279
283
|
if (compatibleAggCol) {
|
280
|
-
|
281
|
-
new QueryBuilderTDS_WindowAggreationOperatorState(
|
284
|
+
return {
|
285
|
+
operatorState: new QueryBuilderTDS_WindowAggreationOperatorState(
|
282
286
|
this.windowState,
|
283
|
-
|
287
|
+
newOperator,
|
284
288
|
compatibleAggCol,
|
285
289
|
),
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
+
columnName: `${newOperator.getLabel()} of ${
|
291
|
+
compatibleAggCol.columnName
|
292
|
+
}`,
|
293
|
+
};
|
290
294
|
}
|
291
295
|
} else {
|
292
|
-
|
293
|
-
new QueryBuilderTDS_WindowRankOperatorState(
|
296
|
+
return {
|
297
|
+
operatorState: new QueryBuilderTDS_WindowRankOperatorState(
|
294
298
|
this.windowState,
|
295
|
-
|
299
|
+
newOperator,
|
296
300
|
),
|
297
|
-
|
298
|
-
|
301
|
+
columnName: `${newOperator.getLabel()}`,
|
302
|
+
};
|
299
303
|
}
|
300
304
|
}
|
305
|
+
return undefined;
|
306
|
+
}
|
307
|
+
|
308
|
+
changeOperator(windowOp: QueryBuilderTDS_WindowOperator): void {
|
309
|
+
const stateAndName = this.getChangeOperatorStateAndColumnName(
|
310
|
+
this.operatorState.operator,
|
311
|
+
this.operatorState instanceof
|
312
|
+
QueryBuilderTDS_WindowAggreationOperatorState
|
313
|
+
? this.operatorState.columnState
|
314
|
+
: undefined,
|
315
|
+
windowOp,
|
316
|
+
);
|
317
|
+
|
318
|
+
if (stateAndName) {
|
319
|
+
this.setOperatorState(stateAndName.operatorState);
|
320
|
+
this.setColumnName(stateAndName.columnName);
|
321
|
+
}
|
301
322
|
}
|
302
323
|
|
303
324
|
changeSortBy(sortOp: COLUMN_SORT_TYPE | undefined): void {
|
@@ -323,7 +344,7 @@ export class QueryBuilderWindowColumnState
|
|
323
344
|
QUERY_BUILDER_STATE_HASH_STRUCTURE.TDS_WINDOW_COLUMN_STATE,
|
324
345
|
hashArray(this.windowColumns),
|
325
346
|
this.sortByState ?? '',
|
326
|
-
this.
|
347
|
+
this.operatorState,
|
327
348
|
this.columnName,
|
328
349
|
]);
|
329
350
|
}
|
@@ -362,14 +383,14 @@ export class QueryBuilderWindowState implements Hashable {
|
|
362
383
|
const windowCols = this.windowColumns;
|
363
384
|
windowCols.forEach((item, index) => {
|
364
385
|
if (
|
365
|
-
item.
|
386
|
+
item.operatorState instanceof
|
366
387
|
QueryBuilderTDS_WindowAggreationOperatorState
|
367
388
|
) {
|
368
389
|
if (
|
369
|
-
item.
|
390
|
+
item.operatorState.columnState instanceof
|
370
391
|
QueryBuilderWindowColumnState
|
371
392
|
) {
|
372
|
-
const windowColumnName = item.
|
393
|
+
const windowColumnName = item.operatorState.columnState.columnName;
|
373
394
|
const hasExistingColumn = item.windowState.isColumnOrderValid(
|
374
395
|
windowColumnName,
|
375
396
|
index,
|
@@ -403,6 +424,17 @@ export class QueryBuilderWindowState implements Hashable {
|
|
403
424
|
if (hasDuplicatedWindowColumns) {
|
404
425
|
issues.push(`Query has duplicated window columns`);
|
405
426
|
}
|
427
|
+
|
428
|
+
const hasDuplicatedProjectionWindowColumns = this.windowColumns.some(
|
429
|
+
(column) =>
|
430
|
+
this.tdsState.projectionColumns.filter(
|
431
|
+
(c) => c.columnName === column.columnName,
|
432
|
+
).length > 0,
|
433
|
+
);
|
434
|
+
if (hasDuplicatedProjectionWindowColumns) {
|
435
|
+
issues.push('Query has duplicated projection/window columns');
|
436
|
+
}
|
437
|
+
|
406
438
|
return issues;
|
407
439
|
}
|
408
440
|
|
package/src/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.ts
CHANGED
@@ -77,7 +77,7 @@ const appendOLAPGroupByColumnState = (
|
|
77
77
|
}
|
78
78
|
|
79
79
|
// create olap operation expression
|
80
|
-
const operationState = olapGroupByColumnState.
|
80
|
+
const operationState = olapGroupByColumnState.operatorState;
|
81
81
|
const olapFunc = extractElementNameFromPath(operationState.operator.pureFunc);
|
82
82
|
const olapFuncExpression = new SimpleFunctionExpression(olapFunc);
|
83
83
|
olapFuncExpression.parametersValues = [
|