@@ -5298,90 +5298,78 @@ cubes:
52985298 type: string
52995299 ` ) ;
53005300
5301- if ( ! getEnv ( 'nativeSqlPlanner' ) ) {
5302- it ( 'querying cube dimension that require transitive joins' , async ( ) => {
5303- await compiler . compile ( ) ;
5304- const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
5305- measures : [ ] ,
5306- dimensions : [
5307- 'test_facts.reporting_date' ,
5308- 'test_facts.merchant_sk' ,
5309- 'test_facts.product_sk' ,
5310- 'test_facts.acquisition_channel'
5311- ] ,
5312- order : [ {
5313- id : 'test_facts.acquisition_channel'
5314- } ] ,
5315- timezone : 'America/Los_Angeles'
5316- } ) ;
5317-
5318- const res = await dbRunner . testQuery ( query . buildSqlAndParams ( ) ) ;
5319- console . log ( JSON . stringify ( res ) ) ;
5320-
5321- expect ( res ) . toEqual ( [
5322- {
5323- test_facts__acquisition_channel : 'Organic' ,
5324- test_facts__merchant_sk : 101 ,
5325- test_facts__product_sk : 201 ,
5326- test_facts__reporting_date : '2023-01-01T00:00:00.000Z' ,
5327- } ,
5328- {
5329- test_facts__acquisition_channel : 'Paid' ,
5330- test_facts__merchant_sk : 101 ,
5331- test_facts__product_sk : 202 ,
5332- test_facts__reporting_date : '2023-01-01T00:00:00.000Z' ,
5333- } ,
5334- {
5335- test_facts__acquisition_channel : 'Referral' ,
5336- test_facts__merchant_sk : 102 ,
5337- test_facts__product_sk : 201 ,
5338- test_facts__reporting_date : '2023-01-02T00:00:00.000Z' ,
5339- } ,
5340- ] ) ;
5341- } ) ;
5342- } else {
5343- it . skip ( 'FIXME(tesseract): querying cube dimension that require transitive joins' , async ( ) => {
5344- // FIXME should be implemented in Tesseract
5301+ it ( 'querying cube dimension that require transitive joins' , async ( ) => {
5302+ await compiler . compile ( ) ;
5303+ const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
5304+ measures : [ ] ,
5305+ dimensions : [
5306+ 'test_facts.reporting_date' ,
5307+ 'test_facts.merchant_sk' ,
5308+ 'test_facts.product_sk' ,
5309+ 'test_facts.acquisition_channel'
5310+ ] ,
5311+ order : [ {
5312+ id : 'test_facts.acquisition_channel'
5313+ } ] ,
5314+ timezone : 'America/Los_Angeles'
53455315 } ) ;
5346- }
53475316
5348- if ( ! getEnv ( 'nativeSqlPlanner' ) ) {
5349- it ( 'querying cube with transitive joins with a few joins to the same cube' , async ( ) => {
5350- await compiler . compile ( ) ;
5351-
5352- const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
5353- measures : [ ] ,
5354- dimensions : [
5355- 'alpha_facts.reporting_date' ,
5356- 'delta_bridge.b_name' ,
5357- 'alpha_facts.channel'
5358- ] ,
5359- order : [ {
5360- id : 'alpha_facts.reporting_date'
5361- } ] ,
5362- timezone : 'America/Los_Angeles'
5363- } ) ;
5317+ const res = await dbRunner . testQuery ( query . buildSqlAndParams ( ) ) ;
5318+ console . log ( JSON . stringify ( res ) ) ;
53645319
5365- const res = await dbRunner . testQuery ( query . buildSqlAndParams ( ) ) ;
5366- console . log ( JSON . stringify ( res ) ) ;
5320+ expect ( res ) . toEqual ( [
5321+ {
5322+ test_facts__acquisition_channel : 'Organic' ,
5323+ test_facts__merchant_sk : 101 ,
5324+ test_facts__product_sk : 201 ,
5325+ test_facts__reporting_date : '2023-01-01T00:00:00.000Z' ,
5326+ } ,
5327+ {
5328+ test_facts__acquisition_channel : 'Paid' ,
5329+ test_facts__merchant_sk : 101 ,
5330+ test_facts__product_sk : 202 ,
5331+ test_facts__reporting_date : '2023-01-01T00:00:00.000Z' ,
5332+ } ,
5333+ {
5334+ test_facts__acquisition_channel : 'Referral' ,
5335+ test_facts__merchant_sk : 102 ,
5336+ test_facts__product_sk : 201 ,
5337+ test_facts__reporting_date : '2023-01-02T00:00:00.000Z' ,
5338+ } ,
5339+ ] ) ;
5340+ } ) ;
53675341
5368- expect ( res ) . toEqual ( [
5369- {
5370- alpha_facts__channel : 'Organic' ,
5371- alpha_facts__reporting_date : '2023-01-01T00:00:00.000Z' ,
5372- delta_bridge__b_name : 'Beta1' ,
5373- } ,
5374- {
5375- alpha_facts__channel : 'Paid' ,
5376- alpha_facts__reporting_date : '2023-01-02T00:00:00.000Z' ,
5377- delta_bridge__b_name : 'Beta2' ,
5378- } ,
5379- ] ) ;
5380- } ) ;
5381- } else {
5382- it . skip ( 'FIXME(tesseract): querying cube with transitive joins with a few joins to the same cube' , async ( ) => {
5383- // FIXME should be implemented in Tesseract
5342+ it ( 'querying cube with transitive joins with a few joins to the same cube' , async ( ) => {
5343+ await compiler . compile ( ) ;
5344+
5345+ const query = new PostgresQuery ( { joinGraph, cubeEvaluator, compiler } , {
5346+ measures : [ ] ,
5347+ dimensions : [
5348+ 'alpha_facts.reporting_date' ,
5349+ 'delta_bridge.b_name' ,
5350+ 'alpha_facts.channel'
5351+ ] ,
5352+ order : [ {
5353+ id : 'alpha_facts.reporting_date'
5354+ } ] ,
5355+ timezone : 'America/Los_Angeles'
53845356 } ) ;
5385- }
5357+
5358+ const res = await dbRunner . testQuery ( query . buildSqlAndParams ( ) ) ;
5359+ console . log ( JSON . stringify ( res ) ) ;
5360+
5361+ expect ( res ) . toEqual ( [
5362+ {
5363+ alpha_facts__channel : 'Organic' ,
5364+ alpha_facts__reporting_date : '2023-01-01T00:00:00.000Z' ,
5365+ delta_bridge__b_name : 'Beta1' ,
5366+ } ,
5367+ {
5368+ alpha_facts__channel : 'Paid' ,
5369+ alpha_facts__reporting_date : '2023-01-02T00:00:00.000Z' ,
5370+ delta_bridge__b_name : 'Beta2' ,
5371+ } ,
5372+ ] ) ;
5373+ } ) ;
53865374 } ) ;
53875375} ) ;
0 commit comments