@finos/legend-query-builder 0.6.23 → 0.6.24
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +8 -5
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +1 -1
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +2 -2
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/QueryBuilder_TestID.d.ts +1 -1
- package/lib/components/QueryBuilder_TestID.d.ts.map +1 -1
- package/lib/components/QueryBuilder_TestID.js +1 -1
- package/lib/components/QueryBuilder_TestID.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +5 -5
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +3 -3
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
- package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.d.ts → QueryBuilderTDSWindowPanel.d.ts} +4 -4
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -0
- package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.js → QueryBuilderTDSWindowPanel.js} +94 -94
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -0
- package/lib/components/workflows/ClassQueryBuilder.js +1 -1
- package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
- package/lib/components/workflows/MappingQueryBuilder.js +1 -1
- package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.d.ts +14 -14
- package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.js +14 -14
- package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +6 -6
- package/lib/stores/QueryBuilderStateBuilder.js +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +2 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +2 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +6 -6
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +13 -13
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +2 -2
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +2 -2
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts → window/QueryBuilderWindowGroupByOperatorLoader.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js +36 -0
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.js.map +1 -0
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +91 -0
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByState.js → window/QueryBuilderWindowState.js} +55 -53
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts → window/QueryBuilderWindowStateBuilder.d.ts} +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js → window/QueryBuilderWindowStateBuilder.js} +10 -10
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts → window/QueryBuilderWindowValueSpecificationBuilder.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js → window/QueryBuilderWindowValueSpecificationBuilder.js} +5 -5
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.d.ts → window/operators/QueryBuilderTDS_WindowOperator.d.ts} +2 -2
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js → window/operators/QueryBuilderTDS_WindowOperator.js} +2 -2
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js.map +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts +25 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.js → window/operators/QueryBuilderTDS_WindowOperator_Average.js} +6 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.js → window/operators/QueryBuilderTDS_WindowOperator_Count.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.js → window/operators/QueryBuilderTDS_WindowOperator_Max.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.js → window/operators/QueryBuilderTDS_WindowOperator_Min.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.d.ts → window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.js → window/operators/QueryBuilderTDS_WindowOperator_Sum.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.js → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.js → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.js → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.d.ts → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.js → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js} +4 -4
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js.map +1 -0
- package/lib/stores/shared/LambdaParameterState.d.ts.map +1 -1
- package/lib/stores/shared/LambdaParameterState.js.map +1 -1
- package/package.json +13 -13
- package/src/components/QueryBuilder.tsx +16 -6
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +1 -1
- package/src/components/QueryBuilderParametersPanel.tsx +1 -1
- package/src/components/QueryBuilderSideBar.tsx +2 -2
- package/src/components/QueryBuilder_TestID.ts +1 -1
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +8 -8
- package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +6 -8
- package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel.tsx → QueryBuilderTDSWindowPanel.tsx} +166 -166
- package/src/components/workflows/ClassQueryBuilder.tsx +1 -1
- package/src/components/workflows/MappingQueryBuilder.tsx +1 -1
- package/src/graphManager/QueryBuilderHashUtils.ts +14 -14
- package/src/stores/QueryBuilderStateBuilder.ts +1 -1
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +4 -2
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +3 -1
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +16 -16
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +2 -2
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +2 -2
- package/src/stores/fetch-structure/tds/window/QueryBuilderWindowGroupByOperatorLoader.ts +39 -0
- package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByState.ts → window/QueryBuilderWindowState.ts} +83 -76
- package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.ts → window/QueryBuilderWindowStateBuilder.ts} +19 -19
- package/src/stores/fetch-structure/tds/{olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.ts → window/QueryBuilderWindowValueSpecificationBuilder.ts} +9 -9
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.ts → window/operators/QueryBuilderTDS_WindowOperator.ts} +1 -1
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.ts → window/operators/QueryBuilderTDS_WindowOperator_Average.ts} +5 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.ts → window/operators/QueryBuilderTDS_WindowOperator_Count.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.ts → window/operators/QueryBuilderTDS_WindowOperator_Max.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.ts → window/operators/QueryBuilderTDS_WindowOperator_Min.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.ts → window/operators/QueryBuilderTDS_WindowOperator_Sum.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.ts → window/operators/QueryBuilderTDS_WindowRankOperator_Rank.ts} +3 -3
- package/src/stores/fetch-structure/tds/{olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.ts → window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.ts} +3 -3
- package/src/stores/shared/LambdaParameterState.ts +1 -0
- package/tsconfig.json +15 -15
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +0 -1
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js +0 -36
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts +0 -91
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Average.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Count.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Max.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Min.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.d.ts +0 -25
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPOperator_Sum.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_AverageRank.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_DenseRank.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_Rank.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/operators/QueryBuilderTDS_OLAPRankOperator_RowNumber.js.map +0 -1
- package/src/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.ts +0 -39
@@ -157,7 +157,7 @@ const ClassQueryBuilderSetupPanelContent = observer(
|
|
157
157
|
filterOption={mappingFilterOption}
|
158
158
|
formatOptionLabel={getPackageableElementOptionFormatter({
|
159
159
|
darkMode: !applicationStore.TEMPORARY__isLightThemeEnabled,
|
160
|
-
|
160
|
+
graph: queryBuilderState.graphManagerState.graph,
|
161
161
|
})}
|
162
162
|
/>
|
163
163
|
</div>
|
@@ -151,7 +151,7 @@ const MappingQueryBuilderSetupPanelContent = observer(
|
|
151
151
|
filterOption={mappingFilterOption}
|
152
152
|
formatOptionLabel={getPackageableElementOptionFormatter({
|
153
153
|
darkMode: !applicationStore.TEMPORARY__isLightThemeEnabled,
|
154
|
-
|
154
|
+
graph: queryBuilderState.graphManagerState.graph,
|
155
155
|
})}
|
156
156
|
/>
|
157
157
|
</div>
|
@@ -67,20 +67,20 @@ export enum QUERY_BUILDER_HASH_STRUCTURE {
|
|
67
67
|
WATERMARK_STATE = 'WATERMARK_STATE',
|
68
68
|
|
69
69
|
// OLAPGroup state
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
70
|
+
TDS_WINDOW_GROUPBY_STATE = 'TDS_WINDOW_STATE',
|
71
|
+
TDS_WINDOW_GROUPBY_OPERATION_STATE = 'TDS_WINDOW_OPERATION_STATE',
|
72
|
+
TDS_WINDOW_GROUPBY_AGG_OPERATION_STATE = 'TDS_WINDOW_AGG_OPERATION_STATE',
|
73
|
+
TDS_WINDOW_COLUMN_STATE = 'TDS_WINDOW_COLUMN_STATE',
|
74
|
+
TDS_WINDOW_COLUMN_SORTBY_STATE = 'TDS_WINDOW_COLUMN_SORTBY_STATE',
|
75
|
+
TDS_WINDOW_OPERATOR_RANK = 'TDS_WINDOW_OPERATOR_RANK',
|
76
|
+
TDS_WINDOW_OPERATOR_AVERAGE_RANK = 'TDS_WINDOW_OPERATOR_AVERAGE_RANK',
|
77
|
+
TDS_WINDOW_OPERATOR_DENSE_RANK = 'TDS_WINDOW_OPERATOR_DENSE_RANK',
|
78
|
+
TDS_WINDOW_OPERATOR_ROW_NUMBER = 'TDS_WINDOW_OPERATOR_ROW_NUMBER',
|
79
|
+
TDS_WINDOW_OPERATOR_SUM = 'TDS_WINDOW_OPERATOR_SUM',
|
80
|
+
TDS_WINDOW_OPERATOR_MAX = 'TDS_WINDOW_OPERATOR_MAX',
|
81
|
+
TDS_WINDOW_OPERATOR_MIN = 'TDS_WINDOW_OPERATOR_MIN',
|
82
|
+
TDS_WINDOW_OPERATOR_COUNT = 'TDS_WINDOW_OPERATOR_COUNT',
|
83
|
+
TDS_WINDOW_OPERATOR_AVERAGE = 'TDS_WINDOW_OPERATOR_AVERAGE',
|
84
84
|
|
85
85
|
// filter state
|
86
86
|
FILTER_TREE_GROUP_NODE_DATA = 'FILTER_TREE_GROUP_NODE_DATA',
|
@@ -66,7 +66,7 @@ import {
|
|
66
66
|
} from './fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js';
|
67
67
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
|
68
68
|
import { LambdaParameterState } from './shared/LambdaParameterState.js';
|
69
|
-
import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/
|
69
|
+
import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js';
|
70
70
|
import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
|
71
71
|
import { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
|
72
72
|
|
@@ -132,7 +132,6 @@ export const buildLambdaFunction = (
|
|
132
132
|
_class,
|
133
133
|
Multiplicity.ONE,
|
134
134
|
);
|
135
|
-
|
136
135
|
lambdaFunction.expressionSequence[0] = getAllVersionsFunction;
|
137
136
|
} else {
|
138
137
|
// build getAll()
|
@@ -169,7 +168,10 @@ export const buildLambdaFunction = (
|
|
169
168
|
];
|
170
169
|
}
|
171
170
|
// build parameters
|
172
|
-
if (
|
171
|
+
if (
|
172
|
+
queryBuilderState.parametersState.parameterStates.length &&
|
173
|
+
!options?.useAllVersionsForMilestoning
|
174
|
+
) {
|
173
175
|
if (options?.isBuildingExecutionQuery) {
|
174
176
|
buildExecutionQueryFromLambdaFunction(
|
175
177
|
lambdaFunction,
|
@@ -102,7 +102,9 @@ export const buildPropertyExpressionChain = (
|
|
102
102
|
const name = currentExpression.func.value.name;
|
103
103
|
const property =
|
104
104
|
currentExpression.func.value._OWNER._generatedMilestonedProperties.find(
|
105
|
-
(e) =>
|
105
|
+
(e) =>
|
106
|
+
e.name ===
|
107
|
+
`${name}${MILESTONING_VERSION_PROPERTY_SUFFIX.ALL_VERSIONS}`,
|
106
108
|
);
|
107
109
|
if (property) {
|
108
110
|
propertyExpression_setFunc(
|
@@ -92,9 +92,9 @@ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecifi
|
|
92
92
|
import { appendProjection } from './projection/QueryBuilderProjectionValueSpecificationBuilder.js';
|
93
93
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graphManager/QueryBuilderSupportedFunctions.js';
|
94
94
|
import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../graphManager/QueryBuilderHashUtils.js';
|
95
|
-
import {
|
96
|
-
import type {
|
97
|
-
import {
|
95
|
+
import { QueryBuilderWindowState } from './window/QueryBuilderWindowState.js';
|
96
|
+
import type { QueryBuilderTDS_WindowOperator } from './window/operators/QueryBuilderTDS_WindowOperator.js';
|
97
|
+
import { getQueryBuilderCoreWindowOperators } from './window/QueryBuilderWindowGroupByOperatorLoader.js';
|
98
98
|
import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
|
99
99
|
|
100
100
|
export class QueryBuilderTDSState
|
@@ -103,19 +103,19 @@ export class QueryBuilderTDSState
|
|
103
103
|
{
|
104
104
|
readonly aggregationState: QueryBuilderAggregationState;
|
105
105
|
readonly postFilterState: QueryBuilderPostFilterState;
|
106
|
-
readonly
|
106
|
+
readonly windowState: QueryBuilderWindowState;
|
107
107
|
readonly resultSetModifierState: QueryResultSetModifierState;
|
108
108
|
projectionColumns: QueryBuilderProjectionColumnState[] = [];
|
109
109
|
isConvertDerivationProjectionObjects = false;
|
110
110
|
showPostFilterPanel = false;
|
111
|
-
|
111
|
+
showWindowFuncPanel = false;
|
112
112
|
|
113
113
|
postFilterOperators: QueryBuilderPostFilterOperator[] =
|
114
114
|
getQueryBuilderCorePostFilterOperators();
|
115
115
|
aggregationOperators: QueryBuilderAggregateOperator[] =
|
116
116
|
getQueryBuilderCoreAggregrationOperators();
|
117
|
-
|
118
|
-
|
117
|
+
windowFuncOperators: QueryBuilderTDS_WindowOperator[] =
|
118
|
+
getQueryBuilderCoreWindowOperators();
|
119
119
|
|
120
120
|
constructor(
|
121
121
|
queryBuilderState: QueryBuilderState,
|
@@ -127,7 +127,7 @@ export class QueryBuilderTDSState
|
|
127
127
|
projectionColumns: observable,
|
128
128
|
isConvertDerivationProjectionObjects: observable,
|
129
129
|
showPostFilterPanel: observable,
|
130
|
-
|
130
|
+
showWindowFuncPanel: observable,
|
131
131
|
TEMPORARY__showPostFetchStructurePanel: computed,
|
132
132
|
derivations: computed,
|
133
133
|
hasParserError: computed,
|
@@ -135,7 +135,7 @@ export class QueryBuilderTDSState
|
|
135
135
|
moveColumn: action,
|
136
136
|
replaceColumn: action,
|
137
137
|
setShowPostFilterPanel: action,
|
138
|
-
|
138
|
+
setShowWindowFuncPanel: action,
|
139
139
|
convertDerivationProjectionObjects: flow,
|
140
140
|
});
|
141
141
|
|
@@ -148,9 +148,9 @@ export class QueryBuilderTDSState
|
|
148
148
|
this,
|
149
149
|
this.aggregationOperators,
|
150
150
|
);
|
151
|
-
this.
|
151
|
+
this.windowState = new QueryBuilderWindowState(
|
152
152
|
this,
|
153
|
-
this.
|
153
|
+
this.windowFuncOperators,
|
154
154
|
);
|
155
155
|
}
|
156
156
|
|
@@ -173,7 +173,7 @@ export class QueryBuilderTDSState
|
|
173
173
|
override get TEMPORARY__showPostFetchStructurePanel(): boolean {
|
174
174
|
return (
|
175
175
|
this.queryBuilderState.filterState.showPanel ||
|
176
|
-
this.
|
176
|
+
this.showWindowFuncPanel ||
|
177
177
|
this.showPostFilterPanel
|
178
178
|
);
|
179
179
|
}
|
@@ -279,7 +279,7 @@ export class QueryBuilderTDSState
|
|
279
279
|
return [
|
280
280
|
...this.aggregationState.columns,
|
281
281
|
...projectionColumns,
|
282
|
-
...this.
|
282
|
+
...this.windowState.windowColumns,
|
283
283
|
];
|
284
284
|
}
|
285
285
|
|
@@ -293,7 +293,7 @@ export class QueryBuilderTDSState
|
|
293
293
|
return Boolean(
|
294
294
|
[
|
295
295
|
...this.postFilterState.referencedTDSColumns,
|
296
|
-
...this.
|
296
|
+
...this.windowState.referencedTDSColumns,
|
297
297
|
].find((col) => {
|
298
298
|
if (col instanceof QueryBuilderAggregateColumnState) {
|
299
299
|
return tdsCol instanceof QueryBuilderAggregateColumnState
|
@@ -320,8 +320,8 @@ export class QueryBuilderTDSState
|
|
320
320
|
this.showPostFilterPanel = val;
|
321
321
|
}
|
322
322
|
|
323
|
-
|
324
|
-
this.
|
323
|
+
setShowWindowFuncPanel(val: boolean): void {
|
324
|
+
this.showWindowFuncPanel = val;
|
325
325
|
}
|
326
326
|
|
327
327
|
*convertDerivationProjectionObjects(): GeneratorFn<void> {
|
package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
import { Multiplicity } from '@finos/legend-graph';
|
18
18
|
import { UnsupportedOperationError } from '@finos/legend-shared';
|
19
19
|
import { QueryBuilderAggregateColumnState } from '../../aggregation/QueryBuilderAggregationState.js';
|
20
|
-
import {
|
20
|
+
import { QueryBuilderWindowColumnState } from '../../window/QueryBuilderWindowState.js';
|
21
21
|
import { QueryBuilderSimpleProjectionColumnState } from '../../projection/QueryBuilderProjectionColumnState.js';
|
22
22
|
import type { QueryBuilderTDSColumnState } from '../../QueryBuilderTDSColumnState.js';
|
23
23
|
|
@@ -26,7 +26,7 @@ export const getColumnMultiplicity = (
|
|
26
26
|
): Multiplicity => {
|
27
27
|
if (
|
28
28
|
columnState instanceof QueryBuilderAggregateColumnState ||
|
29
|
-
columnState instanceof
|
29
|
+
columnState instanceof QueryBuilderWindowColumnState
|
30
30
|
) {
|
31
31
|
return Multiplicity.ONE;
|
32
32
|
} else if (columnState instanceof QueryBuilderSimpleProjectionColumnState) {
|
package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts
CHANGED
@@ -47,7 +47,7 @@ import {
|
|
47
47
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graphManager/QueryBuilderSupportedFunctions.js';
|
48
48
|
import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
|
49
49
|
import { buildPropertyExpressionChain } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
|
50
|
-
import { appendOLAPGroupByState } from '../
|
50
|
+
import { appendOLAPGroupByState } from '../window/QueryBuilderWindowValueSpecificationBuilder.js';
|
51
51
|
import { appendPostFilter } from '../post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js';
|
52
52
|
|
53
53
|
const buildSortExpression = (
|
@@ -370,7 +370,7 @@ export const appendProjection = (
|
|
370
370
|
}
|
371
371
|
|
372
372
|
// build olapGroupBy
|
373
|
-
appendOLAPGroupByState(tdsState.
|
373
|
+
appendOLAPGroupByState(tdsState.windowState, lambdaFunction);
|
374
374
|
|
375
375
|
// build post-filter
|
376
376
|
appendPostFilter(tdsState.postFilterState, lambdaFunction);
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import type { QueryBuilderTDS_WindowOperator } from './operators/QueryBuilderTDS_WindowOperator.js';
|
18
|
+
import { QueryBuilderTDS_WindowRankOperator_AverageRank } from './operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js';
|
19
|
+
import { QueryBuilderTDS_WindowRankOperator_DenseRank } from './operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js';
|
20
|
+
import { QueryBuilderTDS_WindowRankOperator_Rank } from './operators/QueryBuilderTDS_WindowRankOperator_Rank.js';
|
21
|
+
import { QueryBuilderTDS_WindowRankOperator_RowNumber } from './operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js';
|
22
|
+
import { QueryBuilderTDS_WindowOperator_Sum } from './operators/QueryBuilderTDS_WindowOperator_Sum.js';
|
23
|
+
import { QueryBuilderTDS_WindowOperator_Count } from './operators/QueryBuilderTDS_WindowOperator_Count.js';
|
24
|
+
import { QueryBuilderTDS_WindowOperator_Max } from './operators/QueryBuilderTDS_WindowOperator_Max.js';
|
25
|
+
import { QueryBuilderTDS_WindowOperator_Min } from './operators/QueryBuilderTDS_WindowOperator_Min.js';
|
26
|
+
import { QueryBuilderTDS_WindowOperator_Average } from './operators/QueryBuilderTDS_WindowOperator_Average.js';
|
27
|
+
|
28
|
+
export const getQueryBuilderCoreWindowOperators =
|
29
|
+
(): QueryBuilderTDS_WindowOperator[] => [
|
30
|
+
new QueryBuilderTDS_WindowOperator_Sum(),
|
31
|
+
new QueryBuilderTDS_WindowOperator_Count(),
|
32
|
+
new QueryBuilderTDS_WindowOperator_Max(),
|
33
|
+
new QueryBuilderTDS_WindowOperator_Min(),
|
34
|
+
new QueryBuilderTDS_WindowOperator_Average(),
|
35
|
+
new QueryBuilderTDS_WindowRankOperator_AverageRank(),
|
36
|
+
new QueryBuilderTDS_WindowRankOperator_DenseRank(),
|
37
|
+
new QueryBuilderTDS_WindowRankOperator_Rank(),
|
38
|
+
new QueryBuilderTDS_WindowRankOperator_RowNumber(),
|
39
|
+
];
|
@@ -30,19 +30,19 @@ import type { QueryBuilderProjectionColumnDragSource } from '../projection/Query
|
|
30
30
|
import { QueryBuilderTDSColumnState } from '../QueryBuilderTDSColumnState.js';
|
31
31
|
import type { QueryBuilderTDSState } from '../QueryBuilderTDSState.js';
|
32
32
|
import type { COLUMN_SORT_TYPE } from '../QueryResultSetModifierState.js';
|
33
|
-
import type {
|
33
|
+
import type { QueryBuilderTDS_WindowOperator } from './operators/QueryBuilderTDS_WindowOperator.js';
|
34
34
|
|
35
|
-
export const
|
35
|
+
export const QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE = 'WINDOW_COLUMN';
|
36
36
|
|
37
|
-
export interface
|
37
|
+
export interface QueryBuilderWindowColumnDragSource {
|
38
38
|
columnState: QueryBuilderTDSColumnState;
|
39
39
|
}
|
40
40
|
|
41
|
-
export type
|
41
|
+
export type QueryBuilderWindowDropTarget =
|
42
42
|
| QueryBuilderProjectionColumnDragSource
|
43
|
-
|
|
43
|
+
| QueryBuilderWindowColumnDragSource;
|
44
44
|
|
45
|
-
export class
|
45
|
+
export class WindowGroupByColumnSortByState implements Hashable {
|
46
46
|
columnState: QueryBuilderTDSColumnState;
|
47
47
|
sortType: COLUMN_SORT_TYPE;
|
48
48
|
|
@@ -71,23 +71,23 @@ export class OLAPGroupByColumnSortByState implements Hashable {
|
|
71
71
|
|
72
72
|
get hashCode(): string {
|
73
73
|
return hashArray([
|
74
|
-
QUERY_BUILDER_HASH_STRUCTURE.
|
74
|
+
QUERY_BUILDER_HASH_STRUCTURE.TDS_WINDOW_COLUMN_SORTBY_STATE,
|
75
75
|
this.sortType,
|
76
76
|
this.columnState.columnName,
|
77
77
|
]);
|
78
78
|
}
|
79
79
|
}
|
80
80
|
|
81
|
-
export abstract class
|
82
|
-
readonly
|
81
|
+
export abstract class QueryBuilderTDS_WindowOperatorState implements Hashable {
|
82
|
+
readonly windowState: QueryBuilderWindowState;
|
83
83
|
lambdaParameterName: string = DEFAULT_LAMBDA_VARIABLE_NAME;
|
84
|
-
operator:
|
84
|
+
operator: QueryBuilderTDS_WindowOperator;
|
85
85
|
|
86
86
|
constructor(
|
87
|
-
|
88
|
-
operator:
|
87
|
+
windowState: QueryBuilderWindowState,
|
88
|
+
operator: QueryBuilderTDS_WindowOperator,
|
89
89
|
) {
|
90
|
-
this.
|
90
|
+
this.windowState = windowState;
|
91
91
|
this.operator = operator;
|
92
92
|
}
|
93
93
|
|
@@ -95,39 +95,39 @@ export abstract class QueryBuilderTDS_OLAPOperatorState implements Hashable {
|
|
95
95
|
this.lambdaParameterName = paramName;
|
96
96
|
}
|
97
97
|
|
98
|
-
setOperator(val:
|
98
|
+
setOperator(val: QueryBuilderTDS_WindowOperator): void {
|
99
99
|
this.operator = val;
|
100
100
|
}
|
101
101
|
|
102
102
|
get hashCode(): string {
|
103
103
|
return hashArray([
|
104
|
-
QUERY_BUILDER_HASH_STRUCTURE.
|
104
|
+
QUERY_BUILDER_HASH_STRUCTURE.TDS_WINDOW_GROUPBY_OPERATION_STATE,
|
105
105
|
this.lambdaParameterName,
|
106
106
|
this.operator,
|
107
107
|
]);
|
108
108
|
}
|
109
109
|
}
|
110
110
|
|
111
|
-
export class
|
111
|
+
export class QueryBuilderTDS_WindowRankOperatorState extends QueryBuilderTDS_WindowOperatorState {
|
112
112
|
constructor(
|
113
|
-
|
114
|
-
operator:
|
113
|
+
windowState: QueryBuilderWindowState,
|
114
|
+
operator: QueryBuilderTDS_WindowOperator,
|
115
115
|
) {
|
116
|
-
super(
|
116
|
+
super(windowState, operator);
|
117
117
|
makeObservable(this, {
|
118
118
|
setLambdaParameterName: action,
|
119
119
|
});
|
120
120
|
}
|
121
121
|
}
|
122
122
|
|
123
|
-
export class
|
123
|
+
export class QueryBuilderTDS_WindowAggreationOperatorState extends QueryBuilderTDS_WindowOperatorState {
|
124
124
|
columnState: QueryBuilderTDSColumnState;
|
125
125
|
constructor(
|
126
|
-
|
127
|
-
operator:
|
126
|
+
windowState: QueryBuilderWindowState,
|
127
|
+
operator: QueryBuilderTDS_WindowOperator,
|
128
128
|
columnState: QueryBuilderTDSColumnState,
|
129
129
|
) {
|
130
|
-
super(
|
130
|
+
super(windowState, operator);
|
131
131
|
makeObservable(this, {
|
132
132
|
columnState: observable,
|
133
133
|
setColumnState: action,
|
@@ -142,7 +142,7 @@ export class QueryBuilderTDS_OLAPAggreationOperatorState extends QueryBuilderTDS
|
|
142
142
|
|
143
143
|
override get hashCode(): string {
|
144
144
|
return hashArray([
|
145
|
-
QUERY_BUILDER_HASH_STRUCTURE.
|
145
|
+
QUERY_BUILDER_HASH_STRUCTURE.TDS_WINDOW_GROUPBY_AGG_OPERATION_STATE,
|
146
146
|
this.lambdaParameterName,
|
147
147
|
this.operator,
|
148
148
|
this.columnState.columnName,
|
@@ -150,21 +150,21 @@ export class QueryBuilderTDS_OLAPAggreationOperatorState extends QueryBuilderTDS
|
|
150
150
|
}
|
151
151
|
}
|
152
152
|
|
153
|
-
export class
|
153
|
+
export class QueryBuilderWindowColumnState
|
154
154
|
extends QueryBuilderTDSColumnState
|
155
155
|
implements Hashable
|
156
156
|
{
|
157
|
-
readonly
|
157
|
+
readonly windowState: QueryBuilderWindowState;
|
158
158
|
windowColumns: QueryBuilderTDSColumnState[] = [];
|
159
|
-
sortByState:
|
160
|
-
operationState:
|
159
|
+
sortByState: WindowGroupByColumnSortByState | undefined;
|
160
|
+
operationState: QueryBuilderTDS_WindowOperatorState;
|
161
161
|
columnName: string;
|
162
162
|
|
163
163
|
constructor(
|
164
|
-
|
164
|
+
windowState: QueryBuilderWindowState,
|
165
165
|
windowColumns: QueryBuilderTDSColumnState[],
|
166
|
-
sortType:
|
167
|
-
operationState:
|
166
|
+
sortType: WindowGroupByColumnSortByState | undefined,
|
167
|
+
operationState: QueryBuilderTDS_WindowOperatorState,
|
168
168
|
columnName: string,
|
169
169
|
) {
|
170
170
|
super();
|
@@ -182,29 +182,32 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
182
182
|
changeOperator: action,
|
183
183
|
changeSortBy: action,
|
184
184
|
});
|
185
|
-
this.
|
185
|
+
this.windowState = windowState;
|
186
186
|
this.windowColumns = windowColumns;
|
187
187
|
this.sortByState = sortType;
|
188
188
|
this.operationState = operationState;
|
189
189
|
this.columnName = columnName;
|
190
190
|
}
|
191
191
|
|
192
|
-
get
|
193
|
-
return this.
|
192
|
+
get columnWindowGroupIdx(): number {
|
193
|
+
return this.windowState.windowColumns.findIndex((e) => e === this);
|
194
194
|
}
|
195
195
|
|
196
196
|
get possibleReferencedColumns(): QueryBuilderTDSColumnState[] {
|
197
|
-
// column can only reference TDS columns already defined, i.e in an earlier index of the
|
198
|
-
const idx = this.
|
197
|
+
// column can only reference TDS columns already defined, i.e in an earlier index of the window columns
|
198
|
+
const idx = this.windowState.tdsState.tdsColumns.findIndex(
|
199
|
+
(e) => e === this,
|
200
|
+
);
|
199
201
|
if (idx === -1) {
|
200
|
-
return this.
|
202
|
+
return this.windowState.tdsState.tdsColumns;
|
201
203
|
}
|
202
|
-
return this.
|
204
|
+
return this.windowState.tdsState.tdsColumns.slice(0, idx);
|
203
205
|
}
|
204
206
|
|
205
207
|
get referencedTDSColumns(): QueryBuilderTDSColumnState[] {
|
206
208
|
const operatorReference =
|
207
|
-
this.operationState instanceof
|
209
|
+
this.operationState instanceof
|
210
|
+
QueryBuilderTDS_WindowAggreationOperatorState
|
208
211
|
? [this.operationState.columnState]
|
209
212
|
: [];
|
210
213
|
const soryByReference = this.sortByState
|
@@ -215,7 +218,7 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
215
218
|
|
216
219
|
getColumnType(): Type | undefined {
|
217
220
|
return this.operationState.operator.getOperatorReturnType(
|
218
|
-
this.
|
221
|
+
this.windowState.tdsState.queryBuilderState.graphManagerState.graph,
|
219
222
|
);
|
220
223
|
}
|
221
224
|
|
@@ -223,11 +226,11 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
223
226
|
this.columnName = val;
|
224
227
|
}
|
225
228
|
|
226
|
-
setOperatorState(op:
|
229
|
+
setOperatorState(op: QueryBuilderTDS_WindowOperatorState): void {
|
227
230
|
this.operationState = op;
|
228
231
|
}
|
229
232
|
|
230
|
-
setSortBy(val:
|
233
|
+
setSortBy(val: WindowGroupByColumnSortByState | undefined): void {
|
231
234
|
this.sortByState = val;
|
232
235
|
}
|
233
236
|
|
@@ -244,7 +247,7 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
244
247
|
}
|
245
248
|
|
246
249
|
possibleAggregatedColumns(
|
247
|
-
op:
|
250
|
+
op: QueryBuilderTDS_WindowOperator,
|
248
251
|
): QueryBuilderTDSColumnState[] {
|
249
252
|
if (op.isColumnAggregator()) {
|
250
253
|
return this.possibleReferencedColumns.filter((col) =>
|
@@ -254,31 +257,35 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
254
257
|
return [];
|
255
258
|
}
|
256
259
|
|
257
|
-
changeOperator(
|
260
|
+
changeOperator(windowOp: QueryBuilderTDS_WindowOperator): void {
|
258
261
|
const currentOperator = this.operationState.operator;
|
259
262
|
const currentAggregateColumn =
|
260
|
-
this.operationState instanceof
|
263
|
+
this.operationState instanceof
|
264
|
+
QueryBuilderTDS_WindowAggreationOperatorState
|
261
265
|
? this.operationState.columnState
|
262
266
|
: undefined;
|
263
|
-
if (currentOperator !==
|
264
|
-
if (
|
267
|
+
if (currentOperator !== windowOp) {
|
268
|
+
if (windowOp.isColumnAggregator()) {
|
265
269
|
const compatibleAggCol =
|
266
270
|
currentAggregateColumn &&
|
267
|
-
|
271
|
+
windowOp.isCompatibleWithColumn(currentAggregateColumn)
|
268
272
|
? currentAggregateColumn
|
269
|
-
: this.possibleAggregatedColumns(
|
273
|
+
: this.possibleAggregatedColumns(windowOp)[0];
|
270
274
|
if (compatibleAggCol) {
|
271
275
|
this.setOperatorState(
|
272
|
-
new
|
273
|
-
this.
|
274
|
-
|
276
|
+
new QueryBuilderTDS_WindowAggreationOperatorState(
|
277
|
+
this.windowState,
|
278
|
+
windowOp,
|
275
279
|
compatibleAggCol,
|
276
280
|
),
|
277
281
|
);
|
278
282
|
}
|
279
283
|
} else {
|
280
284
|
this.setOperatorState(
|
281
|
-
new
|
285
|
+
new QueryBuilderTDS_WindowRankOperatorState(
|
286
|
+
this.windowState,
|
287
|
+
windowOp,
|
288
|
+
),
|
282
289
|
);
|
283
290
|
}
|
284
291
|
}
|
@@ -290,7 +297,7 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
290
297
|
if (sortOp) {
|
291
298
|
const sortInfoOpState =
|
292
299
|
sortByState ??
|
293
|
-
new
|
300
|
+
new WindowGroupByColumnSortByState(
|
294
301
|
guaranteeNonNullable(this.possibleReferencedColumns[0]),
|
295
302
|
sortOp,
|
296
303
|
);
|
@@ -304,7 +311,7 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
304
311
|
|
305
312
|
get hashCode(): string {
|
306
313
|
return hashArray([
|
307
|
-
QUERY_BUILDER_HASH_STRUCTURE.
|
314
|
+
QUERY_BUILDER_HASH_STRUCTURE.TDS_WINDOW_COLUMN_STATE,
|
308
315
|
hashArray(this.windowColumns),
|
309
316
|
this.sortByState ?? '',
|
310
317
|
this.operationState,
|
@@ -313,20 +320,20 @@ export class QueryBuilderOLAPGroupByColumnState
|
|
313
320
|
}
|
314
321
|
}
|
315
322
|
|
316
|
-
export class
|
323
|
+
export class QueryBuilderWindowState implements Hashable {
|
317
324
|
readonly tdsState: QueryBuilderTDSState;
|
318
|
-
|
319
|
-
operators:
|
320
|
-
editColumn:
|
325
|
+
windowColumns: QueryBuilderWindowColumnState[] = [];
|
326
|
+
operators: QueryBuilderTDS_WindowOperator[];
|
327
|
+
editColumn: QueryBuilderWindowColumnState | undefined;
|
321
328
|
|
322
329
|
constructor(
|
323
330
|
tdsState: QueryBuilderTDSState,
|
324
|
-
operators:
|
331
|
+
operators: QueryBuilderTDS_WindowOperator[],
|
325
332
|
) {
|
326
333
|
makeObservable(this, {
|
327
|
-
|
334
|
+
windowColumns: observable,
|
328
335
|
editColumn: observable,
|
329
|
-
|
336
|
+
addWindowColumn: action,
|
330
337
|
removeColumn: action,
|
331
338
|
moveColumn: action,
|
332
339
|
setEditColumn: action,
|
@@ -336,42 +343,42 @@ export class QueryBuilderOLAPGroupByState implements Hashable {
|
|
336
343
|
}
|
337
344
|
|
338
345
|
get isEmpty(): boolean {
|
339
|
-
return !this.
|
346
|
+
return !this.windowColumns.length;
|
340
347
|
}
|
341
348
|
|
342
349
|
get referencedTDSColumns(): QueryBuilderTDSColumnState[] {
|
343
|
-
return uniq(this.
|
350
|
+
return uniq(this.windowColumns.map((c) => c.referencedTDSColumns).flat());
|
344
351
|
}
|
345
352
|
|
346
|
-
setEditColumn(col:
|
353
|
+
setEditColumn(col: QueryBuilderWindowColumnState | undefined): void {
|
347
354
|
this.editColumn = col;
|
348
355
|
}
|
349
356
|
|
350
|
-
findOperator(func: string):
|
357
|
+
findOperator(func: string): QueryBuilderTDS_WindowOperator | undefined {
|
351
358
|
return this.operators.find((o) => matchFunctionName(func, o.pureFunc));
|
352
359
|
}
|
353
360
|
|
354
|
-
|
355
|
-
addUniqueEntry(this.
|
361
|
+
addWindowColumn(windowCol: QueryBuilderWindowColumnState): void {
|
362
|
+
addUniqueEntry(this.windowColumns, windowCol);
|
356
363
|
}
|
357
364
|
|
358
|
-
removeColumn(column:
|
359
|
-
deleteEntry(this.
|
365
|
+
removeColumn(column: QueryBuilderWindowColumnState): void {
|
366
|
+
deleteEntry(this.windowColumns, column);
|
360
367
|
}
|
361
368
|
|
362
369
|
moveColumn(fromIndex: number, toIndex: number): void {
|
363
|
-
const fromCol = this.
|
364
|
-
const toCol = this.
|
370
|
+
const fromCol = this.windowColumns[fromIndex];
|
371
|
+
const toCol = this.windowColumns[toIndex];
|
365
372
|
if (fromCol && toCol) {
|
366
|
-
this.
|
367
|
-
this.
|
373
|
+
this.windowColumns[fromIndex] = toCol;
|
374
|
+
this.windowColumns[toIndex] = fromCol;
|
368
375
|
}
|
369
376
|
}
|
370
377
|
|
371
378
|
get hashCode(): string {
|
372
379
|
return hashArray([
|
373
|
-
QUERY_BUILDER_HASH_STRUCTURE.
|
374
|
-
hashArray(this.
|
380
|
+
QUERY_BUILDER_HASH_STRUCTURE.TDS_WINDOW_GROUPBY_STATE,
|
381
|
+
hashArray(this.windowColumns),
|
375
382
|
]);
|
376
383
|
}
|
377
384
|
}
|