File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
packages/cubejs-schema-compiler/src Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ import { CubeSymbols } from '../compiler/CubeSymbols';
44import { UserError } from '../compiler/UserError' ;
55import { BaseQuery } from './BaseQuery' ;
66import {
7- PreAggregationDefinition , PreAggregationDefinitions ,
7+ PreAggregationDefinition ,
8+ PreAggregationDefinitions ,
89 PreAggregationReferences ,
910 PreAggregationTimeDimensionReference
1011} from '../compiler/CubeEvaluator' ;
@@ -1297,6 +1298,7 @@ export class PreAggregations {
12971298 const preAggQuery = this . query . preAggregationQueryForSqlEvaluation ( cube , aggregation , { inPreAggEvaluation : true } ) ;
12981299 const aggregateMeasures = preAggQuery ?. fullKeyQueryAggregateMeasures ( { hasMultipliedForPreAggregation : true } ) ;
12991300 references . multipliedMeasures = aggregateMeasures ?. multipliedMeasures ?. map ( m => m . measure ) ;
1301+ references . joinTree = preAggQuery ?. join ;
13001302 }
13011303 if ( aggregation . type === 'rollupLambda' ) {
13021304 if ( references . rollups . length > 0 ) {
Original file line number Diff line number Diff line change @@ -115,6 +115,25 @@ export type PreAggregationTimeDimensionReference = {
115115 granularity : string ,
116116} ;
117117
118+ // TODO: Move to JonGraph when it will be ts
119+ export type JoinEdge = {
120+ from : string ;
121+ to : string ;
122+ originalFrom : string ;
123+ originalTo : string ;
124+ join : {
125+ relationship : string ; // TODO Use an enum from validator
126+ sql : Function ,
127+ }
128+ } ;
129+
130+ // TODO: Move to JonGraph when it will be ts
131+ export type JoinTree = {
132+ root : string ;
133+ joins : JoinEdge [ ] ;
134+ multiplicationFactor : Record < string , boolean > ;
135+ } ;
136+
118137/// Strings in `dimensions`, `measures` and `timeDimensions[*].dimension` can contain full join path, not just `cube.member`
119138export type PreAggregationReferences = {
120139 allowNonStrictDateRangeMatch ?: boolean ,
@@ -123,6 +142,7 @@ export type PreAggregationReferences = {
123142 timeDimensions : Array < PreAggregationTimeDimensionReference > ,
124143 rollups : Array < string > ,
125144 multipliedMeasures ?: Array < string > ,
145+ joinTree ?: JoinTree ;
126146} ;
127147
128148export type PreAggregationInfo = {
You can’t perform that action at this time.
0 commit comments