@finos/legend-data-cube 0.0.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/LICENSE +201 -0
- package/README.md +3 -0
- package/lib/application/DataCubeDocumentation.d.ts +22 -0
- package/lib/application/DataCubeDocumentation.d.ts.map +1 -0
- package/lib/application/DataCubeDocumentation.js +23 -0
- package/lib/application/DataCubeDocumentation.js.map +1 -0
- package/lib/components/DataCube.d.ts +19 -0
- package/lib/components/DataCube.d.ts.map +1 -0
- package/lib/components/DataCube.js +67 -0
- package/lib/components/DataCube.js.map +1 -0
- package/lib/components/DataCubeProvider.d.ts +27 -0
- package/lib/components/DataCubeProvider.d.ts.map +1 -0
- package/lib/components/DataCubeProvider.js +34 -0
- package/lib/components/DataCubeProvider.js.map +1 -0
- package/lib/components/application/DataCubeAlert.d.ts +44 -0
- package/lib/components/application/DataCubeAlert.d.ts.map +1 -0
- package/lib/components/application/DataCubeAlert.js +83 -0
- package/lib/components/application/DataCubeAlert.js.map +1 -0
- package/lib/components/application/DataCubeDocumentationPanel.d.ts +19 -0
- package/lib/components/application/DataCubeDocumentationPanel.d.ts.map +1 -0
- package/lib/components/application/DataCubeDocumentationPanel.js +32 -0
- package/lib/components/application/DataCubeDocumentationPanel.js.map +1 -0
- package/lib/components/application/DataCubeLayoutManager.d.ts +27 -0
- package/lib/components/application/DataCubeLayoutManager.d.ts.map +1 -0
- package/lib/components/application/DataCubeLayoutManager.js +116 -0
- package/lib/components/application/DataCubeLayoutManager.js.map +1 -0
- package/lib/components/application/DataCubeSettingsPanel.d.ts +19 -0
- package/lib/components/application/DataCubeSettingsPanel.d.ts.map +1 -0
- package/lib/components/application/DataCubeSettingsPanel.js +53 -0
- package/lib/components/application/DataCubeSettingsPanel.js.map +1 -0
- package/lib/components/editor/DataCubeEditor.d.ts +22 -0
- package/lib/components/editor/DataCubeEditor.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditor.js +51 -0
- package/lib/components/editor/DataCubeEditor.js.map +1 -0
- package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.d.ts +22 -0
- package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.js +274 -0
- package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -0
- package/lib/components/editor/DataCubeEditorColumnsPanel.d.ts +22 -0
- package/lib/components/editor/DataCubeEditorColumnsPanel.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorColumnsPanel.js +35 -0
- package/lib/components/editor/DataCubeEditorColumnsPanel.js.map +1 -0
- package/lib/components/editor/DataCubeEditorColumnsSelector.d.ts +32 -0
- package/lib/components/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorColumnsSelector.js +307 -0
- package/lib/components/editor/DataCubeEditorColumnsSelector.js.map +1 -0
- package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.d.ts +22 -0
- package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.js +167 -0
- package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -0
- package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.d.ts +22 -0
- package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.js +29 -0
- package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.js.map +1 -0
- package/lib/components/editor/DataCubeEditorSortsPanel.d.ts +22 -0
- package/lib/components/editor/DataCubeEditorSortsPanel.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorSortsPanel.js +62 -0
- package/lib/components/editor/DataCubeEditorSortsPanel.js.map +1 -0
- package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.d.ts +22 -0
- package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.d.ts.map +1 -0
- package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.js +25 -0
- package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.js.map +1 -0
- package/lib/components/extend/DataCubeColumnEditor.d.ts +22 -0
- package/lib/components/extend/DataCubeColumnEditor.d.ts.map +1 -0
- package/lib/components/extend/DataCubeColumnEditor.js +169 -0
- package/lib/components/extend/DataCubeColumnEditor.js.map +1 -0
- package/lib/components/filter/DataCubeFilterEditor.d.ts +22 -0
- package/lib/components/filter/DataCubeFilterEditor.d.ts.map +1 -0
- package/lib/components/filter/DataCubeFilterEditor.js +312 -0
- package/lib/components/filter/DataCubeFilterEditor.js.map +1 -0
- package/lib/components/grid/DataCubeGrid.d.ts +27 -0
- package/lib/components/grid/DataCubeGrid.d.ts.map +1 -0
- package/lib/components/grid/DataCubeGrid.js +241 -0
- package/lib/components/grid/DataCubeGrid.js.map +1 -0
- package/lib/components/grid/DataCubeGridShared.d.ts +18 -0
- package/lib/components/grid/DataCubeGridShared.d.ts.map +1 -0
- package/lib/components/grid/DataCubeGridShared.js +25 -0
- package/lib/components/grid/DataCubeGridShared.js.map +1 -0
- package/lib/components/shared/DataCubeFormUtils.d.ts +54 -0
- package/lib/components/shared/DataCubeFormUtils.d.ts.map +1 -0
- package/lib/components/shared/DataCubeFormUtils.js +251 -0
- package/lib/components/shared/DataCubeFormUtils.js.map +1 -0
- package/lib/components/shared/DataCubePureCodeEditorUtils.d.ts +22 -0
- package/lib/components/shared/DataCubePureCodeEditorUtils.d.ts.map +1 -0
- package/lib/components/shared/DataCubePureCodeEditorUtils.js +64 -0
- package/lib/components/shared/DataCubePureCodeEditorUtils.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/package.json +89 -0
- package/lib/stores/DataCubeState.d.ts +32 -0
- package/lib/stores/DataCubeState.d.ts.map +1 -0
- package/lib/stores/DataCubeState.js +84 -0
- package/lib/stores/DataCubeState.js.map +1 -0
- package/lib/stores/DataCubeViewState.d.ts +50 -0
- package/lib/stores/DataCubeViewState.d.ts.map +1 -0
- package/lib/stores/DataCubeViewState.js +109 -0
- package/lib/stores/DataCubeViewState.js.map +1 -0
- package/lib/stores/core/DataCubeConfiguration.d.ts +107 -0
- package/lib/stores/core/DataCubeConfiguration.d.ts.map +1 -0
- package/lib/stores/core/DataCubeConfiguration.js +185 -0
- package/lib/stores/core/DataCubeConfiguration.js.map +1 -0
- package/lib/stores/core/DataCubeConfigurationBuilder.d.ts +25 -0
- package/lib/stores/core/DataCubeConfigurationBuilder.d.ts.map +1 -0
- package/lib/stores/core/DataCubeConfigurationBuilder.js +50 -0
- package/lib/stores/core/DataCubeConfigurationBuilder.js.map +1 -0
- package/lib/stores/core/DataCubeInfoState.d.ts +33 -0
- package/lib/stores/core/DataCubeInfoState.d.ts.map +1 -0
- package/lib/stores/core/DataCubeInfoState.js +48 -0
- package/lib/stores/core/DataCubeInfoState.js.map +1 -0
- package/lib/stores/core/DataCubeQueryBuilder.d.ts +35 -0
- package/lib/stores/core/DataCubeQueryBuilder.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQueryBuilder.js +130 -0
- package/lib/stores/core/DataCubeQueryBuilder.js.map +1 -0
- package/lib/stores/core/DataCubeQueryBuilderUtils.d.ts +50 -0
- package/lib/stores/core/DataCubeQueryBuilderUtils.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQueryBuilderUtils.js +320 -0
- package/lib/stores/core/DataCubeQueryBuilderUtils.js.map +1 -0
- package/lib/stores/core/DataCubeQueryEngine.d.ts +224 -0
- package/lib/stores/core/DataCubeQueryEngine.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQueryEngine.js +286 -0
- package/lib/stores/core/DataCubeQueryEngine.js.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshot.d.ts +89 -0
- package/lib/stores/core/DataCubeQuerySnapshot.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshot.js +82 -0
- package/lib/stores/core/DataCubeQuerySnapshot.js.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.d.ts +33 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.js +260 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.js.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.d.ts +30 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.js +125 -0
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.js.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshotManager.d.ts +47 -0
- package/lib/stores/core/DataCubeQuerySnapshotManager.d.ts.map +1 -0
- package/lib/stores/core/DataCubeQuerySnapshotManager.js +84 -0
- package/lib/stores/core/DataCubeQuerySnapshotManager.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.d.ts +28 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.js +25 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.js +47 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.js +44 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.js +53 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.js +44 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.js +44 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.js.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.d.ts +27 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.d.ts.map +1 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.js +39 -0
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterEditorState.d.ts +36 -0
- package/lib/stores/core/filter/DataCubeQueryFilterEditorState.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterEditorState.js +153 -0
- package/lib/stores/core/filter/DataCubeQueryFilterEditorState.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.d.ts +32 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.js +48 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.js +59 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.js +59 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.js +136 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.js +65 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.js +67 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.js +67 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.d.ts +31 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.d.ts +31 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.js +67 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.js +67 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.js +59 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.js +59 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.js +69 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.js +65 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.js +59 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.js +59 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.js.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.d.ts +34 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.d.ts.map +1 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.js +64 -0
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.d.ts +37 -0
- package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.js +68 -0
- package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorColumnsPanelState.d.ts +58 -0
- package/lib/stores/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorColumnsPanelState.js +127 -0
- package/lib/stores/editor/DataCubeEditorColumnsPanelState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorColumnsSelectorState.d.ts +42 -0
- package/lib/stores/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorColumnsSelectorState.js +75 -0
- package/lib/stores/editor/DataCubeEditorColumnsSelectorState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts +35 -0
- package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.js +59 -0
- package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts +38 -0
- package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.js +75 -0
- package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorMutableConfiguration.d.ts +107 -0
- package/lib/stores/editor/DataCubeEditorMutableConfiguration.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorMutableConfiguration.js +467 -0
- package/lib/stores/editor/DataCubeEditorMutableConfiguration.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorPanelState.d.ts +29 -0
- package/lib/stores/editor/DataCubeEditorPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorPanelState.js +17 -0
- package/lib/stores/editor/DataCubeEditorPanelState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorSortsPanelState.d.ts +41 -0
- package/lib/stores/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorSortsPanelState.js +86 -0
- package/lib/stores/editor/DataCubeEditorSortsPanelState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorState.d.ts +64 -0
- package/lib/stores/editor/DataCubeEditorState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorState.js +155 -0
- package/lib/stores/editor/DataCubeEditorState.js.map +1 -0
- package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.d.ts +35 -0
- package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.d.ts.map +1 -0
- package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.js +58 -0
- package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.js.map +1 -0
- package/lib/stores/engine/DataCubeApplicationEngine.d.ts +55 -0
- package/lib/stores/engine/DataCubeApplicationEngine.d.ts.map +1 -0
- package/lib/stores/engine/DataCubeApplicationEngine.js +33 -0
- package/lib/stores/engine/DataCubeApplicationEngine.js.map +1 -0
- package/lib/stores/engine/DataCubeEngine.d.ts +124 -0
- package/lib/stores/engine/DataCubeEngine.d.ts.map +1 -0
- package/lib/stores/engine/DataCubeEngine.js +182 -0
- package/lib/stores/engine/DataCubeEngine.js.map +1 -0
- package/lib/stores/engine/DataCubeLayoutManagerState.d.ts +62 -0
- package/lib/stores/engine/DataCubeLayoutManagerState.d.ts.map +1 -0
- package/lib/stores/engine/DataCubeLayoutManagerState.js +133 -0
- package/lib/stores/engine/DataCubeLayoutManagerState.js.map +1 -0
- package/lib/stores/engine/DataCubeQuery.d.ts +40 -0
- package/lib/stores/engine/DataCubeQuery.d.ts.map +1 -0
- package/lib/stores/engine/DataCubeQuery.js +79 -0
- package/lib/stores/engine/DataCubeQuery.js.map +1 -0
- package/lib/stores/extend/DataCubeColumnEditorState.d.ts +61 -0
- package/lib/stores/extend/DataCubeColumnEditorState.d.ts.map +1 -0
- package/lib/stores/extend/DataCubeColumnEditorState.js +260 -0
- package/lib/stores/extend/DataCubeColumnEditorState.js.map +1 -0
- package/lib/stores/extend/DataCubeExtendManagerState.d.ts +46 -0
- package/lib/stores/extend/DataCubeExtendManagerState.d.ts.map +1 -0
- package/lib/stores/extend/DataCubeExtendManagerState.js +119 -0
- package/lib/stores/extend/DataCubeExtendManagerState.js.map +1 -0
- package/lib/stores/filter/DataCubeFilterEditorState.d.ts +61 -0
- package/lib/stores/filter/DataCubeFilterEditorState.d.ts.map +1 -0
- package/lib/stores/filter/DataCubeFilterEditorState.js +228 -0
- package/lib/stores/filter/DataCubeFilterEditorState.js.map +1 -0
- package/lib/stores/grid/DataCubeGridClientEngine.d.ts +93 -0
- package/lib/stores/grid/DataCubeGridClientEngine.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridClientEngine.js +364 -0
- package/lib/stores/grid/DataCubeGridClientEngine.js.map +1 -0
- package/lib/stores/grid/DataCubeGridClientExportEngine.d.ts +31 -0
- package/lib/stores/grid/DataCubeGridClientExportEngine.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridClientExportEngine.js +152 -0
- package/lib/stores/grid/DataCubeGridClientExportEngine.js.map +1 -0
- package/lib/stores/grid/DataCubeGridConfigurationBuilder.d.ts +180 -0
- package/lib/stores/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridConfigurationBuilder.js +649 -0
- package/lib/stores/grid/DataCubeGridConfigurationBuilder.js.map +1 -0
- package/lib/stores/grid/DataCubeGridControllerState.d.ts +89 -0
- package/lib/stores/grid/DataCubeGridControllerState.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridControllerState.js +342 -0
- package/lib/stores/grid/DataCubeGridControllerState.js.map +1 -0
- package/lib/stores/grid/DataCubeGridMenuBuilder.d.ts +19 -0
- package/lib/stores/grid/DataCubeGridMenuBuilder.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridMenuBuilder.js +687 -0
- package/lib/stores/grid/DataCubeGridMenuBuilder.js.map +1 -0
- package/lib/stores/grid/DataCubeGridQueryBuilder.d.ts +23 -0
- package/lib/stores/grid/DataCubeGridQueryBuilder.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridQueryBuilder.js +130 -0
- package/lib/stores/grid/DataCubeGridQueryBuilder.js.map +1 -0
- package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.d.ts +27 -0
- package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.js +66 -0
- package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -0
- package/lib/stores/grid/DataCubeGridState.d.ts +55 -0
- package/lib/stores/grid/DataCubeGridState.d.ts.map +1 -0
- package/lib/stores/grid/DataCubeGridState.js +114 -0
- package/lib/stores/grid/DataCubeGridState.js.map +1 -0
- package/package.json +89 -0
- package/src/application/DataCubeDocumentation.ts +22 -0
- package/src/components/DataCube.tsx +157 -0
- package/src/components/DataCubeProvider.tsx +58 -0
- package/src/components/application/DataCubeAlert.tsx +173 -0
- package/src/components/application/DataCubeDocumentationPanel.tsx +42 -0
- package/src/components/application/DataCubeLayoutManager.tsx +190 -0
- package/src/components/application/DataCubeSettingsPanel.tsx +205 -0
- package/src/components/editor/DataCubeEditor.tsx +114 -0
- package/src/components/editor/DataCubeEditorColumnPropertiesPanel.tsx +1210 -0
- package/src/components/editor/DataCubeEditorColumnsPanel.tsx +121 -0
- package/src/components/editor/DataCubeEditorColumnsSelector.tsx +596 -0
- package/src/components/editor/DataCubeEditorGeneralPropertiesPanel.tsx +786 -0
- package/src/components/editor/DataCubeEditorHorizontalPivotsPanel.tsx +61 -0
- package/src/components/editor/DataCubeEditorSortsPanel.tsx +166 -0
- package/src/components/editor/DataCubeEditorVerticalPivotsPanel.tsx +43 -0
- package/src/components/extend/DataCubeColumnEditor.tsx +366 -0
- package/src/components/filter/DataCubeFilterEditor.tsx +907 -0
- package/src/components/grid/DataCubeGrid.tsx +384 -0
- package/src/components/grid/DataCubeGridShared.tsx +45 -0
- package/src/components/shared/DataCubeFormUtils.tsx +574 -0
- package/src/components/shared/DataCubePureCodeEditorUtils.tsx +91 -0
- package/src/index.tsx +22 -0
- package/src/stores/DataCubeState.tsx +100 -0
- package/src/stores/DataCubeViewState.ts +129 -0
- package/src/stores/core/DataCubeConfiguration.ts +240 -0
- package/src/stores/core/DataCubeConfigurationBuilder.ts +66 -0
- package/src/stores/core/DataCubeInfoState.ts +61 -0
- package/src/stores/core/DataCubeQueryBuilder.ts +296 -0
- package/src/stores/core/DataCubeQueryBuilderUtils.ts +514 -0
- package/src/stores/core/DataCubeQueryEngine.ts +327 -0
- package/src/stores/core/DataCubeQuerySnapshot.ts +191 -0
- package/src/stores/core/DataCubeQuerySnapshotBuilder.ts +406 -0
- package/src/stores/core/DataCubeQuerySnapshotBuilderUtils.ts +197 -0
- package/src/stores/core/DataCubeQuerySnapshotManager.ts +148 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation.ts +47 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.tsx +52 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.tsx +61 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__First.tsx +57 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.tsx +81 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.tsx +57 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.tsx +52 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.tsx +52 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.tsx +55 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.tsx +52 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.tsx +52 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.tsx +57 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.tsx +52 -0
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.tsx +52 -0
- package/src/stores/core/filter/DataCubeQueryFilterEditorState.ts +231 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation.ts +96 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__Contain.tsx +88 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.tsx +94 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EndWith.tsx +88 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.tsx +94 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__Equal.tsx +170 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.tsx +94 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.tsx +92 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.tsx +93 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.tsx +96 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.tsx +92 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.tsx +96 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.tsx +92 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.tsx +92 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__IsNull.tsx +89 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThan.tsx +96 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.tsx +92 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.tsx +96 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.tsx +92 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotContain.tsx +91 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.tsx +91 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.tsx +101 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.tsx +97 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.tsx +95 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.tsx +96 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.tsx +91 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__StartWith.tsx +88 -0
- package/src/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.tsx +94 -0
- package/src/stores/editor/DataCubeEditorColumnPropertiesPanelState.ts +111 -0
- package/src/stores/editor/DataCubeEditorColumnsPanelState.ts +198 -0
- package/src/stores/editor/DataCubeEditorColumnsSelectorState.ts +115 -0
- package/src/stores/editor/DataCubeEditorGeneralPropertiesPanelState.ts +87 -0
- package/src/stores/editor/DataCubeEditorHorizontalPivotsPanelState.ts +132 -0
- package/src/stores/editor/DataCubeEditorMutableConfiguration.ts +677 -0
- package/src/stores/editor/DataCubeEditorPanelState.ts +37 -0
- package/src/stores/editor/DataCubeEditorSortsPanelState.ts +147 -0
- package/src/stores/editor/DataCubeEditorState.tsx +206 -0
- package/src/stores/editor/DataCubeEditorVerticalPivotsPanelState.ts +110 -0
- package/src/stores/engine/DataCubeApplicationEngine.tsx +120 -0
- package/src/stores/engine/DataCubeEngine.ts +276 -0
- package/src/stores/engine/DataCubeLayoutManagerState.ts +184 -0
- package/src/stores/engine/DataCubeQuery.ts +130 -0
- package/src/stores/extend/DataCubeColumnEditorState.tsx +365 -0
- package/src/stores/extend/DataCubeExtendManagerState.tsx +175 -0
- package/src/stores/filter/DataCubeFilterEditorState.tsx +327 -0
- package/src/stores/grid/DataCubeGridClientEngine.ts +506 -0
- package/src/stores/grid/DataCubeGridClientExportEngine.ts +173 -0
- package/src/stores/grid/DataCubeGridConfigurationBuilder.tsx +940 -0
- package/src/stores/grid/DataCubeGridControllerState.ts +493 -0
- package/src/stores/grid/DataCubeGridMenuBuilder.tsx +861 -0
- package/src/stores/grid/DataCubeGridQueryBuilder.ts +195 -0
- package/src/stores/grid/DataCubeGridQuerySnapshotBuilder.ts +125 -0
- package/src/stores/grid/DataCubeGridState.ts +155 -0
- package/tsconfig.json +164 -0
|
@@ -0,0 +1,406 @@
|
|
|
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
|
+
/***************************************************************************************
|
|
18
|
+
* [CORE]
|
|
19
|
+
*
|
|
20
|
+
* This and its corresponding utilitites are used to build the query snapshot from the
|
|
21
|
+
* executable query. This is needed when we initialize the application by loading a
|
|
22
|
+
* persisted query.
|
|
23
|
+
***************************************************************************************/
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
V1_AppliedFunction,
|
|
27
|
+
V1_CInteger,
|
|
28
|
+
type V1_ColSpec,
|
|
29
|
+
V1_Collection,
|
|
30
|
+
V1_serializeValueSpecification,
|
|
31
|
+
extractElementNameFromPath as _name,
|
|
32
|
+
matchFunctionName,
|
|
33
|
+
type V1_ValueSpecification,
|
|
34
|
+
} from '@finos/legend-graph';
|
|
35
|
+
import type { DataCubeQuery } from '../engine/DataCubeQuery.js';
|
|
36
|
+
import {
|
|
37
|
+
_toCol,
|
|
38
|
+
DataCubeQuerySnapshot,
|
|
39
|
+
type DataCubeQuerySnapshotColumn,
|
|
40
|
+
} from './DataCubeQuerySnapshot.js';
|
|
41
|
+
import { assertType, guaranteeNonNullable } from '@finos/legend-shared';
|
|
42
|
+
import {
|
|
43
|
+
DataCubeQuerySortOperator,
|
|
44
|
+
DataCubeFunction,
|
|
45
|
+
type DataCubeQueryFunctionMap,
|
|
46
|
+
} from './DataCubeQueryEngine.js';
|
|
47
|
+
import { DataCubeConfiguration } from './DataCubeConfiguration.js';
|
|
48
|
+
import { buildDefaultConfiguration } from './DataCubeConfigurationBuilder.js';
|
|
49
|
+
import {
|
|
50
|
+
_colSpecArrayParam,
|
|
51
|
+
_colSpecParam,
|
|
52
|
+
_funcMatch,
|
|
53
|
+
_param,
|
|
54
|
+
} from './DataCubeQuerySnapshotBuilderUtils.js';
|
|
55
|
+
|
|
56
|
+
// --------------------------------- BUILDING BLOCKS ---------------------------------
|
|
57
|
+
|
|
58
|
+
const _SUPPORTED_TOP_LEVEL_FUNCTIONS: {
|
|
59
|
+
func: string;
|
|
60
|
+
parameters: number;
|
|
61
|
+
}[] = [
|
|
62
|
+
{ func: DataCubeFunction.EXTEND, parameters: 1 },
|
|
63
|
+
{ func: DataCubeFunction.FILTER, parameters: 1 },
|
|
64
|
+
{ func: DataCubeFunction.SELECT, parameters: 1 },
|
|
65
|
+
{ func: DataCubeFunction.GROUP_BY, parameters: 3 },
|
|
66
|
+
{ func: DataCubeFunction.PIVOT, parameters: 3 },
|
|
67
|
+
{ func: DataCubeFunction.CAST, parameters: 1 },
|
|
68
|
+
{ func: DataCubeFunction.SORT, parameters: 1 },
|
|
69
|
+
{ func: DataCubeFunction.LIMIT, parameters: 1 },
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
type FunctionSequenceCompositionNodePattern = {
|
|
73
|
+
name: string;
|
|
74
|
+
repeat?: boolean | undefined;
|
|
75
|
+
required?: boolean | undefined;
|
|
76
|
+
};
|
|
77
|
+
type FunctionSequenceCompositionSimpleNodePattern =
|
|
78
|
+
FunctionSequenceCompositionNodePattern & {
|
|
79
|
+
func: string;
|
|
80
|
+
};
|
|
81
|
+
type FunctionSequenceCompositionGroupNodePattern =
|
|
82
|
+
FunctionSequenceCompositionNodePattern & {
|
|
83
|
+
funcs: FunctionSequenceCompositionSimpleNodePattern[];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// NOTE: this corresponds to the sequence:
|
|
87
|
+
// extend()->filter()->select()->sort()->pivot()->cast()->groupBy()->extend()->sort()->limit()
|
|
88
|
+
// which represents the ONLY query shape that we currently support
|
|
89
|
+
const _FUNCTION_SEQUENCE_COMPOSITION_PATTERN: (
|
|
90
|
+
| FunctionSequenceCompositionSimpleNodePattern
|
|
91
|
+
| FunctionSequenceCompositionGroupNodePattern
|
|
92
|
+
)[] = [
|
|
93
|
+
{ name: 'leaf_extend', func: DataCubeFunction.EXTEND }, // leaf-level extend
|
|
94
|
+
{ name: 'filter', func: DataCubeFunction.FILTER },
|
|
95
|
+
{ name: 'select', func: DataCubeFunction.SELECT },
|
|
96
|
+
{
|
|
97
|
+
name: 'pivot_group',
|
|
98
|
+
funcs: [
|
|
99
|
+
{ name: 'pivot_sort', func: DataCubeFunction.SORT, required: true }, // pre-pivot sort
|
|
100
|
+
{ name: 'pivot', func: DataCubeFunction.PIVOT, required: true },
|
|
101
|
+
{ name: 'pivot_cast', func: DataCubeFunction.CAST, required: true }, // cast to a relation type post pivot() to enable type-checking
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
{ name: 'group_by', func: DataCubeFunction.GROUP_BY },
|
|
105
|
+
{ name: 'group_extend', func: DataCubeFunction.EXTEND }, // group-level extend
|
|
106
|
+
{ name: 'sort', func: DataCubeFunction.SORT },
|
|
107
|
+
{ name: 'limit', func: DataCubeFunction.LIMIT },
|
|
108
|
+
];
|
|
109
|
+
const _FUNCTION_SEQUENCE_COMPOSITION_PATTERN_REGEXP = new RegExp(
|
|
110
|
+
`^${_FUNCTION_SEQUENCE_COMPOSITION_PATTERN
|
|
111
|
+
.map((node) =>
|
|
112
|
+
'funcs' in node
|
|
113
|
+
? `(${node.funcs.map(
|
|
114
|
+
(childNode) =>
|
|
115
|
+
`(?<${childNode.name}><${_name(childNode.func)}>)${childNode.repeat ? '*' : !childNode.required ? '?' : ''}`,
|
|
116
|
+
)})${node.repeat ? '*' : !node.required ? '?' : ''}`
|
|
117
|
+
: `(?<${node.name}><${_name(node.func)}>)${node.repeat ? '*' : !node.required ? '?' : ''}`,
|
|
118
|
+
)
|
|
119
|
+
.join('')}$`,
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
type FunctionSequenceMatchingResult = {
|
|
123
|
+
sequence: V1_AppliedFunction[];
|
|
124
|
+
leafExtend: boolean;
|
|
125
|
+
pivot: boolean;
|
|
126
|
+
groupExtend: boolean;
|
|
127
|
+
sort: boolean;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Since the query created by DataCube will be a chain call of various functions,
|
|
131
|
+
* this utility function will extract that sequence of function calls as well as
|
|
132
|
+
* do various basic checks for the validity, composition, and order of those functions.
|
|
133
|
+
*/
|
|
134
|
+
function extractQueryFunctionSequence(
|
|
135
|
+
query: V1_ValueSpecification,
|
|
136
|
+
): FunctionSequenceMatchingResult {
|
|
137
|
+
// Make sure this is a sequence of function calls
|
|
138
|
+
if (!(query instanceof V1_AppliedFunction)) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
`Query must be a sequence of function calls (e.g. x()->y()->z())`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const sequence: V1_AppliedFunction[] = [];
|
|
144
|
+
let currentFunc = query;
|
|
145
|
+
while (currentFunc instanceof V1_AppliedFunction) {
|
|
146
|
+
const supportedFunc = _SUPPORTED_TOP_LEVEL_FUNCTIONS.find((spec) =>
|
|
147
|
+
matchFunctionName(currentFunc.function, spec.func),
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// Check that all functions in sequence are supported
|
|
151
|
+
if (!supportedFunc) {
|
|
152
|
+
throw new Error(`Found unsupported function ${currentFunc.function}()`);
|
|
153
|
+
}
|
|
154
|
+
if (currentFunc.parameters.length > supportedFunc.parameters) {
|
|
155
|
+
const vs = currentFunc.parameters[0];
|
|
156
|
+
if (!(vs instanceof V1_AppliedFunction)) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`Query must be a sequence of function calls (e.g. x()->y()->z())`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
currentFunc.parameters = currentFunc.parameters.slice(1);
|
|
162
|
+
sequence.unshift(currentFunc);
|
|
163
|
+
currentFunc = vs;
|
|
164
|
+
} else {
|
|
165
|
+
sequence.unshift(currentFunc);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Check that sequence follows the supported pattern
|
|
171
|
+
const sequenceFormText = sequence
|
|
172
|
+
.map((func) => `<${_name(func.function)}>`)
|
|
173
|
+
.join('');
|
|
174
|
+
const matchResult = sequenceFormText.match(
|
|
175
|
+
_FUNCTION_SEQUENCE_COMPOSITION_PATTERN_REGEXP,
|
|
176
|
+
);
|
|
177
|
+
if (!matchResult) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
`Unsupported function composition ${sequence.map((fn) => `${_name(fn.function)}()`).join('->')} (supported composition: ${_FUNCTION_SEQUENCE_COMPOSITION_PATTERN.map((node) => `${'funcs' in node ? `[${node.funcs.map((childNode) => `${_name(childNode.func)}()`).join('->')}]` : `${_name(node.func)}()`}`).join('->')})`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
sequence,
|
|
185
|
+
leafExtend: Boolean(matchResult.groups?.leaf_extend),
|
|
186
|
+
pivot: Boolean(matchResult.groups?.pivot),
|
|
187
|
+
groupExtend: Boolean(matchResult.groups?.group_extend),
|
|
188
|
+
sort: Boolean(matchResult.groups?.sort),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Turn the function sequence into a map of available functions
|
|
194
|
+
* for easier construction of the snapshot
|
|
195
|
+
*/
|
|
196
|
+
function extractFunctionMap(
|
|
197
|
+
sequenceMatchingResult: FunctionSequenceMatchingResult,
|
|
198
|
+
): DataCubeQueryFunctionMap {
|
|
199
|
+
const {
|
|
200
|
+
sequence,
|
|
201
|
+
leafExtend: hasLeafExtend,
|
|
202
|
+
groupExtend: hasGroupExtend,
|
|
203
|
+
pivot: hasPivot,
|
|
204
|
+
sort: hasSort,
|
|
205
|
+
} = sequenceMatchingResult;
|
|
206
|
+
const leafExtend = hasLeafExtend
|
|
207
|
+
? sequence.find((func) =>
|
|
208
|
+
matchFunctionName(func.function, DataCubeFunction.EXTEND),
|
|
209
|
+
)
|
|
210
|
+
: undefined;
|
|
211
|
+
const filter = sequence.find((func) =>
|
|
212
|
+
matchFunctionName(func.function, DataCubeFunction.FILTER),
|
|
213
|
+
);
|
|
214
|
+
const select = sequence.find((func) =>
|
|
215
|
+
matchFunctionName(func.function, DataCubeFunction.SELECT),
|
|
216
|
+
);
|
|
217
|
+
const pivotSort = hasPivot
|
|
218
|
+
? sequence.find((func) =>
|
|
219
|
+
matchFunctionName(func.function, DataCubeFunction.SORT),
|
|
220
|
+
)
|
|
221
|
+
: undefined;
|
|
222
|
+
const pivot = hasPivot
|
|
223
|
+
? sequence.find((func) =>
|
|
224
|
+
matchFunctionName(func.function, DataCubeFunction.PIVOT),
|
|
225
|
+
)
|
|
226
|
+
: undefined;
|
|
227
|
+
const pivotCast = hasPivot
|
|
228
|
+
? sequence.find((func) =>
|
|
229
|
+
matchFunctionName(func.function, DataCubeFunction.CAST),
|
|
230
|
+
)
|
|
231
|
+
: undefined;
|
|
232
|
+
const groupBy = sequence.find((func) =>
|
|
233
|
+
matchFunctionName(func.function, DataCubeFunction.GROUP_BY),
|
|
234
|
+
);
|
|
235
|
+
const groupExtend = hasGroupExtend
|
|
236
|
+
? sequence.find((func) =>
|
|
237
|
+
matchFunctionName(func.function, DataCubeFunction.EXTEND),
|
|
238
|
+
)
|
|
239
|
+
: undefined;
|
|
240
|
+
const sort = hasSort
|
|
241
|
+
? sequence.find((func) =>
|
|
242
|
+
matchFunctionName(func.function, DataCubeFunction.SORT),
|
|
243
|
+
)
|
|
244
|
+
: undefined;
|
|
245
|
+
const limit = sequence.find((func) =>
|
|
246
|
+
matchFunctionName(func.function, DataCubeFunction.LIMIT),
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
return {
|
|
250
|
+
leafExtend: leafExtend,
|
|
251
|
+
select,
|
|
252
|
+
filter,
|
|
253
|
+
groupBy,
|
|
254
|
+
pivotSort,
|
|
255
|
+
pivot,
|
|
256
|
+
pivotCast,
|
|
257
|
+
groupExtend,
|
|
258
|
+
sort,
|
|
259
|
+
limit,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// --------------------------------- MAIN ---------------------------------
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Analyze the partial query to build a query snapshot.
|
|
267
|
+
*
|
|
268
|
+
* Implementation-wise, this extracts the function call sequence, then walk the
|
|
269
|
+
* sequence in order to fill in the information for the snapshot.
|
|
270
|
+
*/
|
|
271
|
+
export function validateAndBuildQuerySnapshot(
|
|
272
|
+
partialQuery: V1_ValueSpecification,
|
|
273
|
+
sourceQuery: V1_ValueSpecification,
|
|
274
|
+
baseQuery: DataCubeQuery,
|
|
275
|
+
) {
|
|
276
|
+
// --------------------------------- BASE ---------------------------------
|
|
277
|
+
// Build the function call sequence and the function map to make the
|
|
278
|
+
// analysis more ergonomic
|
|
279
|
+
|
|
280
|
+
const sequenceMatchingResult = extractQueryFunctionSequence(partialQuery);
|
|
281
|
+
const funcMap = extractFunctionMap(sequenceMatchingResult);
|
|
282
|
+
const snapshot = DataCubeQuerySnapshot.create(
|
|
283
|
+
baseQuery.name,
|
|
284
|
+
baseQuery.source.runtime,
|
|
285
|
+
baseQuery.source.mapping,
|
|
286
|
+
V1_serializeValueSpecification(sourceQuery, []),
|
|
287
|
+
{},
|
|
288
|
+
);
|
|
289
|
+
const data = snapshot.data;
|
|
290
|
+
const colsMap = new Map<string, DataCubeQuerySnapshotColumn>();
|
|
291
|
+
const _col = (colSpec: V1_ColSpec) => {
|
|
292
|
+
const column = guaranteeNonNullable(
|
|
293
|
+
colsMap.get(colSpec.name),
|
|
294
|
+
`Can't find column '${colSpec.name}'`,
|
|
295
|
+
);
|
|
296
|
+
return _toCol(column);
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// --------------------------------- SOURCE ---------------------------------
|
|
300
|
+
|
|
301
|
+
data.sourceColumns = baseQuery.source.columns.map(_toCol);
|
|
302
|
+
data.sourceColumns.map((col) => colsMap.set(col.name, col));
|
|
303
|
+
|
|
304
|
+
// --------------------------------- LEAF-LEVEL EXTEND ---------------------------------
|
|
305
|
+
/** TODO: @datacube roundtrip */
|
|
306
|
+
|
|
307
|
+
// --------------------------------- FILTER ---------------------------------
|
|
308
|
+
|
|
309
|
+
if (funcMap.filter) {
|
|
310
|
+
/** TODO: @datacube roundtrip */
|
|
311
|
+
data.filter = undefined;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// --------------------------------- SELECT ---------------------------------
|
|
315
|
+
|
|
316
|
+
if (funcMap.select) {
|
|
317
|
+
data.selectColumns = _colSpecArrayParam(funcMap.select, 0).colSpecs.map(
|
|
318
|
+
(colSpec) => _col(colSpec),
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// --------------------------------- PIVOT ---------------------------------
|
|
323
|
+
/** TODO: @datacube roundtrip */
|
|
324
|
+
// TODO: verify group-by agg columns, pivot agg columns and configuration agree
|
|
325
|
+
|
|
326
|
+
// --------------------------------- GROUP BY ---------------------------------
|
|
327
|
+
|
|
328
|
+
if (funcMap.groupBy) {
|
|
329
|
+
data.groupBy = {
|
|
330
|
+
columns: _colSpecArrayParam(funcMap.groupBy, 0).colSpecs.map((colSpec) =>
|
|
331
|
+
_col(colSpec),
|
|
332
|
+
),
|
|
333
|
+
// TODO: verify group-by agg columns, pivot agg columns and configuration agree
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// --------------------------------- GROUP-LEVEL EXTEND ---------------------------------
|
|
338
|
+
/** TODO: @datacube roundtrip */
|
|
339
|
+
|
|
340
|
+
// --------------------------------- SORT ---------------------------------
|
|
341
|
+
|
|
342
|
+
if (funcMap.sort) {
|
|
343
|
+
data.sortColumns = _param(funcMap.sort, 0, V1_Collection).values.map(
|
|
344
|
+
(value) => {
|
|
345
|
+
const sortColFunc = _funcMatch(value, [
|
|
346
|
+
DataCubeFunction.ASC,
|
|
347
|
+
DataCubeFunction.DESC,
|
|
348
|
+
]);
|
|
349
|
+
return {
|
|
350
|
+
..._col(_colSpecParam(sortColFunc, 0)),
|
|
351
|
+
operation:
|
|
352
|
+
_name(sortColFunc.function) === DataCubeFunction.ASC
|
|
353
|
+
? DataCubeQuerySortOperator.ASCENDING
|
|
354
|
+
: DataCubeQuerySortOperator.DESCENDING,
|
|
355
|
+
};
|
|
356
|
+
},
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// --------------------------------- LIMIT ---------------------------------
|
|
361
|
+
|
|
362
|
+
if (funcMap.limit) {
|
|
363
|
+
const value = funcMap.limit.parameters[0];
|
|
364
|
+
assertType(value, V1_CInteger);
|
|
365
|
+
data.limit = value.value;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// --------------------------------- CONFIGURATION ---------------------------------
|
|
369
|
+
// NOTE: we aim to keep the data query a Pure query instead of a specification object
|
|
370
|
+
// so this configuration holds mostly layout and styling customization.
|
|
371
|
+
// But there are overlaps, i.e. certain data query configuration are stored in the
|
|
372
|
+
// configuration, e.g. column aggregation type, this is because a column
|
|
373
|
+
// aggregation's preference can be populated even when there's no aggregation specified
|
|
374
|
+
// in the data query.
|
|
375
|
+
//
|
|
376
|
+
// Arguably, the query should be the single source for these information, but when
|
|
377
|
+
// the configuration for a particular data query function coming from multiple sources
|
|
378
|
+
// conflict, we need to do some reconciliation (or throw error). Some examples include:
|
|
379
|
+
// - missing/extra columns present in the configuration
|
|
380
|
+
// - column kind and type conflict with aggregation
|
|
381
|
+
// - column kind and type conflict with the column configuration
|
|
382
|
+
//
|
|
383
|
+
// In certain cases, configuration needs to be generated from default presets. This
|
|
384
|
+
// helps with use cases where the query might comes from a different source, such as
|
|
385
|
+
// Studio or Query, or another part of Engine.
|
|
386
|
+
const configuration = baseQuery.configuration
|
|
387
|
+
? DataCubeConfiguration.serialization.fromJson(baseQuery.configuration)
|
|
388
|
+
: buildDefaultConfiguration([
|
|
389
|
+
...baseQuery.source.columns,
|
|
390
|
+
...data.leafExtendedColumns,
|
|
391
|
+
...data.groupExtendedColumns,
|
|
392
|
+
]);
|
|
393
|
+
data.configuration =
|
|
394
|
+
DataCubeConfiguration.serialization.toJson(configuration);
|
|
395
|
+
/**
|
|
396
|
+
* TODO: @datacube roundtrip - implement the logic to reconcile the configuration with the query
|
|
397
|
+
* - columns (missing/extra columns - remove or generate default column configuration)
|
|
398
|
+
* - column kind
|
|
399
|
+
* - column type
|
|
400
|
+
* - base off the type, check the settings
|
|
401
|
+
* - aggregation
|
|
402
|
+
* - verify group-by agg columns, pivot agg columns and configuration agree
|
|
403
|
+
*/
|
|
404
|
+
|
|
405
|
+
return snapshot.finalize();
|
|
406
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
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 {
|
|
18
|
+
V1_AppliedFunction,
|
|
19
|
+
V1_ClassInstance,
|
|
20
|
+
V1_ColSpec,
|
|
21
|
+
V1_ColSpecArray,
|
|
22
|
+
V1_Lambda,
|
|
23
|
+
extractElementNameFromPath as _name,
|
|
24
|
+
matchFunctionName,
|
|
25
|
+
type V1_ValueSpecification,
|
|
26
|
+
} from '@finos/legend-graph';
|
|
27
|
+
import { type DataCubeQuerySnapshotColumn } from './DataCubeQuerySnapshot.js';
|
|
28
|
+
import {
|
|
29
|
+
assertTrue,
|
|
30
|
+
assertType,
|
|
31
|
+
guaranteeType,
|
|
32
|
+
UnsupportedOperationError,
|
|
33
|
+
type Clazz,
|
|
34
|
+
} from '@finos/legend-shared';
|
|
35
|
+
import {
|
|
36
|
+
DataCubeFunction,
|
|
37
|
+
DataCubeAggregateOperator,
|
|
38
|
+
} from './DataCubeQueryEngine.js';
|
|
39
|
+
|
|
40
|
+
// --------------------------------- UTILITIES ---------------------------------
|
|
41
|
+
|
|
42
|
+
export function _param<T extends V1_ValueSpecification>(
|
|
43
|
+
func: V1_AppliedFunction,
|
|
44
|
+
paramIdx: number,
|
|
45
|
+
clazz: Clazz<T>,
|
|
46
|
+
): T {
|
|
47
|
+
assertTrue(
|
|
48
|
+
func.parameters.length >= paramIdx + 1,
|
|
49
|
+
`Can't process ${_name(func.function)}: Expected at least ${paramIdx + 1} parameter(s)`,
|
|
50
|
+
);
|
|
51
|
+
return guaranteeType(
|
|
52
|
+
func.parameters[paramIdx],
|
|
53
|
+
clazz,
|
|
54
|
+
`Can't process ${_name(func.function)}: Found unexpected type for parameter at index ${paramIdx}`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function _colSpecParam(func: V1_AppliedFunction, paramIdx: number) {
|
|
59
|
+
return guaranteeType(
|
|
60
|
+
_param(func, paramIdx, V1_ClassInstance).value,
|
|
61
|
+
V1_ColSpec,
|
|
62
|
+
`Can't process ${_name(func.function)}: Expected parameter at index ${paramIdx} to be a column specification`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function _colSpecArrayParam(func: V1_AppliedFunction, paramIdx: number) {
|
|
67
|
+
return guaranteeType(
|
|
68
|
+
_param(func, paramIdx, V1_ClassInstance).value,
|
|
69
|
+
V1_ColSpecArray,
|
|
70
|
+
`Can't process ${_name(func.function)}: Expected parameter at index ${paramIdx} to be a column specification list`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function _funcMatch(
|
|
75
|
+
value: V1_ValueSpecification | undefined,
|
|
76
|
+
functionNames: string | string[],
|
|
77
|
+
) {
|
|
78
|
+
assertType(
|
|
79
|
+
value,
|
|
80
|
+
V1_AppliedFunction,
|
|
81
|
+
`Can't process function: Found unexpected value specification type`,
|
|
82
|
+
);
|
|
83
|
+
assertTrue(
|
|
84
|
+
matchFunctionName(
|
|
85
|
+
value.function,
|
|
86
|
+
Array.isArray(functionNames) ? functionNames : [functionNames],
|
|
87
|
+
),
|
|
88
|
+
`Can't process function: Expected function name to be one of [${Array.isArray(functionNames) ? functionNames.join(', ') : functionNames}]`,
|
|
89
|
+
);
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// TODO: move these functions out into aggregator utils when we make agg operator handling systematic
|
|
94
|
+
// similar to what we did with filter
|
|
95
|
+
function _aggFuncMatch(
|
|
96
|
+
value: V1_ValueSpecification | undefined,
|
|
97
|
+
functionNames: string | string[],
|
|
98
|
+
) {
|
|
99
|
+
assertType(
|
|
100
|
+
value,
|
|
101
|
+
V1_Lambda,
|
|
102
|
+
`Can't process aggregation: Found unexpected value specification type`,
|
|
103
|
+
);
|
|
104
|
+
return _funcMatch(value.body[0], functionNames);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function _aggCol(
|
|
108
|
+
colSpec: V1_ColSpec,
|
|
109
|
+
column: DataCubeQuerySnapshotColumn,
|
|
110
|
+
) {
|
|
111
|
+
const func = _aggFuncMatch(
|
|
112
|
+
colSpec.function2,
|
|
113
|
+
Object.values(DataCubeFunction),
|
|
114
|
+
);
|
|
115
|
+
if (matchFunctionName(func.function, DataCubeFunction.COUNT)) {
|
|
116
|
+
return {
|
|
117
|
+
...column,
|
|
118
|
+
operation: DataCubeAggregateOperator.COUNT,
|
|
119
|
+
parameters: [],
|
|
120
|
+
};
|
|
121
|
+
} else if (matchFunctionName(func.function, DataCubeFunction.SUM)) {
|
|
122
|
+
return {
|
|
123
|
+
...column,
|
|
124
|
+
operation: DataCubeAggregateOperator.SUM,
|
|
125
|
+
parameters: [],
|
|
126
|
+
};
|
|
127
|
+
} else if (matchFunctionName(func.function, DataCubeFunction.AVERAGE)) {
|
|
128
|
+
return {
|
|
129
|
+
...column,
|
|
130
|
+
operation: DataCubeAggregateOperator.AVERAGE,
|
|
131
|
+
parameters: [],
|
|
132
|
+
};
|
|
133
|
+
} else if (matchFunctionName(func.function, DataCubeFunction.MIN)) {
|
|
134
|
+
return {
|
|
135
|
+
...column,
|
|
136
|
+
operation: DataCubeAggregateOperator.MIN,
|
|
137
|
+
parameters: [],
|
|
138
|
+
};
|
|
139
|
+
} else if (matchFunctionName(func.function, DataCubeFunction.MAX)) {
|
|
140
|
+
return {
|
|
141
|
+
...column,
|
|
142
|
+
operation: DataCubeAggregateOperator.MAX,
|
|
143
|
+
parameters: [],
|
|
144
|
+
};
|
|
145
|
+
} else if (matchFunctionName(func.function, DataCubeFunction.FIRST)) {
|
|
146
|
+
return {
|
|
147
|
+
...column,
|
|
148
|
+
operation: DataCubeAggregateOperator.FIRST,
|
|
149
|
+
parameters: [],
|
|
150
|
+
};
|
|
151
|
+
} else if (matchFunctionName(func.function, DataCubeFunction.LAST)) {
|
|
152
|
+
return {
|
|
153
|
+
...column,
|
|
154
|
+
operation: DataCubeAggregateOperator.LAST,
|
|
155
|
+
parameters: [],
|
|
156
|
+
};
|
|
157
|
+
} else if (
|
|
158
|
+
matchFunctionName(func.function, DataCubeFunction.VARIANCE_POPULATION)
|
|
159
|
+
) {
|
|
160
|
+
return {
|
|
161
|
+
...column,
|
|
162
|
+
operation: DataCubeAggregateOperator.VARIANCE_POPULATION,
|
|
163
|
+
parameters: [],
|
|
164
|
+
};
|
|
165
|
+
} else if (
|
|
166
|
+
matchFunctionName(func.function, DataCubeFunction.VARIANCE_SAMPLE)
|
|
167
|
+
) {
|
|
168
|
+
return {
|
|
169
|
+
...column,
|
|
170
|
+
operation: DataCubeAggregateOperator.VARIANCE_SAMPLE,
|
|
171
|
+
parameters: [],
|
|
172
|
+
};
|
|
173
|
+
} else if (
|
|
174
|
+
matchFunctionName(
|
|
175
|
+
func.function,
|
|
176
|
+
DataCubeFunction.STANDARD_DEVIATION_POPULATION,
|
|
177
|
+
)
|
|
178
|
+
) {
|
|
179
|
+
return {
|
|
180
|
+
...column,
|
|
181
|
+
operation: DataCubeAggregateOperator.STANDARD_DEVIATION_POPULATION,
|
|
182
|
+
parameters: [],
|
|
183
|
+
};
|
|
184
|
+
} else if (
|
|
185
|
+
matchFunctionName(func.function, DataCubeFunction.STANDARD_DEVIATION_SAMPLE)
|
|
186
|
+
) {
|
|
187
|
+
return {
|
|
188
|
+
...column,
|
|
189
|
+
operation: DataCubeAggregateOperator.STANDARD_DEVIATION_SAMPLE,
|
|
190
|
+
parameters: [],
|
|
191
|
+
};
|
|
192
|
+
} else {
|
|
193
|
+
throw new UnsupportedOperationError(
|
|
194
|
+
`Unsupported aggregate function '${func.function}'`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
}
|