@@ -1217,136 +1217,148 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
12171217 }
12181218 ] ) ) ;
12191219
1220- it ( 'custom granularity rolling window to_date with one time dimension with regular granularity' , async ( ) => runQueryTest ( {
1221- measures : [
1222- 'visitors.countRollingThreeDaysToDate'
1223- ] ,
1224- timeDimensions : [
1220+ if ( getEnv ( 'nativeSqlPlanner' ) ) {
1221+ it ( 'custom granularity rolling window to_date with one time dimension with regular granularity' , async ( ) => runQueryTest ( {
1222+ measures : [
1223+ 'visitors.countRollingThreeDaysToDate'
1224+ ] ,
1225+ timeDimensions : [
1226+ {
1227+ dimension : 'visitors.created_at' ,
1228+ granularity : 'day' ,
1229+ dateRange : [ '2017-01-01' , '2017-01-10' ]
1230+ }
1231+ ] ,
1232+ order : [ {
1233+ id : 'visitors.created_at'
1234+ } ] ,
1235+ timezone : 'America/Los_Angeles'
1236+ } , [
12251237 {
1226- dimension : 'visitors.created_at' ,
1227- granularity : 'day' ,
1228- dateRange : [ '2017-01-01' , '2017-01-10' ]
1229- }
1230- ] ,
1231- order : [ {
1232- id : 'visitors.created_at'
1233- } ] ,
1234- timezone : 'America/Los_Angeles'
1235- } , [
1236- {
1237- visitors__count_rolling_three_days_to_date : null ,
1238- visitors__created_at_day : '2017-01-01T00:00:00.000Z' ,
1239- } ,
1240- {
1241- visitors__count_rolling_three_days_to_date : '1' ,
1242- visitors__created_at_day : '2017-01-02T00:00:00.000Z' ,
1243- } ,
1244- {
1245- visitors__count_rolling_three_days_to_date : '1' ,
1246- visitors__created_at_day : '2017-01-03T00:00:00.000Z' ,
1247- } ,
1248- {
1249- visitors__count_rolling_three_days_to_date : '1' ,
1250- visitors__created_at_day : '2017-01-04T00:00:00.000Z' ,
1251- } ,
1252- {
1253- visitors__count_rolling_three_days_to_date : '2' ,
1254- visitors__created_at_day : '2017-01-05T00:00:00.000Z' ,
1255- } ,
1256- {
1257- visitors__count_rolling_three_days_to_date : '4' ,
1258- visitors__created_at_day : '2017-01-06T00:00:00.000Z' ,
1259- } ,
1260- {
1261- visitors__count_rolling_three_days_to_date : null ,
1262- visitors__created_at_day : '2017-01-07T00:00:00.000Z' ,
1263- } ,
1264- {
1265- visitors__count_rolling_three_days_to_date : null ,
1266- visitors__created_at_day : '2017-01-08T00:00:00.000Z' ,
1267- } ,
1268- {
1269- visitors__count_rolling_three_days_to_date : null ,
1270- visitors__created_at_day : '2017-01-09T00:00:00.000Z' ,
1271- } ,
1272- {
1273- visitors__count_rolling_three_days_to_date : null ,
1274- visitors__created_at_day : '2017-01-10T00:00:00.000Z' ,
1275- } ,
1276- ] ) ) ;
1238+ visitors__count_rolling_three_days_to_date : null ,
1239+ visitors__created_at_day : '2017-01-01T00:00:00.000Z' ,
1240+ } ,
1241+ {
1242+ visitors__count_rolling_three_days_to_date : '1' ,
1243+ visitors__created_at_day : '2017-01-02T00:00:00.000Z' ,
1244+ } ,
1245+ {
1246+ visitors__count_rolling_three_days_to_date : '1' ,
1247+ visitors__created_at_day : '2017-01-03T00:00:00.000Z' ,
1248+ } ,
1249+ {
1250+ visitors__count_rolling_three_days_to_date : '1' ,
1251+ visitors__created_at_day : '2017-01-04T00:00:00.000Z' ,
1252+ } ,
1253+ {
1254+ visitors__count_rolling_three_days_to_date : '2' ,
1255+ visitors__created_at_day : '2017-01-05T00:00:00.000Z' ,
1256+ } ,
1257+ {
1258+ visitors__count_rolling_three_days_to_date : '4' ,
1259+ visitors__created_at_day : '2017-01-06T00:00:00.000Z' ,
1260+ } ,
1261+ {
1262+ visitors__count_rolling_three_days_to_date : null ,
1263+ visitors__created_at_day : '2017-01-07T00:00:00.000Z' ,
1264+ } ,
1265+ {
1266+ visitors__count_rolling_three_days_to_date : null ,
1267+ visitors__created_at_day : '2017-01-08T00:00:00.000Z' ,
1268+ } ,
1269+ {
1270+ visitors__count_rolling_three_days_to_date : null ,
1271+ visitors__created_at_day : '2017-01-09T00:00:00.000Z' ,
1272+ } ,
1273+ {
1274+ visitors__count_rolling_three_days_to_date : null ,
1275+ visitors__created_at_day : '2017-01-10T00:00:00.000Z' ,
1276+ } ,
1277+ ] ) ) ;
1278+ } else {
1279+ it . skip ( 'NO_BASE_QUERY_SUPPORT: custom granularity rolling window to_date with one time dimension with regular granularity' , ( ) => {
1280+ // Skipping because it works only in Tesseract
1281+ } ) ;
1282+ }
12771283
1278- it ( 'custom granularity rolling window to_date with two time dimension granularities one custom one regular' , async ( ) => runQueryTest ( {
1279- measures : [
1280- 'visitors.countRollingThreeDaysToDate'
1281- ] ,
1282- timeDimensions : [
1284+ if ( getEnv ( 'nativeSqlPlanner' ) ) {
1285+ it ( 'custom granularity rolling window to_date with two time dimension granularities one custom one regular' , async ( ) => runQueryTest ( {
1286+ measures : [
1287+ 'visitors.countRollingThreeDaysToDate'
1288+ ] ,
1289+ timeDimensions : [
1290+ {
1291+ dimension : 'visitors.created_at' ,
1292+ granularity : 'three_days' ,
1293+ dateRange : [ '2017-01-01' , '2017-01-10' ]
1294+ } ,
1295+ {
1296+ dimension : 'visitors.created_at' ,
1297+ granularity : 'day' ,
1298+ dateRange : [ '2017-01-01' , '2017-01-10' ]
1299+ }
1300+ ] ,
1301+ order : [ {
1302+ id : 'visitors.created_at'
1303+ } ] ,
1304+ timezone : 'America/Los_Angeles'
1305+ } , [
12831306 {
1284- dimension : 'visitors.created_at' ,
1285- granularity : 'three_days ' ,
1286- dateRange : [ '2017-01-01' , '2017-01-10' ]
1307+ visitors__count_rolling_three_days_to_date : null ,
1308+ visitors__created_at_day : '2017-01-01T00:00:00.000Z ' ,
1309+ visitors__created_at_three_days : '2017-01-01T00:00:00.000Z' ,
12871310 } ,
12881311 {
1289- dimension : 'visitors.created_at' ,
1290- granularity : 'day' ,
1291- dateRange : [ '2017-01-01' , '2017-01-10' ]
1292- }
1293- ] ,
1294- order : [ {
1295- id : 'visitors.created_at'
1296- } ] ,
1297- timezone : 'America/Los_Angeles'
1298- } , [
1299- {
1300- visitors__count_rolling_three_days_to_date : null ,
1301- visitors__created_at_day : '2017-01-01T00:00:00.000Z' ,
1302- visitors__created_at_three_days : '2017-01-01T00:00:00.000Z' ,
1303- } ,
1304- {
1305- visitors__count_rolling_three_days_to_date : '1' ,
1306- visitors__created_at_day : '2017-01-02T00:00:00.000Z' ,
1307- visitors__created_at_three_days : '2017-01-01T00:00:00.000Z' ,
1308- } ,
1309- {
1310- visitors__count_rolling_three_days_to_date : '1' ,
1311- visitors__created_at_day : '2017-01-03T00:00:00.000Z' ,
1312- visitors__created_at_three_days : '2017-01-01T00:00:00.000Z' ,
1313- } ,
1314- {
1315- visitors__count_rolling_three_days_to_date : '1' ,
1316- visitors__created_at_day : '2017-01-04T00:00:00.000Z' ,
1317- visitors__created_at_three_days : '2017-01-04T00:00:00.000Z' ,
1318- } ,
1319- {
1320- visitors__count_rolling_three_days_to_date : '2' ,
1321- visitors__created_at_day : '2017-01-05T00:00:00.000Z' ,
1322- visitors__created_at_three_days : '2017-01-04T00:00:00.000Z' ,
1323- } ,
1324- {
1325- visitors__count_rolling_three_days_to_date : '4' ,
1326- visitors__created_at_day : '2017-01-06T00:00:00.000Z' ,
1327- visitors__created_at_three_days : '2017-01-04T00:00:00.000Z' ,
1328- } ,
1329- {
1330- visitors__count_rolling_three_days_to_date : null ,
1331- visitors__created_at_day : '2017-01-07T00:00:00.000Z' ,
1332- visitors__created_at_three_days : '2017-01-07T00:00:00.000Z' ,
1333- } ,
1334- {
1335- visitors__count_rolling_three_days_to_date : null ,
1336- visitors__created_at_day : '2017-01-08T00:00:00.000Z' ,
1337- visitors__created_at_three_days : '2017-01-07T00:00:00.000Z' ,
1338- } ,
1339- {
1340- visitors__count_rolling_three_days_to_date : null ,
1341- visitors__created_at_day : '2017-01-09T00:00:00.000Z' ,
1342- visitors__created_at_three_days : '2017-01-07T00:00:00.000Z' ,
1343- } ,
1344- {
1345- visitors__count_rolling_three_days_to_date : null ,
1346- visitors__created_at_day : '2017-01-10T00:00:00.000Z' ,
1347- visitors__created_at_three_days : '2017-01-10T00:00:00.000Z' ,
1348- } ,
1349- ] ) ) ;
1312+ visitors__count_rolling_three_days_to_date : '1' ,
1313+ visitors__created_at_day : '2017-01-02T00:00:00.000Z' ,
1314+ visitors__created_at_three_days : '2017-01-01T00:00:00.000Z' ,
1315+ } ,
1316+ {
1317+ visitors__count_rolling_three_days_to_date : '1' ,
1318+ visitors__created_at_day : '2017-01-03T00:00:00.000Z' ,
1319+ visitors__created_at_three_days : '2017-01-01T00:00:00.000Z' ,
1320+ } ,
1321+ {
1322+ visitors__count_rolling_three_days_to_date : '1' ,
1323+ visitors__created_at_day : '2017-01-04T00:00:00.000Z' ,
1324+ visitors__created_at_three_days : '2017-01-04T00:00:00.000Z' ,
1325+ } ,
1326+ {
1327+ visitors__count_rolling_three_days_to_date : '2' ,
1328+ visitors__created_at_day : '2017-01-05T00:00:00.000Z' ,
1329+ visitors__created_at_three_days : '2017-01-04T00:00:00.000Z' ,
1330+ } ,
1331+ {
1332+ visitors__count_rolling_three_days_to_date : '4' ,
1333+ visitors__created_at_day : '2017-01-06T00:00:00.000Z' ,
1334+ visitors__created_at_three_days : '2017-01-04T00:00:00.000Z' ,
1335+ } ,
1336+ {
1337+ visitors__count_rolling_three_days_to_date : null ,
1338+ visitors__created_at_day : '2017-01-07T00:00:00.000Z' ,
1339+ visitors__created_at_three_days : '2017-01-07T00:00:00.000Z' ,
1340+ } ,
1341+ {
1342+ visitors__count_rolling_three_days_to_date : null ,
1343+ visitors__created_at_day : '2017-01-08T00:00:00.000Z' ,
1344+ visitors__created_at_three_days : '2017-01-07T00:00:00.000Z' ,
1345+ } ,
1346+ {
1347+ visitors__count_rolling_three_days_to_date : null ,
1348+ visitors__created_at_day : '2017-01-09T00:00:00.000Z' ,
1349+ visitors__created_at_three_days : '2017-01-07T00:00:00.000Z' ,
1350+ } ,
1351+ {
1352+ visitors__count_rolling_three_days_to_date : null ,
1353+ visitors__created_at_day : '2017-01-10T00:00:00.000Z' ,
1354+ visitors__created_at_three_days : '2017-01-10T00:00:00.000Z' ,
1355+ } ,
1356+ ] ) ) ;
1357+ } else {
1358+ it . skip ( 'NO_BASE_QUERY_SUPPORT: custom granularity rolling window to_date with two time dimension granularities one custom one regular' , ( ) => {
1359+ // Skipping because it works only in Tesseract
1360+ } ) ;
1361+ }
13501362
13511363 it ( 'rolling window with same td with and without granularity' , async ( ) => runQueryTest ( {
13521364 measures : [
0 commit comments