@@ -2257,129 +2257,147 @@ describe('PreAggregations', () => {
22572257 } ) ;
22582258 } ) ;
22592259
2260- it ( 'rollup join' , async ( ) => {
2261- await compiler . compile ( ) ;
2262-
2263- const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
2264- measures : [
2265- 'visitor_checkins.count' ,
2266- ] ,
2267- dimensions : [ 'visitors.source' ] ,
2268- preAggregationsSchema : '' ,
2269- order : [ {
2270- id : 'visitors.source' ,
2271- } ] ,
2272- timezone : 'UTC' ,
2260+ if ( getEnv ( 'nativeSqlPlanner' ) ) {
2261+ it . skip ( 'FIXME(tesseract): rollup join' , ( ) => {
2262+ // TODO: Fix in tesseract
22732263 } ) ;
2264+ } else {
2265+ it ( 'rollup join' , async ( ) => {
2266+ await compiler . compile ( ) ;
22742267
2275- const queryAndParams = query . buildSqlAndParams ( ) ;
2276- console . log ( queryAndParams ) ;
2277- const preAggregationsDescription : any = query . preAggregations ?. preAggregationsDescription ( ) ;
2278- console . log ( preAggregationsDescription ) ;
2268+ const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
2269+ measures : [
2270+ 'visitor_checkins.count' ,
2271+ ] ,
2272+ dimensions : [ 'visitors.source' ] ,
2273+ preAggregationsSchema : '' ,
2274+ order : [ {
2275+ id : 'visitors.source' ,
2276+ } ] ,
2277+ timezone : 'UTC' ,
2278+ } ) ;
22792279
2280- console . log ( query . preAggregations ?. rollupMatchResultDescriptions ( ) ) ;
2280+ const queryAndParams = query . buildSqlAndParams ( ) ;
2281+ console . log ( queryAndParams ) ;
2282+ const preAggregationsDescription : any = query . preAggregations ?. preAggregationsDescription ( ) ;
2283+ console . log ( preAggregationsDescription ) ;
22812284
2282- const queries = dbRunner . tempTablePreAggregations ( preAggregationsDescription ) ;
2285+ console . log ( query . preAggregations ?. rollupMatchResultDescriptions ( ) ) ;
22832286
2284- console . log ( JSON . stringify ( queries . concat ( queryAndParams ) ) ) ;
2287+ const queries = dbRunner . tempTablePreAggregations ( preAggregationsDescription ) ;
22852288
2286- return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
2287- console . log ( JSON . stringify ( res ) ) ;
2288- expect ( res ) . toEqual (
2289- [
2290- { visitors__source : 'google' , vc__count : '1' } ,
2291- { visitors__source : 'some' , vc__count : '5' } ,
2292- { visitors__source : null , vc__count : '0' } ,
2293- ] ,
2294- ) ;
2295- } ) ;
2296- } ) ;
2289+ console . log ( JSON . stringify ( queries . concat ( queryAndParams ) ) ) ;
22972290
2298- it ( 'rollup join existing joins' , async ( ) => {
2299- await compiler . compile ( ) ;
2291+ return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
2292+ console . log ( JSON . stringify ( res ) ) ;
2293+ expect ( res ) . toEqual (
2294+ [
2295+ { visitors__source : 'google' , vc__count : '1' } ,
2296+ { visitors__source : 'some' , vc__count : '5' } ,
2297+ { visitors__source : null , vc__count : '0' } ,
2298+ ] ,
2299+ ) ;
2300+ } ) ;
2301+ } ) ;
2302+ }
23002303
2301- const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
2302- measures : [
2303- 'visitor_checkins.count' ,
2304- ] ,
2305- dimensions : [ 'visitors.source' , 'cards.visitorId' ] ,
2306- preAggregationsSchema : '' ,
2307- order : [ {
2308- id : 'visitors.source' ,
2309- } , {
2310- id : 'cards.visitorId' ,
2311- } ] ,
2312- timezone : 'UTC' ,
2304+ if ( getEnv ( 'nativeSqlPlanner' ) ) {
2305+ it . skip ( 'FIXME(tesseract): rollup join existing joins' , ( ) => {
2306+ // TODO: Fix in tesseract
23132307 } ) ;
2308+ } else {
2309+ it ( 'rollup join existing joins' , async ( ) => {
2310+ await compiler . compile ( ) ;
23142311
2315- const queryAndParams = query . buildSqlAndParams ( ) ;
2316- console . log ( queryAndParams ) ;
2317- const preAggregationsDescription = query . preAggregations ?. preAggregationsDescription ( ) ;
2318- console . log ( preAggregationsDescription ) ;
2312+ const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
2313+ measures : [
2314+ 'visitor_checkins.count' ,
2315+ ] ,
2316+ dimensions : [ 'visitors.source' , 'cards.visitorId' ] ,
2317+ preAggregationsSchema : '' ,
2318+ order : [ {
2319+ id : 'visitors.source' ,
2320+ } , {
2321+ id : 'cards.visitorId' ,
2322+ } ] ,
2323+ timezone : 'UTC' ,
2324+ } ) ;
23192325
2320- console . log ( query . preAggregations ?. rollupMatchResultDescriptions ( ) ) ;
2326+ const queryAndParams = query . buildSqlAndParams ( ) ;
2327+ console . log ( queryAndParams ) ;
2328+ const preAggregationsDescription = query . preAggregations ?. preAggregationsDescription ( ) ;
2329+ console . log ( preAggregationsDescription ) ;
23212330
2322- const queries = dbRunner . tempTablePreAggregations ( preAggregationsDescription ) ;
2331+ console . log ( query . preAggregations ?. rollupMatchResultDescriptions ( ) ) ;
23232332
2324- console . log ( JSON . stringify ( queries . concat ( queryAndParams ) ) ) ;
2333+ const queries = dbRunner . tempTablePreAggregations ( preAggregationsDescription ) ;
23252334
2326- return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
2327- console . log ( JSON . stringify ( res ) ) ;
2328- expect ( res ) . toEqual (
2329- [
2330- { visitors__source : 'google' , cards__visitor_id : 3 , vc__count : '1' } ,
2331- { visitors__source : 'some' , cards__visitor_id : 1 , vc__count : '3' } ,
2332- { visitors__source : 'some' , cards__visitor_id : null , vc__count : '2' } ,
2333- { visitors__source : null , cards__visitor_id : null , vc__count : '0' } ,
2334- ] ,
2335- ) ;
2336- } ) ;
2337- } ) ;
2335+ console . log ( JSON . stringify ( queries . concat ( queryAndParams ) ) ) ;
23382336
2339- it ( 'rollup join partitioned' , async ( ) => {
2340- await compiler . compile ( ) ;
2337+ return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
2338+ console . log ( JSON . stringify ( res ) ) ;
2339+ expect ( res ) . toEqual (
2340+ [
2341+ { visitors__source : 'google' , cards__visitor_id : 3 , vc__count : '1' } ,
2342+ { visitors__source : 'some' , cards__visitor_id : 1 , vc__count : '3' } ,
2343+ { visitors__source : 'some' , cards__visitor_id : null , vc__count : '2' } ,
2344+ { visitors__source : null , cards__visitor_id : null , vc__count : '0' } ,
2345+ ] ,
2346+ ) ;
2347+ } ) ;
2348+ } ) ;
2349+ }
23412350
2342- const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
2343- measures : [
2344- 'visitor_checkins.count' ,
2345- ] ,
2346- dimensions : [ 'visitors.source' ] ,
2347- timezone : 'America/Los_Angeles' ,
2348- preAggregationsSchema : '' ,
2349- timeDimensions : [ {
2350- dimension : 'visitors.createdAt' ,
2351- granularity : 'hour' ,
2352- dateRange : [ '2017-01-03' , '2017-01-04' ]
2353- } ] ,
2354- order : [ {
2355- id : 'visitors.createdAt'
2356- } ] ,
2351+ if ( getEnv ( 'nativeSqlPlanner' ) ) {
2352+ it . skip ( 'FIXME(tesseract): rollup join partitioned' , ( ) => {
2353+ // TODO: Fix in tesseract
23572354 } ) ;
2355+ } else {
2356+ it ( 'rollup join partitioned' , async ( ) => {
2357+ await compiler . compile ( ) ;
23582358
2359- const queryAndParams = query . buildSqlAndParams ( ) ;
2360- console . log ( queryAndParams ) ;
2361- const preAggregationsDescription = query . preAggregations ?. preAggregationsDescription ( ) ;
2362- console . log ( preAggregationsDescription ) ;
2359+ const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
2360+ measures : [
2361+ 'visitor_checkins.count' ,
2362+ ] ,
2363+ dimensions : [ 'visitors.source' ] ,
2364+ timezone : 'America/Los_Angeles' ,
2365+ preAggregationsSchema : '' ,
2366+ timeDimensions : [ {
2367+ dimension : 'visitors.createdAt' ,
2368+ granularity : 'hour' ,
2369+ dateRange : [ '2017-01-03' , '2017-01-04' ]
2370+ } ] ,
2371+ order : [ {
2372+ id : 'visitors.createdAt'
2373+ } ] ,
2374+ } ) ;
23632375
2364- console . log ( query . preAggregations ?. rollupMatchResultDescriptions ( ) ) ;
2376+ const queryAndParams = query . buildSqlAndParams ( ) ;
2377+ console . log ( queryAndParams ) ;
2378+ const preAggregationsDescription = query . preAggregations ?. preAggregationsDescription ( ) ;
2379+ console . log ( preAggregationsDescription ) ;
23652380
2366- const queries = dbRunner . tempTablePreAggregations ( preAggregationsDescription ) ;
2381+ console . log ( query . preAggregations ?. rollupMatchResultDescriptions ( ) ) ;
23672382
2368- console . log ( JSON . stringify ( queries . concat ( queryAndParams ) ) ) ;
2383+ const queries = dbRunner . tempTablePreAggregations ( preAggregationsDescription ) ;
23692384
2370- return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
2371- console . log ( JSON . stringify ( res ) ) ;
2372- expect ( res ) . toEqual (
2373- [
2374- {
2375- visitors__source : 'some' ,
2376- visitors__created_at_hour : '2017-01-04T16:00:00.000Z' ,
2377- vc__count : '2'
2378- }
2379- ] ,
2380- ) ;
2385+ console . log ( JSON . stringify ( queries . concat ( queryAndParams ) ) ) ;
2386+
2387+ return dbRunner . evaluateQueryWithPreAggregations ( query ) . then ( res => {
2388+ console . log ( JSON . stringify ( res ) ) ;
2389+ expect ( res ) . toEqual (
2390+ [
2391+ {
2392+ visitors__source : 'some' ,
2393+ visitors__created_at_hour : '2017-01-04T16:00:00.000Z' ,
2394+ vc__count : '2'
2395+ }
2396+ ] ,
2397+ ) ;
2398+ } ) ;
23812399 } ) ;
2382- } ) ;
2400+ }
23832401
23842402 it ( 'partitioned without time' , async ( ) => {
23852403 await compiler . compile ( ) ;
0 commit comments