@finos/legend-data-cube
Version:
61 lines • 5.24 kB
TypeScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/***************************************************************************************
* [CORE]
*
* These are utilities used to build the executable query from the snapshot.
* The executable query is then used to fetch data.
***************************************************************************************/
import { type V1_PrimitiveValueSpecification, type V1_ValueSpecification, V1_AppliedFunction, V1_AppliedProperty, V1_ClassInstance, V1_Collection, V1_ColSpec, V1_Enumeration, V1_EnumValue, V1_GenericTypeInstance, V1_Lambda, V1_PackageableElementPtr, V1_PackageableType, V1_Variable } from '@finos/legend-graph';
import { type DataCubeSnapshotFilterCondition, type DataCubeSnapshotFilter, type DataCubeSnapshot } from './DataCubeSnapshot.js';
import { type DataCubeColumn } from './model/DataCubeColumn.js';
import { type DataCubeOperationValue, type DataCubeQueryFunctionMap } from './DataCubeQueryEngine.js';
import type { DataCubeQueryFilterOperation } from './filter/DataCubeQueryFilterOperation.js';
import type { DataCubeQueryAggregateOperation } from './aggregation/DataCubeQueryAggregateOperation.js';
import { type DataCubeConfiguration } from './model/DataCubeConfiguration.js';
import type { DataCubeDimensionalGroupByNode } from '../view/grid/DataCubeGridDimensionalTree.js';
export declare function _var(): V1_Variable;
export declare function _property(name: string, parameters?: V1_ValueSpecification[]): V1_AppliedProperty;
export declare function _lambda(parameters: V1_Variable[], body: V1_ValueSpecification[]): V1_Lambda;
export declare function _functionName(funcNameOrPath: string, options?: {
useFullFunctionPath?: boolean;
}): string;
export declare function _function(functionName: string, parameters: V1_ValueSpecification[], options?: {
useFullFunctionPath?: boolean;
}): V1_AppliedFunction;
export declare function _collection(values: V1_ValueSpecification[]): V1_Collection;
export declare function _primitiveValue(type: string, value: unknown, coerceType?: boolean): V1_PrimitiveValueSpecification;
export declare function _enumValue(value: string): V1_EnumValue;
export declare function _enumeration(enumerationPackage: string, enumerationName: string, values: V1_EnumValue[]): V1_Enumeration;
export declare function _elementPtr(fullPath: string): V1_PackageableElementPtr;
export declare function _type(fullPath: string): V1_PackageableType;
export declare function _colSpec(name: string, function1?: V1_Lambda | undefined, function2?: V1_Lambda | undefined, type?: string | undefined): V1_ColSpec;
export declare function _value(value: DataCubeOperationValue): V1_AppliedProperty | V1_Collection | V1_PrimitiveValueSpecification;
export declare function _not(fn: V1_AppliedFunction): V1_AppliedFunction;
export declare function _col(name: string, function1?: V1_Lambda | undefined, function2?: V1_Lambda | undefined): V1_ClassInstance;
export declare function _cols(colSpecs: V1_ColSpec[]): V1_ClassInstance;
export declare function _functionCompositionProcessor(sequence: V1_AppliedFunction[], funcMap: DataCubeQueryFunctionMap): (key: keyof DataCubeQueryFunctionMap, data: V1_AppliedFunction | V1_AppliedFunction[]) => void;
export declare function _functionCompositionUnProcessor(sequence: V1_AppliedFunction[], funcMap: DataCubeQueryFunctionMap): (key: keyof DataCubeQueryFunctionMap) => void;
export declare function _selectFunction(columns: DataCubeColumn[]): V1_AppliedFunction;
export declare function _synthesizeMinimalSourceQuery(columns: DataCubeColumn[]): V1_AppliedFunction;
export declare function _extendRootAggregation(columnName: string): V1_AppliedFunction;
export declare function _aggCol_base(column: DataCubeColumn, func: string, paramterValues?: DataCubeOperationValue[] | undefined): V1_ColSpec;
export declare function _pivotAggCols(pivotColumns: DataCubeColumn[], snapshot: DataCubeSnapshot, configuration: DataCubeConfiguration, aggregateOperations: DataCubeQueryAggregateOperation[]): V1_ColSpec[];
export declare function _castCols(columns: DataCubeColumn[]): V1_GenericTypeInstance;
export declare function _groupByAggCols(groupByColumns: DataCubeColumn[], snapshot: DataCubeSnapshot, configuration: DataCubeConfiguration, aggregateOperations: DataCubeQueryAggregateOperation[]): V1_ColSpec[];
export declare function _filter(filter: DataCubeSnapshotFilter | DataCubeSnapshotFilterCondition, filterOperations: DataCubeQueryFilterOperation[]): V1_AppliedFunction;
export declare function _flattenFilterSnapshot(groupByNodes: DataCubeDimensionalGroupByNode[]): DataCubeSnapshotFilter;
//# sourceMappingURL=DataCubeQueryBuilderUtils.d.ts.map