import { PreAggregationDefinition } from '../compiler/CubeSymbols'; import { JoinEdge } from '../compiler/JoinGraph'; import { BaseQuery } from './BaseQuery'; import { PreAggregationReferences, PreAggregationTimeDimensionReference } from '../compiler/CubeEvaluator'; import { BaseTimeDimension } from './BaseTimeDimension'; import { BaseMeasure } from './BaseMeasure'; import { BaseFilter } from './BaseFilter'; import { BaseGroupFilter } from './BaseGroupFilter'; import { BaseDimension } from './BaseDimension'; import { BaseSegment } from './BaseSegment'; export type PartitionTimeDimension = { dimension: string; dateRange: [string, string]; boundaryDateRange: [string, string]; }; export type PreAggregationDefinitionExtended = PreAggregationDefinition & PreAggregationReferences & { unionWithSourceData: boolean; rollupLambdaId: string; lastRollupLambda: boolean; rollupLambdaTimeDimensionsReference: PreAggregationTimeDimensionReference[]; readOnly: boolean; partitionGranularity: string; streamOffset: 'earliest' | 'latest'; uniqueKeyColumns: string; sqlAlias?: string; partitionTimeDimensions?: PartitionTimeDimension[]; }; export type PreAggregationForQuery = { preAggregationName: string; cube: string; canUsePreAggregation: boolean; leafMeasureMatch?: boolean; preAggregationId: string; preAggregation: PreAggregationDefinitionExtended; references: PreAggregationReferences; preAggregationsToJoin?: PreAggregationForQuery[]; referencedPreAggregations?: PreAggregationForQuery[]; rollupJoin?: RollupJoin; sqlAlias?: string; }; export type PreAggregationForQueryWithTableName = PreAggregationForQuery & { tableName: string; }; export type PreAggregationForCube = { preAggregationName: string; cube: string; preAggregation: PreAggregationDefinitionExtended; references: PreAggregationReferences; }; export type EvaluateReferencesContext = { inPreAggEvaluation?: boolean; }; export type BaseMember = BaseDimension | BaseMeasure | BaseFilter | BaseGroupFilter | BaseSegment; export type JoinEdgeWithMembers = JoinEdge & { fromMembers: string[]; toMembers: string[]; }; export type RollupJoinItem = JoinEdgeWithMembers & { fromPreAggObj: PreAggregationForQuery; toPreAggObj: PreAggregationForQuery; }; export type RollupJoin = RollupJoinItem[]; export type CanUsePreAggregationResult = { canUse: boolean; leafMeasureMatch: boolean; }; export type CanUsePreAggregationFn = (references: PreAggregationReferences) => CanUsePreAggregationResult; /** * TODO: Write a real type. * @see return value of PreAggregations.preAggregationDescriptionFor() */ export type FullPreAggregationDescription = any; /** * TODO: Write a real type. * @see return value of static PreAggregations.transformQueryToCanUseForm() */ export type TransformedQuery = any; export type UsageDateRangeInfo = { dateRange?: [string, string]; }; export type PreAggregationUsageInfo = { cubeName: string; preAggregationName: string; external: boolean; usages: Record; }; export declare class PreAggregations { private readonly query; private readonly historyQueries; private readonly cubeLatticeCache; private readonly cubeLattices; private hasCumulativeMeasuresValue; preAggregationForQuery: PreAggregationForQuery | undefined; preAggregationUsageInfos: PreAggregationUsageInfo[] | undefined; constructor(query: BaseQuery, historyQueries: any, cubeLatticeCache: any); /** * It returns full pre-aggregation object (with keyQueries, previewSql, loadSql, and so on. */ preAggregationsDescription(): FullPreAggregationDescription[]; private preAggregationsDescriptionLocal; private preAggregationCubes; private preAggregationDescriptionsForUsageInfos; private static mergeUsageDateRanges; private preAggregationDescriptionsFor; private canPartitionsBeUsed; private addPartitionRangeTo; private partitionDimension; private preAggregationDescriptionsForRecursive; private hasCumulativeMeasures; aggregationsColumns(cube: string, preAggregation: PreAggregationDefinition): string[]; private preAggregationDescriptionFor; private preAggregationTableName; findPreAggregationToUseForCube(cube: string): PreAggregationForCube | null; static transformQueryToCanUseForm(query: BaseQuery): TransformedQuery; static ownedMembers(query: BaseQuery, members: any): string[]; static sortTimeDimensionsWithRollupGranularity(timeDimensions: BaseTimeDimension[] | undefined): [expressionPath: string, rollupGranularity: string | null][]; static timeDimensionsAsIs(timeDimensions: BaseTimeDimension[] | undefined): [expressionPath: string, resolvedGranularity: string | null][]; static collectFilterDimensionsWithSingleValueEqual(filters: any, map: any): any; static transformedQueryToReferences(query: any): { measures: any; dimensions: any; timeDimensions: any; }; private canUsePreAggregationFn; /** * Returns function to determine whether pre-aggregation can be used or not * for specified query, or its value for `refs` if specified. */ static canUsePreAggregationForTransformedQueryFn(transformedQuery: TransformedQuery, refs?: PreAggregationReferences | null): CanUsePreAggregationFn; private static squashDimensions; private static flattenMembers; private static flattenDimensionMembers; getCubeLattice(_cube: any, _preAggregationName: any, _preAggregation: any): unknown; /** * Returns pre-agg which determined as applicable for the query (the first one * from the list of potentially applicable pre-aggs). The order of the * potentially applicable pre-aggs is the same as the order in which these * pre-aggs appear in the schema file. */ findPreAggregationForQuery(): PreAggregationForQuery | undefined; private findAutoRollupPreAggregationsForCube; /** * Returns an array of potentially applicable for the query pre-aggs in the * same order they appear in the schema file. */ private rollupMatchResults; private findRollupPreAggregationsForCube; getRollupPreAggregationByName(cube: any, preAggregationName: any): PreAggregationForQueryWithTableName | {}; private collectJoinHintsFromRollupReferences; private buildRollupJoin; private preAggObjForJoin; private resolveJoinMembers; private cubesHintsFromPreAggregation; private evaluatedPreAggregationObj; static checkPartitionGranularityDefined(cube: string, preAggregationName: string, preAggregation: PreAggregationForQuery): string; static memberNameMismatchValidation(preAggA: PreAggregationForQuery, preAggB: PreAggregationForQuery, memberType: 'measures' | 'dimensions' | 'timeDimensions'): void; private static memberShortNames; rollupMatchResultDescriptions(): { name: string; tableName: string; references: PreAggregationReferences; canUsePreAggregation: boolean; }[]; canUseTransformedQuery(): TransformedQuery; static hasCumulativeMeasures(query: BaseQuery): boolean; castGranularity(granularity: any): any; collectOriginalSqlPreAggregations(fn: any): { preAggregations: never[]; result: unknown; }; private refreshRangeQuery; originalSqlPreAggregationQuery(cube: any, aggregation: any): BaseQuery; rollupPreAggregationQuery(cube: string, aggregation: PreAggregationDefinitionExtended, context?: EvaluateReferencesContext): BaseQuery; autoRollupPreAggregationQuery(cube: string, aggregation: PreAggregationDefinitionExtended): BaseQuery; private mergePartitionTimeDimensions; private autoRollupNameSuffix; private enrichMembersCubeJoinPath; private buildMembersFullName; private buildTimeDimensionsFullName; private evaluateAllReferences; originalSqlPreAggregationTable(preAggregationDescription: PreAggregationForCube): string; private rollupLambdaUnion; rollupPreAggregation(preAggregationForQuery: PreAggregationForQuery, measures: BaseMeasure[], isFullSimpleQuery: boolean, filters: any): string; private measuresRenderedReference; private measureAliasesRenderedReference; private dimensionsRenderedReference; private timeDimensionsRenderedReference; private rollupMembers; rollupMeasures(preAggregationForQuery: PreAggregationForQuery): string[]; rollupDimensions(preAggregationForQuery: PreAggregationForQuery): string[]; rollupTimeDimensions(preAggregationForQuery: PreAggregationForQuery): PreAggregationTimeDimensionReference[]; preAggregationId(preAggregation: PreAggregationForQuery): string; } //# sourceMappingURL=PreAggregations.d.ts.map