@@ -1211,7 +1211,7 @@ describe('PreAggregations', () => {
12111211 } ) ;
12121212 } ) ;
12131213
1214- it ( 'non-match because of join tree difference' , async ( ) => {
1214+ it ( 'non-match because of join tree difference (through the view) ' , async ( ) => {
12151215 await compiler . compile ( ) ;
12161216 const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
12171217 measures : [
@@ -1269,6 +1269,33 @@ describe('PreAggregations', () => {
12691269 } ) ;
12701270 } ) ;
12711271
1272+ it ( 'non-match because of requesting only joined cube members' , async ( ) => {
1273+ await compiler . compile ( ) ;
1274+ const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
1275+ dimensions : [ 'visitor_checkins.source' ] ,
1276+ order : [ {
1277+ id : 'visitor_checkins.source'
1278+ } ] ,
1279+ timezone : 'America/Los_Angeles' ,
1280+ preAggregationsSchema : ''
1281+ } ) ;
1282+
1283+ const queryAndParams = query . buildSqlAndParams ( ) ;
1284+ console . log ( queryAndParams ) ;
1285+ expect ( ( < any > query ) . preAggregations . preAggregationForQuery ) . toBeUndefined ( ) ;
1286+
1287+ return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
1288+ expect ( res ) . toEqual ( [
1289+ {
1290+ vc__source : 'google' ,
1291+ } ,
1292+ {
1293+ vc__source : null ,
1294+ } ,
1295+ ] ) ;
1296+ } ) ;
1297+ } ) ;
1298+
12721299 it ( 'non-leaf additive measure' , async ( ) => {
12731300 await compiler . compile ( ) ;
12741301
0 commit comments