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';
4
4
import { UserError } from '../compiler/UserError' ;
5
5
import { BaseQuery } from './BaseQuery' ;
6
6
import {
7
- PreAggregationDefinition , PreAggregationDefinitions ,
7
+ PreAggregationDefinition ,
8
+ PreAggregationDefinitions ,
8
9
PreAggregationReferences ,
9
10
PreAggregationTimeDimensionReference
10
11
} from '../compiler/CubeEvaluator' ;
@@ -1297,6 +1298,7 @@ export class PreAggregations {
1297
1298
const preAggQuery = this . query . preAggregationQueryForSqlEvaluation ( cube , aggregation , { inPreAggEvaluation : true } ) ;
1298
1299
const aggregateMeasures = preAggQuery ?. fullKeyQueryAggregateMeasures ( { hasMultipliedForPreAggregation : true } ) ;
1299
1300
references . multipliedMeasures = aggregateMeasures ?. multipliedMeasures ?. map ( m => m . measure ) ;
1301
+ references . joinTree = preAggQuery ?. join ;
1300
1302
}
1301
1303
if ( aggregation . type === 'rollupLambda' ) {
1302
1304
if ( references . rollups . length > 0 ) {
Original file line number Diff line number Diff line change @@ -115,6 +115,25 @@ export type PreAggregationTimeDimensionReference = {
115
115
granularity : string ,
116
116
} ;
117
117
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
+
118
137
/// Strings in `dimensions`, `measures` and `timeDimensions[*].dimension` can contain full join path, not just `cube.member`
119
138
export type PreAggregationReferences = {
120
139
allowNonStrictDateRangeMatch ?: boolean ,
@@ -123,6 +142,7 @@ export type PreAggregationReferences = {
123
142
timeDimensions : Array < PreAggregationTimeDimensionReference > ,
124
143
rollups : Array < string > ,
125
144
multipliedMeasures ?: Array < string > ,
145
+ joinTree ?: JoinTree ;
126
146
} ;
127
147
128
148
export type PreAggregationInfo = {
You can’t perform that action at this time.
0 commit comments