@finos/legend-data-cube 0.0.43 → 0.0.45
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/docs/column-configuration.kind.md +2 -0
- package/lib/__lib__/DataCubeSetting.d.ts +1 -0
- package/lib/__lib__/DataCubeSetting.d.ts.map +1 -1
- package/lib/__lib__/DataCubeSetting.js +1 -0
- package/lib/__lib__/DataCubeSetting.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnPropertiesPanel.js +12 -6
- package/lib/components/view/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.d.ts +7 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.js +23 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnsPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnsPanel.js +2 -1
- package/lib/components/view/editor/DataCubeEditorColumnsPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorHorizontalPivotsPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorHorizontalPivotsPanel.js +2 -4
- package/lib/components/view/editor/DataCubeEditorHorizontalPivotsPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorSortsPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorSortsPanel.js +4 -25
- package/lib/components/view/editor/DataCubeEditorSortsPanel.js.map +1 -1
- package/lib/components/view/filter/DataCubeFilterEditor.d.ts.map +1 -1
- package/lib/components/view/filter/DataCubeFilterEditor.js +2 -1
- package/lib/components/view/filter/DataCubeFilterEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +5 -5
- package/lib/stores/core/DataCubeConfigurationBuilder.d.ts +4 -3
- package/lib/stores/core/DataCubeConfigurationBuilder.d.ts.map +1 -1
- package/lib/stores/core/DataCubeConfigurationBuilder.js +59 -3
- package/lib/stores/core/DataCubeConfigurationBuilder.js.map +1 -1
- package/lib/stores/core/DataCubeEngine.d.ts +2 -0
- package/lib/stores/core/DataCubeEngine.d.ts.map +1 -1
- package/lib/stores/core/DataCubeEngine.js +1 -2
- package/lib/stores/core/DataCubeEngine.js.map +1 -1
- package/lib/stores/core/DataCubeQueryBuilder.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQueryBuilder.js +12 -22
- package/lib/stores/core/DataCubeQueryBuilder.js.map +1 -1
- package/lib/stores/core/DataCubeQueryBuilderUtils.d.ts +6 -5
- package/lib/stores/core/DataCubeQueryBuilderUtils.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQueryBuilderUtils.js +59 -30
- package/lib/stores/core/DataCubeQueryBuilderUtils.js.map +1 -1
- package/lib/stores/core/DataCubeQueryEngine.d.ts +14 -7
- package/lib/stores/core/DataCubeQueryEngine.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQueryEngine.js +76 -45
- package/lib/stores/core/DataCubeQueryEngine.js.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshot.d.ts +11 -0
- package/lib/stores/core/DataCubeQuerySnapshot.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshot.js.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.d.ts +2 -3
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.js +226 -128
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.d.ts +36 -7
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.js +359 -126
- package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.d.ts +10 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.js +15 -6
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.js +23 -10
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.js +14 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.js.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.d.ts +6 -2
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.d.ts.map +1 -1
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.js +13 -3
- package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.d.ts +0 -2
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.js +1 -30
- package/lib/stores/core/filter/DataCubeQueryFilterOperation.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.js +8 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.js +10 -10
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.js +8 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.js +10 -10
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.js +5 -6
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.js +10 -10
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.js +6 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.js +6 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.js +5 -6
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.js +6 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.js +5 -6
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.js +6 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.js +2 -6
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.js +2 -2
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.js +5 -6
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.js +6 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.js +5 -6
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.js +6 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.js +8 -11
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.js +8 -11
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.js +6 -10
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.js +10 -14
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.js +6 -11
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.js +6 -11
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.js +8 -11
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.js +8 -7
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.js.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.d.ts.map +1 -1
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.js +10 -10
- package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.js.map +1 -1
- package/lib/stores/core/model/DataCubeColumn.d.ts +1 -1
- package/lib/stores/core/model/DataCubeColumn.d.ts.map +1 -1
- package/lib/stores/core/model/DataCubeColumn.js.map +1 -1
- package/lib/stores/core/model/DataCubeConfiguration.d.ts +4 -3
- package/lib/stores/core/model/DataCubeConfiguration.d.ts.map +1 -1
- package/lib/stores/core/model/DataCubeConfiguration.js +4 -0
- package/lib/stores/core/model/DataCubeConfiguration.js.map +1 -1
- package/lib/stores/services/DataCubeQuerySnapshotService.d.ts.map +1 -1
- package/lib/stores/services/DataCubeQuerySnapshotService.js +2 -2
- package/lib/stores/services/DataCubeQuerySnapshotService.js.map +1 -1
- package/lib/stores/services/DataCubeSettingService.d.ts.map +1 -1
- package/lib/stores/services/DataCubeSettingService.js +8 -0
- package/lib/stores/services/DataCubeSettingService.js.map +1 -1
- package/lib/stores/view/DataCubeViewState.d.ts.map +1 -1
- package/lib/stores/view/DataCubeViewState.js +1 -1
- package/lib/stores/view/DataCubeViewState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnPropertiesPanelState.js +3 -2
- package/lib/stores/view/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnSelectorState.d.ts +7 -0
- package/lib/stores/view/editor/DataCubeEditorColumnSelectorState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnSelectorState.js +20 -3
- package/lib/stores/view/editor/DataCubeEditorColumnSelectorState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.js +2 -2
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts +4 -4
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.js +14 -8
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.d.ts +1 -5
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.js +2 -6
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.d.ts +1 -7
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.js +4 -19
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorState.js +2 -2
- package/lib/stores/view/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.js +4 -4
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.js.map +1 -1
- package/lib/stores/view/extend/DataCubeColumnEditorState.d.ts.map +1 -1
- package/lib/stores/view/extend/DataCubeColumnEditorState.js +2 -1
- package/lib/stores/view/extend/DataCubeColumnEditorState.js.map +1 -1
- package/lib/stores/view/extend/DataCubeExtendManagerState.d.ts.map +1 -1
- package/lib/stores/view/extend/DataCubeExtendManagerState.js +12 -12
- package/lib/stores/view/extend/DataCubeExtendManagerState.js.map +1 -1
- package/lib/stores/view/filter/DataCubeFilterEditorState.d.ts.map +1 -1
- package/lib/stores/view/filter/DataCubeFilterEditorState.js +2 -1
- package/lib/stores/view/filter/DataCubeFilterEditorState.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.js +11 -14
- package/lib/stores/view/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.js +48 -12
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridControllerState.d.ts +1 -1
- package/lib/stores/view/grid/DataCubeGridControllerState.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridControllerState.js +20 -20
- package/lib/stores/view/grid/DataCubeGridControllerState.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.js +8 -12
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridQueryBuilder.js +1 -1
- package/lib/stores/view/grid/DataCubeGridQueryBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridQuerySnapshotBuilder.js +1 -1
- package/lib/stores/view/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -1
- package/package.json +8 -8
- package/src/__lib__/DataCubeSetting.ts +1 -0
- package/src/components/view/editor/DataCubeEditorColumnPropertiesPanel.tsx +40 -17
- package/src/components/view/editor/DataCubeEditorColumnSelector.tsx +75 -1
- package/src/components/view/editor/DataCubeEditorColumnsPanel.tsx +3 -6
- package/src/components/view/editor/DataCubeEditorHorizontalPivotsPanel.tsx +5 -12
- package/src/components/view/editor/DataCubeEditorSortsPanel.tsx +12 -80
- package/src/components/view/filter/DataCubeFilterEditor.tsx +2 -3
- package/src/stores/core/DataCubeConfigurationBuilder.ts +80 -5
- package/src/stores/core/DataCubeEngine.tsx +10 -2
- package/src/stores/core/DataCubeQueryBuilder.ts +36 -37
- package/src/stores/core/DataCubeQueryBuilderUtils.ts +74 -41
- package/src/stores/core/DataCubeQueryEngine.ts +120 -60
- package/src/stores/core/DataCubeQuerySnapshot.ts +13 -0
- package/src/stores/core/DataCubeQuerySnapshotBuilder.ts +379 -157
- package/src/stores/core/DataCubeQuerySnapshotBuilderUtils.ts +597 -157
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation.ts +39 -16
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__First.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.tsx +41 -26
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.tsx +29 -6
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.tsx +30 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.tsx +26 -4
- package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.tsx +26 -4
- package/src/stores/core/filter/DataCubeQueryFilterOperation.ts +1 -52
- package/src/stores/core/filter/DataCubeQueryFilterOperation__Contain.tsx +12 -9
- package/src/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.tsx +10 -13
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EndWith.tsx +9 -10
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.tsx +10 -13
- package/src/stores/core/filter/DataCubeQueryFilterOperation__Equal.tsx +5 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.tsx +10 -13
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.tsx +6 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.tsx +5 -7
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.tsx +6 -9
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.tsx +6 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.tsx +6 -9
- package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.tsx +6 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.tsx +6 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__IsNull.tsx +6 -2
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThan.tsx +6 -9
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.tsx +6 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.tsx +6 -9
- package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.tsx +6 -8
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotContain.tsx +12 -15
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.tsx +12 -15
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.tsx +10 -14
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.tsx +11 -20
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.tsx +7 -19
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.tsx +9 -17
- package/src/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.tsx +10 -17
- package/src/stores/core/filter/DataCubeQueryFilterOperation__StartWith.tsx +9 -10
- package/src/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.tsx +10 -13
- package/src/stores/core/model/DataCubeColumn.ts +1 -1
- package/src/stores/core/model/DataCubeConfiguration.ts +7 -1
- package/src/stores/services/DataCubeQuerySnapshotService.ts +2 -1
- package/src/stores/services/DataCubeSettingService.tsx +8 -0
- package/src/stores/view/DataCubeViewState.ts +2 -3
- package/src/stores/view/editor/DataCubeEditorColumnPropertiesPanelState.ts +3 -2
- package/src/stores/view/editor/DataCubeEditorColumnSelectorState.ts +31 -6
- package/src/stores/view/editor/DataCubeEditorColumnsPanelState.ts +2 -7
- package/src/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.ts +33 -10
- package/src/stores/view/editor/DataCubeEditorMutableConfiguration.ts +4 -20
- package/src/stores/view/editor/DataCubeEditorSortsPanelState.ts +6 -29
- package/src/stores/view/editor/DataCubeEditorState.tsx +2 -3
- package/src/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.ts +6 -7
- package/src/stores/view/extend/DataCubeColumnEditorState.tsx +2 -3
- package/src/stores/view/extend/DataCubeExtendManagerState.tsx +14 -13
- package/src/stores/view/filter/DataCubeFilterEditorState.tsx +2 -4
- package/src/stores/view/grid/DataCubeGridClientEngine.ts +21 -20
- package/src/stores/view/grid/DataCubeGridConfigurationBuilder.tsx +64 -15
- package/src/stores/view/grid/DataCubeGridControllerState.ts +35 -34
- package/src/stores/view/grid/DataCubeGridMenuBuilder.tsx +17 -23
- package/src/stores/view/grid/DataCubeGridQueryBuilder.ts +1 -1
- package/src/stores/view/grid/DataCubeGridQuerySnapshotBuilder.ts +1 -1
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
import { PRIMITIVE_TYPE, type V1_AppliedFunction } from '@finos/legend-graph';
|
|
25
25
|
import { type DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
|
|
26
|
-
import {
|
|
26
|
+
import { at } from '@finos/legend-shared';
|
|
27
27
|
import {
|
|
28
28
|
DataCubeFunction,
|
|
29
29
|
DataCubeQuerySortDirection,
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
} from './DataCubeQueryBuilderUtils.js';
|
|
51
51
|
import type { DataCubeQueryAggregateOperation } from './aggregation/DataCubeQueryAggregateOperation.js';
|
|
52
52
|
import type { DataCubeSource } from './model/DataCubeSource.js';
|
|
53
|
+
import { _findCol } from './model/DataCubeColumn.js';
|
|
53
54
|
|
|
54
55
|
export function buildExecutableQuery(
|
|
55
56
|
snapshot: DataCubeQuerySnapshot,
|
|
@@ -93,24 +94,20 @@ export function buildExecutableQuery(
|
|
|
93
94
|
// --------------------------------- LEAF-LEVEL EXTEND ---------------------------------
|
|
94
95
|
|
|
95
96
|
if (data.leafExtendedColumns.length) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
_process(
|
|
98
|
+
'leafExtend',
|
|
99
|
+
data.leafExtendedColumns.map((col) =>
|
|
100
|
+
_function(DataCubeFunction.EXTEND, [
|
|
101
|
+
_cols([
|
|
102
|
+
_colSpec(
|
|
103
|
+
col.name,
|
|
104
|
+
_deserializeLambda(col.mapFn),
|
|
105
|
+
col.reduceFn ? _deserializeLambda(col.reduceFn) : undefined,
|
|
106
|
+
),
|
|
107
|
+
]),
|
|
104
108
|
]),
|
|
105
|
-
|
|
109
|
+
),
|
|
106
110
|
);
|
|
107
|
-
// instead of batching all the extend() functions, we sequence them to allow for
|
|
108
|
-
// different flavors of extend (e.g. with and without window), and reference the first
|
|
109
|
-
// one in the function map
|
|
110
|
-
_process('leafExtend', guaranteeNonNullable(leafExtendedFuncs[0]));
|
|
111
|
-
leafExtendedFuncs.slice(1).forEach((func) => {
|
|
112
|
-
sequence.push(func);
|
|
113
|
-
});
|
|
114
111
|
}
|
|
115
112
|
|
|
116
113
|
// --------------------------------- FILTER ---------------------------------
|
|
@@ -146,7 +143,13 @@ export function buildExecutableQuery(
|
|
|
146
143
|
_function(DataCubeFunction.SORT, [
|
|
147
144
|
_collection(
|
|
148
145
|
data.pivot.columns.map((col) =>
|
|
149
|
-
_function(
|
|
146
|
+
_function(
|
|
147
|
+
_findCol(configuration.columns, col.name)?.pivotSortDirection ===
|
|
148
|
+
DataCubeQuerySortDirection.DESCENDING
|
|
149
|
+
? DataCubeFunction.DESCENDING
|
|
150
|
+
: DataCubeFunction.ASCENDING,
|
|
151
|
+
[_col(col.name)],
|
|
152
|
+
),
|
|
150
153
|
),
|
|
151
154
|
),
|
|
152
155
|
]),
|
|
@@ -217,24 +220,20 @@ export function buildExecutableQuery(
|
|
|
217
220
|
// --------------------------------- GROUP-LEVEL EXTEND ---------------------------------
|
|
218
221
|
|
|
219
222
|
if (data.groupExtendedColumns.length) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
_process(
|
|
224
|
+
'groupExtend',
|
|
225
|
+
data.groupExtendedColumns.map((col) =>
|
|
226
|
+
_function(DataCubeFunction.EXTEND, [
|
|
227
|
+
_cols([
|
|
228
|
+
_colSpec(
|
|
229
|
+
col.name,
|
|
230
|
+
_deserializeLambda(col.mapFn),
|
|
231
|
+
col.reduceFn ? _deserializeLambda(col.reduceFn) : undefined,
|
|
232
|
+
),
|
|
233
|
+
]),
|
|
228
234
|
]),
|
|
229
|
-
|
|
235
|
+
),
|
|
230
236
|
);
|
|
231
|
-
// instead of batching all the extend() functions, we sequence them to allow for
|
|
232
|
-
// different flavors of extend (e.g. with and without window), and reference the first
|
|
233
|
-
// one in the function map
|
|
234
|
-
_process('groupExtend', guaranteeNonNullable(groupExtendedFuncs[0]));
|
|
235
|
-
groupExtendedFuncs.slice(1).forEach((func) => {
|
|
236
|
-
sequence.push(func);
|
|
237
|
-
});
|
|
238
237
|
}
|
|
239
238
|
|
|
240
239
|
// --------------------------------- SORT ---------------------------------
|
|
@@ -299,9 +298,9 @@ export function buildExecutableQuery(
|
|
|
299
298
|
return source.query;
|
|
300
299
|
}
|
|
301
300
|
for (let i = 0; i < sequence.length; i++) {
|
|
302
|
-
|
|
303
|
-
i === 0 ? source.query :
|
|
301
|
+
at(sequence, i).parameters.unshift(
|
|
302
|
+
i === 0 ? source.query : at(sequence, i - 1),
|
|
304
303
|
);
|
|
305
304
|
}
|
|
306
|
-
return
|
|
305
|
+
return at(sequence, sequence.length - 1);
|
|
307
306
|
}
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
type DataCubeQuerySnapshotFilter,
|
|
61
61
|
type DataCubeQuerySnapshot,
|
|
62
62
|
} from './DataCubeQuerySnapshot.js';
|
|
63
|
-
import { type DataCubeColumn } from './model/DataCubeColumn.js';
|
|
63
|
+
import { _findCol, type DataCubeColumn } from './model/DataCubeColumn.js';
|
|
64
64
|
import {
|
|
65
65
|
guaranteeNonNullable,
|
|
66
66
|
guaranteeIsString,
|
|
@@ -95,9 +95,24 @@ export function _functionCompositionProcessor(
|
|
|
95
95
|
sequence: V1_AppliedFunction[],
|
|
96
96
|
funcMap: DataCubeQueryFunctionMap,
|
|
97
97
|
) {
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
return (
|
|
99
|
+
key: keyof DataCubeQueryFunctionMap,
|
|
100
|
+
data: V1_AppliedFunction | V1_AppliedFunction[],
|
|
101
|
+
) => {
|
|
102
|
+
switch (key) {
|
|
103
|
+
case 'leafExtend':
|
|
104
|
+
case 'groupExtend': {
|
|
105
|
+
if (Array.isArray(data)) {
|
|
106
|
+
data.forEach((func) => sequence.push(func));
|
|
107
|
+
funcMap[key] = data;
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
default: {
|
|
112
|
+
funcMap[key] = data as V1_AppliedFunction;
|
|
113
|
+
sequence.push(data as V1_AppliedFunction);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
101
116
|
};
|
|
102
117
|
}
|
|
103
118
|
|
|
@@ -106,9 +121,13 @@ export function _functionCompositionUnProcessor(
|
|
|
106
121
|
funcMap: DataCubeQueryFunctionMap,
|
|
107
122
|
) {
|
|
108
123
|
return (key: keyof DataCubeQueryFunctionMap) => {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
|
|
124
|
+
const data = funcMap[key];
|
|
125
|
+
if (data) {
|
|
126
|
+
if (Array.isArray(data)) {
|
|
127
|
+
data.forEach((func) => sequence.splice(sequence.indexOf(func), 1));
|
|
128
|
+
} else {
|
|
129
|
+
sequence.splice(sequence.indexOf(data), 1);
|
|
130
|
+
}
|
|
112
131
|
funcMap[key] = undefined;
|
|
113
132
|
}
|
|
114
133
|
};
|
|
@@ -135,16 +154,17 @@ export function _deserializeFunction(json: PlainObject<V1_Lambda>) {
|
|
|
135
154
|
);
|
|
136
155
|
}
|
|
137
156
|
|
|
138
|
-
export function _var(
|
|
157
|
+
export function _var() {
|
|
139
158
|
const variable = new V1_Variable();
|
|
140
|
-
variable
|
|
159
|
+
// NOTE: we simplify processing logic by forcing all variable names to default value, i.e. x
|
|
160
|
+
variable.name = DEFAULT_LAMBDA_VARIABLE_NAME;
|
|
141
161
|
return variable;
|
|
142
162
|
}
|
|
143
163
|
|
|
144
|
-
export function _property(name: string
|
|
164
|
+
export function _property(name: string) {
|
|
145
165
|
const property = new V1_AppliedProperty();
|
|
146
166
|
property.property = name;
|
|
147
|
-
property.parameters.push(
|
|
167
|
+
property.parameters.push(_var());
|
|
148
168
|
return property;
|
|
149
169
|
}
|
|
150
170
|
|
|
@@ -285,10 +305,7 @@ export function _colSpec(
|
|
|
285
305
|
return colSpec;
|
|
286
306
|
}
|
|
287
307
|
|
|
288
|
-
export function _value(
|
|
289
|
-
value: DataCubeOperationValue,
|
|
290
|
-
variable?: V1_Variable | undefined,
|
|
291
|
-
) {
|
|
308
|
+
export function _value(value: DataCubeOperationValue) {
|
|
292
309
|
switch (value.type) {
|
|
293
310
|
case PRIMITIVE_TYPE.STRING:
|
|
294
311
|
case PRIMITIVE_TYPE.BOOLEAN:
|
|
@@ -308,7 +325,7 @@ export function _value(
|
|
|
308
325
|
return _primitiveValue(value.type, value.value);
|
|
309
326
|
}
|
|
310
327
|
case DataCubeOperationAdvancedValueType.COLUMN:
|
|
311
|
-
return _property(guaranteeIsString(value.value)
|
|
328
|
+
return _property(guaranteeIsString(value.value));
|
|
312
329
|
default:
|
|
313
330
|
throw new UnsupportedOperationError(
|
|
314
331
|
`Can't build value instance for unsupported type '${value.type}'`,
|
|
@@ -345,6 +362,13 @@ export function _selectFunction(columns: DataCubeColumn[]) {
|
|
|
345
362
|
]);
|
|
346
363
|
}
|
|
347
364
|
|
|
365
|
+
export function _synthesizeMinimalSourceQuery(columns: DataCubeColumn[]) {
|
|
366
|
+
return _function(DataCubeFunction.CAST, [
|
|
367
|
+
_primitiveValue(PRIMITIVE_TYPE.STRING, ''),
|
|
368
|
+
_castCols(columns),
|
|
369
|
+
]);
|
|
370
|
+
}
|
|
371
|
+
|
|
348
372
|
export function _extendRootAggregation(columnName: string) {
|
|
349
373
|
return _function(DataCubeFunction.EXTEND, [
|
|
350
374
|
_col(
|
|
@@ -367,7 +391,7 @@ export function _extendRootAggregation(columnName: string) {
|
|
|
367
391
|
const INTERNAL__FILLER_COUNT_AGG_COLUMN_NAME =
|
|
368
392
|
'INTERNAL__filler_count_agg_column';
|
|
369
393
|
// if no aggregates are specified, add a dummy count() aggregate to satisfy compiler
|
|
370
|
-
function
|
|
394
|
+
function _fixEmptyAggCols(aggCols: V1_ColSpec[]) {
|
|
371
395
|
const variable = _var();
|
|
372
396
|
return aggCols.length
|
|
373
397
|
? aggCols
|
|
@@ -380,12 +404,24 @@ function fixEmptyAggCols(aggCols: V1_ColSpec[]) {
|
|
|
380
404
|
];
|
|
381
405
|
}
|
|
382
406
|
|
|
383
|
-
export function
|
|
407
|
+
export function _aggCol_base(
|
|
408
|
+
column: DataCubeColumn,
|
|
409
|
+
func: string,
|
|
410
|
+
paramterValues?: DataCubeOperationValue[] | undefined,
|
|
411
|
+
) {
|
|
384
412
|
const variable = _var();
|
|
385
413
|
return _colSpec(
|
|
386
414
|
column.name,
|
|
387
|
-
_lambda([variable], [_property(column.name
|
|
388
|
-
_lambda(
|
|
415
|
+
_lambda([variable], [_property(column.name)]),
|
|
416
|
+
_lambda(
|
|
417
|
+
[variable],
|
|
418
|
+
[
|
|
419
|
+
_function(_functionName(func), [
|
|
420
|
+
variable,
|
|
421
|
+
...(paramterValues ?? []).map((value) => _value(value)),
|
|
422
|
+
]),
|
|
423
|
+
],
|
|
424
|
+
),
|
|
389
425
|
);
|
|
390
426
|
}
|
|
391
427
|
|
|
@@ -401,18 +437,16 @@ export function _pivotAggCols(
|
|
|
401
437
|
// unlike groupBy, pivot aggreation on dimension columns (e.g. unique values aggregator)
|
|
402
438
|
// are not helpful and therefore excluded
|
|
403
439
|
column.kind === DataCubeColumnKind.MEASURE &&
|
|
404
|
-
!pivotColumns
|
|
440
|
+
!_findCol(pivotColumns, column.name) &&
|
|
405
441
|
!column.excludedFromPivot &&
|
|
406
|
-
!snapshot.data.groupExtendedColumns.
|
|
407
|
-
(col) => col.name === column.name,
|
|
408
|
-
),
|
|
442
|
+
!_findCol(snapshot.data.groupExtendedColumns, column.name),
|
|
409
443
|
);
|
|
410
|
-
return
|
|
444
|
+
return _fixEmptyAggCols(
|
|
411
445
|
aggColumns.map((agg) => {
|
|
412
446
|
const operation = aggregateOperations.find(
|
|
413
447
|
(op) => op.operator === agg.aggregateOperator,
|
|
414
448
|
);
|
|
415
|
-
const aggCol = operation?.
|
|
449
|
+
const aggCol = operation?.buildAggregateColumnExpression(agg);
|
|
416
450
|
if (!aggCol) {
|
|
417
451
|
throw new UnsupportedOperationError(
|
|
418
452
|
`Can't build aggregate column for unsupported operator '${agg.aggregateOperator}'`,
|
|
@@ -452,17 +486,15 @@ export function _groupByAggCols(
|
|
|
452
486
|
const aggColumns = configuration.columns.filter(
|
|
453
487
|
(column) =>
|
|
454
488
|
column.isSelected &&
|
|
455
|
-
!groupByColumns
|
|
456
|
-
!snapshot.data.groupExtendedColumns.
|
|
457
|
-
(col) => col.name === column.name,
|
|
458
|
-
),
|
|
489
|
+
!_findCol(groupByColumns, column.name) &&
|
|
490
|
+
!_findCol(snapshot.data.groupExtendedColumns, column.name),
|
|
459
491
|
);
|
|
460
|
-
return
|
|
492
|
+
return _fixEmptyAggCols(
|
|
461
493
|
aggColumns.map((agg) => {
|
|
462
494
|
const operation = aggregateOperations.find(
|
|
463
495
|
(op) => op.operator === agg.aggregateOperator,
|
|
464
496
|
);
|
|
465
|
-
const aggCol = operation?.
|
|
497
|
+
const aggCol = operation?.buildAggregateColumnExpression(agg);
|
|
466
498
|
if (!aggCol) {
|
|
467
499
|
throw new UnsupportedOperationError(
|
|
468
500
|
`Can't build aggregate column for unsupported operator '${agg.aggregateOperator}'`,
|
|
@@ -479,15 +511,16 @@ export function _groupByAggCols(
|
|
|
479
511
|
const pivotGroupByColumns = pivot.castColumns.filter(
|
|
480
512
|
(col) => !isPivotResultColumnName(col.name),
|
|
481
513
|
);
|
|
482
|
-
return
|
|
514
|
+
return _fixEmptyAggCols([
|
|
483
515
|
// for pivot result columns, resolve the base aggregate column to get aggregate configuration
|
|
484
516
|
...pivotResultColumns
|
|
485
517
|
.map((column) => {
|
|
486
518
|
const baseAggColName = getPivotResultColumnBaseColumnName(column.name);
|
|
487
519
|
return {
|
|
488
520
|
...column,
|
|
489
|
-
matchingColumnConfiguration:
|
|
490
|
-
|
|
521
|
+
matchingColumnConfiguration: _findCol(
|
|
522
|
+
configuration.columns,
|
|
523
|
+
baseAggColName,
|
|
491
524
|
),
|
|
492
525
|
};
|
|
493
526
|
})
|
|
@@ -503,7 +536,8 @@ export function _groupByAggCols(
|
|
|
503
536
|
const operation = aggregateOperations.find(
|
|
504
537
|
(op) => op.operator === columnConfiguration.aggregateOperator,
|
|
505
538
|
);
|
|
506
|
-
const aggCol =
|
|
539
|
+
const aggCol =
|
|
540
|
+
operation?.buildAggregateColumnExpression(columnConfiguration);
|
|
507
541
|
if (!aggCol) {
|
|
508
542
|
throw new UnsupportedOperationError(
|
|
509
543
|
`Can't build aggregate column for unsupported operator '${columnConfiguration.aggregateOperator}'`,
|
|
@@ -514,17 +548,16 @@ export function _groupByAggCols(
|
|
|
514
548
|
// these are the columns which are available for groupBy but not selected for groupBy
|
|
515
549
|
// operation, they would be aggregated as well
|
|
516
550
|
...pivotGroupByColumns
|
|
517
|
-
.filter(
|
|
518
|
-
(column) => !groupByColumns.find((col) => col.name === column.name),
|
|
519
|
-
)
|
|
551
|
+
.filter((column) => !_findCol(groupByColumns, column.name))
|
|
520
552
|
.map((column) => {
|
|
521
553
|
const columnConfiguration = guaranteeNonNullable(
|
|
522
|
-
configuration.columns
|
|
554
|
+
_findCol(configuration.columns, column.name),
|
|
523
555
|
);
|
|
524
556
|
const operation = aggregateOperations.find(
|
|
525
557
|
(op) => op.operator === columnConfiguration.aggregateOperator,
|
|
526
558
|
);
|
|
527
|
-
const aggCol =
|
|
559
|
+
const aggCol =
|
|
560
|
+
operation?.buildAggregateColumnExpression(columnConfiguration);
|
|
528
561
|
if (!aggCol) {
|
|
529
562
|
throw new UnsupportedOperationError(
|
|
530
563
|
`Can't build aggregate column for unsupported operator '${columnConfiguration.aggregateOperator}'`,
|
|
@@ -15,8 +15,19 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { TailwindCSSPalette } from '@finos/legend-art';
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import {
|
|
19
|
+
DATE_FORMAT,
|
|
20
|
+
PRIMITIVE_TYPE,
|
|
21
|
+
type V1_AppliedFunction,
|
|
22
|
+
} from '@finos/legend-graph';
|
|
23
|
+
import {
|
|
24
|
+
guaranteeNonNullable,
|
|
25
|
+
IllegalStateError,
|
|
26
|
+
UnsupportedOperationError,
|
|
27
|
+
formatDate,
|
|
28
|
+
} from '@finos/legend-shared';
|
|
29
|
+
import type { DataCubeQueryFilterOperation } from './filter/DataCubeQueryFilterOperation.js';
|
|
30
|
+
import type { DataCubeQueryAggregateOperation } from './aggregation/DataCubeQueryAggregateOperation.js';
|
|
20
31
|
|
|
21
32
|
export enum DataCubeFunction {
|
|
22
33
|
// relation
|
|
@@ -25,10 +36,10 @@ export enum DataCubeFunction {
|
|
|
25
36
|
GROUP_BY = 'meta::pure::functions::relation::groupBy',
|
|
26
37
|
LIMIT = 'meta::pure::functions::relation::limit',
|
|
27
38
|
PIVOT = 'meta::pure::functions::relation::pivot',
|
|
28
|
-
// RENAME = 'meta::pure::functions::relation::rename',
|
|
29
39
|
SELECT = 'meta::pure::functions::relation::select',
|
|
30
40
|
SLICE = 'meta::pure::functions::relation::slice',
|
|
31
41
|
SORT = 'meta::pure::functions::relation::sort',
|
|
42
|
+
OVER = 'meta::pure::functions::relation::over',
|
|
32
43
|
|
|
33
44
|
// generic
|
|
34
45
|
CAST = 'meta::pure::functions::lang::cast',
|
|
@@ -75,14 +86,14 @@ export enum DataCubeFunction {
|
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
export type DataCubeQueryFunctionMap = {
|
|
78
|
-
leafExtend?: V1_AppliedFunction | undefined;
|
|
89
|
+
leafExtend?: V1_AppliedFunction[] | undefined;
|
|
79
90
|
filter?: V1_AppliedFunction | undefined;
|
|
80
91
|
pivotSort?: V1_AppliedFunction | undefined;
|
|
81
92
|
pivot?: V1_AppliedFunction | undefined;
|
|
82
93
|
pivotCast?: V1_AppliedFunction | undefined;
|
|
83
94
|
groupBy?: V1_AppliedFunction | undefined;
|
|
84
95
|
groupBySort?: V1_AppliedFunction | undefined;
|
|
85
|
-
groupExtend?: V1_AppliedFunction | undefined;
|
|
96
|
+
groupExtend?: V1_AppliedFunction[] | undefined;
|
|
86
97
|
select?: V1_AppliedFunction | undefined;
|
|
87
98
|
sort?: V1_AppliedFunction | undefined;
|
|
88
99
|
limit?: V1_AppliedFunction | undefined;
|
|
@@ -146,21 +157,6 @@ export enum DataCubeOperationAdvancedValueType {
|
|
|
146
157
|
// PARAMETER
|
|
147
158
|
}
|
|
148
159
|
|
|
149
|
-
export function isPrimitiveType(type: string) {
|
|
150
|
-
return (
|
|
151
|
-
[
|
|
152
|
-
PRIMITIVE_TYPE.NUMBER,
|
|
153
|
-
PRIMITIVE_TYPE.INTEGER,
|
|
154
|
-
PRIMITIVE_TYPE.DECIMAL,
|
|
155
|
-
PRIMITIVE_TYPE.FLOAT,
|
|
156
|
-
PRIMITIVE_TYPE.DATE,
|
|
157
|
-
PRIMITIVE_TYPE.STRICTDATE,
|
|
158
|
-
PRIMITIVE_TYPE.DATETIME,
|
|
159
|
-
PRIMITIVE_TYPE.STRING,
|
|
160
|
-
] as string[]
|
|
161
|
-
).includes(type);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
160
|
export type DataCubeOperationValue = {
|
|
165
161
|
value?: unknown;
|
|
166
162
|
type: string;
|
|
@@ -272,48 +268,8 @@ export enum DataCubeColumnDataType {
|
|
|
272
268
|
TIME = 'Time',
|
|
273
269
|
}
|
|
274
270
|
|
|
275
|
-
export function getDataType(type: string): DataCubeColumnDataType {
|
|
276
|
-
switch (type) {
|
|
277
|
-
case PRIMITIVE_TYPE.NUMBER:
|
|
278
|
-
case PRIMITIVE_TYPE.INTEGER:
|
|
279
|
-
case PRIMITIVE_TYPE.DECIMAL:
|
|
280
|
-
case PRIMITIVE_TYPE.FLOAT:
|
|
281
|
-
return DataCubeColumnDataType.NUMBER;
|
|
282
|
-
case PRIMITIVE_TYPE.DATE:
|
|
283
|
-
case PRIMITIVE_TYPE.STRICTDATE:
|
|
284
|
-
return DataCubeColumnDataType.DATE;
|
|
285
|
-
case PRIMITIVE_TYPE.DATETIME:
|
|
286
|
-
return DataCubeColumnDataType.TIME;
|
|
287
|
-
case PRIMITIVE_TYPE.STRING:
|
|
288
|
-
default:
|
|
289
|
-
return DataCubeColumnDataType.TEXT;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export function ofDataType(
|
|
294
|
-
type: string,
|
|
295
|
-
dataTypes: DataCubeColumnDataType[],
|
|
296
|
-
): boolean {
|
|
297
|
-
return dataTypes.includes(getDataType(type));
|
|
298
|
-
}
|
|
299
|
-
|
|
300
271
|
export const PIVOT_COLUMN_NAME_VALUE_SEPARATOR = '__|__';
|
|
301
272
|
|
|
302
|
-
export function isPivotResultColumnName(columnName: string) {
|
|
303
|
-
return columnName.includes(PIVOT_COLUMN_NAME_VALUE_SEPARATOR);
|
|
304
|
-
}
|
|
305
|
-
export function getPivotResultColumnBaseColumnName(columnName: string) {
|
|
306
|
-
if (!isPivotResultColumnName(columnName)) {
|
|
307
|
-
throw new IllegalStateError(
|
|
308
|
-
`Column '${columnName}' is not a pivot result column`,
|
|
309
|
-
);
|
|
310
|
-
}
|
|
311
|
-
return columnName.substring(
|
|
312
|
-
columnName.lastIndexOf(PIVOT_COLUMN_NAME_VALUE_SEPARATOR) +
|
|
313
|
-
PIVOT_COLUMN_NAME_VALUE_SEPARATOR.length,
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
273
|
export const TREE_COLUMN_VALUE_SEPARATOR = '__/__';
|
|
318
274
|
export const DEFAULT_LAMBDA_VARIABLE_NAME = 'x';
|
|
319
275
|
|
|
@@ -321,6 +277,8 @@ export const DEFAULT_REPORT_NAME = 'New Report';
|
|
|
321
277
|
export const DEFAULT_TREE_COLUMN_SORT_DIRECTION =
|
|
322
278
|
DataCubeQuerySortDirection.ASCENDING;
|
|
323
279
|
export const DEFAULT_PIVOT_STATISTIC_COLUMN_NAME = 'Total';
|
|
280
|
+
export const DEFAULT_PIVOT_COLUMN_SORT_DIRECTION =
|
|
281
|
+
DataCubeQuerySortDirection.ASCENDING;
|
|
324
282
|
export const DEFAULT_ROOT_AGGREGATION_COLUMN_VALUE = '[ROOT]';
|
|
325
283
|
|
|
326
284
|
export const DEFAULT_URL_LABEL_QUERY_PARAM = 'dataCube.linkLabel';
|
|
@@ -354,3 +312,105 @@ export const DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
|
|
|
354
312
|
export const TYPEAHEAD_SEARCH_MINIMUM_SEARCH_LENGTH = 3;
|
|
355
313
|
export const TYPEAHEAD_SEARCH_LIMIT = 10;
|
|
356
314
|
export const EMPTY_VALUE_PLACEHOLDER = '(None)';
|
|
315
|
+
|
|
316
|
+
// --------------------------------- UTILITIES ---------------------------------
|
|
317
|
+
|
|
318
|
+
export function _defaultPrimitiveTypeValue(type: string): unknown {
|
|
319
|
+
switch (type) {
|
|
320
|
+
case PRIMITIVE_TYPE.STRING:
|
|
321
|
+
return '';
|
|
322
|
+
case PRIMITIVE_TYPE.BOOLEAN:
|
|
323
|
+
return false;
|
|
324
|
+
case PRIMITIVE_TYPE.BYTE:
|
|
325
|
+
return btoa('');
|
|
326
|
+
case PRIMITIVE_TYPE.NUMBER:
|
|
327
|
+
case PRIMITIVE_TYPE.DECIMAL:
|
|
328
|
+
case PRIMITIVE_TYPE.FLOAT:
|
|
329
|
+
case PRIMITIVE_TYPE.INTEGER:
|
|
330
|
+
case PRIMITIVE_TYPE.BINARY:
|
|
331
|
+
return 0;
|
|
332
|
+
case PRIMITIVE_TYPE.DATE:
|
|
333
|
+
case PRIMITIVE_TYPE.STRICTDATE:
|
|
334
|
+
return formatDate(new Date(Date.now()), DATE_FORMAT);
|
|
335
|
+
case PRIMITIVE_TYPE.DATETIME:
|
|
336
|
+
return formatDate(new Date(Date.now()), DATE_TIME_FORMAT);
|
|
337
|
+
default:
|
|
338
|
+
throw new UnsupportedOperationError(
|
|
339
|
+
`Can't generate value for type '${type}'`,
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export function getFilterOperation(
|
|
345
|
+
operator: string,
|
|
346
|
+
operators: DataCubeQueryFilterOperation[],
|
|
347
|
+
) {
|
|
348
|
+
return guaranteeNonNullable(
|
|
349
|
+
operators.find((op) => op.operator === operator),
|
|
350
|
+
`Can't find filter operation '${operator}'`,
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export function getAggregateOperation(
|
|
355
|
+
operator: string,
|
|
356
|
+
aggregateOperations: DataCubeQueryAggregateOperation[],
|
|
357
|
+
) {
|
|
358
|
+
return guaranteeNonNullable(
|
|
359
|
+
aggregateOperations.find((op) => op.operator === operator),
|
|
360
|
+
`Can't find aggregate operation '${operator}'`,
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export function getDataType(type: string): DataCubeColumnDataType {
|
|
365
|
+
switch (type) {
|
|
366
|
+
case PRIMITIVE_TYPE.NUMBER:
|
|
367
|
+
case PRIMITIVE_TYPE.INTEGER:
|
|
368
|
+
case PRIMITIVE_TYPE.DECIMAL:
|
|
369
|
+
case PRIMITIVE_TYPE.FLOAT:
|
|
370
|
+
return DataCubeColumnDataType.NUMBER;
|
|
371
|
+
case PRIMITIVE_TYPE.DATE:
|
|
372
|
+
case PRIMITIVE_TYPE.STRICTDATE:
|
|
373
|
+
return DataCubeColumnDataType.DATE;
|
|
374
|
+
case PRIMITIVE_TYPE.DATETIME:
|
|
375
|
+
return DataCubeColumnDataType.TIME;
|
|
376
|
+
case PRIMITIVE_TYPE.STRING:
|
|
377
|
+
default:
|
|
378
|
+
return DataCubeColumnDataType.TEXT;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export function ofDataType(
|
|
383
|
+
type: string,
|
|
384
|
+
dataTypes: DataCubeColumnDataType[],
|
|
385
|
+
): boolean {
|
|
386
|
+
return dataTypes.includes(getDataType(type));
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export function isPrimitiveType(type: string) {
|
|
390
|
+
return (
|
|
391
|
+
[
|
|
392
|
+
PRIMITIVE_TYPE.NUMBER,
|
|
393
|
+
PRIMITIVE_TYPE.INTEGER,
|
|
394
|
+
PRIMITIVE_TYPE.DECIMAL,
|
|
395
|
+
PRIMITIVE_TYPE.FLOAT,
|
|
396
|
+
PRIMITIVE_TYPE.DATE,
|
|
397
|
+
PRIMITIVE_TYPE.STRICTDATE,
|
|
398
|
+
PRIMITIVE_TYPE.DATETIME,
|
|
399
|
+
PRIMITIVE_TYPE.STRING,
|
|
400
|
+
] as string[]
|
|
401
|
+
).includes(type);
|
|
402
|
+
}
|
|
403
|
+
export function isPivotResultColumnName(columnName: string) {
|
|
404
|
+
return columnName.includes(PIVOT_COLUMN_NAME_VALUE_SEPARATOR);
|
|
405
|
+
}
|
|
406
|
+
export function getPivotResultColumnBaseColumnName(columnName: string) {
|
|
407
|
+
if (!isPivotResultColumnName(columnName)) {
|
|
408
|
+
throw new IllegalStateError(
|
|
409
|
+
`Column '${columnName}' is not a pivot result column`,
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
return columnName.substring(
|
|
413
|
+
columnName.lastIndexOf(PIVOT_COLUMN_NAME_VALUE_SEPARATOR) +
|
|
414
|
+
PIVOT_COLUMN_NAME_VALUE_SEPARATOR.length,
|
|
415
|
+
);
|
|
416
|
+
}
|
|
@@ -51,6 +51,11 @@ export type DataCubeQuerySnapshotExtendedColumn = DataCubeColumn & {
|
|
|
51
51
|
reduceFn?: PlainObject<V1_Lambda> | undefined;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
export type DataCubeQuerySnapshotAggregateColumn = DataCubeColumn & {
|
|
55
|
+
parameterValues: DataCubeOperationValue[];
|
|
56
|
+
operator: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
54
59
|
export type DataCubeQuerySnapshotSortColumn = DataCubeColumn & {
|
|
55
60
|
direction: DataCubeQuerySortDirection;
|
|
56
61
|
};
|
|
@@ -64,6 +69,14 @@ export type DataCubeQuerySnapshotPivot = {
|
|
|
64
69
|
castColumns: DataCubeColumn[];
|
|
65
70
|
};
|
|
66
71
|
|
|
72
|
+
export type DataCubeQuerySnapshotProcessingContext = {
|
|
73
|
+
snapshot: DataCubeQuerySnapshot;
|
|
74
|
+
pivotAggColumns: DataCubeQuerySnapshotAggregateColumn[];
|
|
75
|
+
pivotSortColumns: DataCubeQuerySnapshotSortColumn[];
|
|
76
|
+
groupByAggColumns: DataCubeQuerySnapshotAggregateColumn[];
|
|
77
|
+
groupBySortColumns: DataCubeQuerySnapshotSortColumn[];
|
|
78
|
+
};
|
|
79
|
+
|
|
67
80
|
export type DataCubeQuerySnapshotData = {
|
|
68
81
|
configuration: PlainObject<DataCubeConfiguration>;
|
|
69
82
|
sourceColumns: DataCubeColumn[];
|