You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(schema-compiler): Fix timeshift measure queries coming from SQL API (#9570)
* wip
* fix expression path for dimension
* add comment
* add timeshift support for member expressions coming from SQL API
* fix timeshifts for views
* remove old timeshift flow
* Add tests
thrownewUserError(`Hierarchical time shift is not supported but was provided for '${td.dimension}'. Parent time shift is '${td.shiftInterval}' and current is '${timeShift.interval}'`);
thrownewUserError(`Hierarchical time shift is not supported but was provided for '${td.dimension}'. Parent time shift is '${td.shiftInterval}' and current is '${timeShift.interval}'`);
thrownewUserError(`Hierarchical time shift is not supported but was provided for '${memPath}'. Parent time shift is '${symbol.shiftInterval}' and current is '${this.safeEvaluateSymbolContext().timeShifts?.[memPath]}'`);
thrownewUserError(`Hierarchical time shift is not supported but was provided for '${memPath}'. Parent time shift is '${symbol.shiftInterval}' and current is '${this.safeEvaluateSymbolContext().commonTimeShift}'`);
Copy file name to clipboardExpand all lines: packages/cubejs-testing-drivers/test/__snapshots__/athena-export-bucket-s3-full.test.ts.snap
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,51 @@ Array [
14
14
]
15
15
`;
16
16
17
+
exports[`Queries with the @cubejs-backend/athena-driver SQL API: Timeshift measure from cube 1`] =`
18
+
Array [
19
+
Object {
20
+
"orderDate": 2020-02-01T00:00:00.000Z,
21
+
"totalQuantity": 2,
22
+
"totalQuantityPriorMonth": 6,
23
+
},
24
+
Object {
25
+
"orderDate": 2020-03-01T00:00:00.000Z,
26
+
"totalQuantity": 13,
27
+
"totalQuantityPriorMonth": 2,
28
+
},
29
+
Object {
30
+
"orderDate": 2020-04-01T00:00:00.000Z,
31
+
"totalQuantity": 3,
32
+
"totalQuantityPriorMonth": 13,
33
+
},
34
+
Object {
35
+
"orderDate": 2020-05-01T00:00:00.000Z,
36
+
"totalQuantity": 15,
37
+
"totalQuantityPriorMonth": 3,
38
+
},
39
+
Object {
40
+
"orderDate": 2020-06-01T00:00:00.000Z,
41
+
"totalQuantity": 18,
42
+
"totalQuantityPriorMonth": 15,
43
+
},
44
+
Object {
45
+
"orderDate": 2020-10-01T00:00:00.000Z,
46
+
"totalQuantity": 11,
47
+
"totalQuantityPriorMonth": 27,
48
+
},
49
+
Object {
50
+
"orderDate": 2020-11-01T00:00:00.000Z,
51
+
"totalQuantity": 43,
52
+
"totalQuantityPriorMonth": 11,
53
+
},
54
+
Object {
55
+
"orderDate": 2020-12-01T00:00:00.000Z,
56
+
"totalQuantity": 22,
57
+
"totalQuantityPriorMonth": 43,
58
+
},
59
+
]
60
+
`;
61
+
17
62
exports[`Queries with the @cubejs-backend/athena-driver SQL API: metabase count cast to float32 from push down: metabase_count_cast_to_float32_from_push_down 1`] =`
Copy file name to clipboardExpand all lines: packages/cubejs-testing-drivers/test/__snapshots__/bigquery-export-bucket-gcs-full.test.ts.snap
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3226,6 +3226,51 @@ Array [
3226
3226
]
3227
3227
`;
3228
3228
3229
+
exports[`Queries with the @cubejs-backend/bigquery-driver SQL API: Timeshift measure from cube 1`] =`
3230
+
Array [
3231
+
Object {
3232
+
"orderDate": 2020-02-01T00:00:00.000Z,
3233
+
"totalQuantity": 2,
3234
+
"totalQuantityPriorMonth": 6,
3235
+
},
3236
+
Object {
3237
+
"orderDate": 2020-03-01T00:00:00.000Z,
3238
+
"totalQuantity": 13,
3239
+
"totalQuantityPriorMonth": 2,
3240
+
},
3241
+
Object {
3242
+
"orderDate": 2020-04-01T00:00:00.000Z,
3243
+
"totalQuantity": 3,
3244
+
"totalQuantityPriorMonth": 13,
3245
+
},
3246
+
Object {
3247
+
"orderDate": 2020-05-01T00:00:00.000Z,
3248
+
"totalQuantity": 15,
3249
+
"totalQuantityPriorMonth": 3,
3250
+
},
3251
+
Object {
3252
+
"orderDate": 2020-06-01T00:00:00.000Z,
3253
+
"totalQuantity": 18,
3254
+
"totalQuantityPriorMonth": 15,
3255
+
},
3256
+
Object {
3257
+
"orderDate": 2020-10-01T00:00:00.000Z,
3258
+
"totalQuantity": 11,
3259
+
"totalQuantityPriorMonth": 27,
3260
+
},
3261
+
Object {
3262
+
"orderDate": 2020-11-01T00:00:00.000Z,
3263
+
"totalQuantity": 43,
3264
+
"totalQuantityPriorMonth": 11,
3265
+
},
3266
+
Object {
3267
+
"orderDate": 2020-12-01T00:00:00.000Z,
3268
+
"totalQuantity": 22,
3269
+
"totalQuantityPriorMonth": 43,
3270
+
},
3271
+
]
3272
+
`;
3273
+
3229
3274
exports[`Queries with the @cubejs-backend/bigquery-driver SQL API: metabase count cast to float32 from push down: metabase_count_cast_to_float32_from_push_down 1`] =`
Copy file name to clipboardExpand all lines: packages/cubejs-testing-drivers/test/__snapshots__/clickhouse-export-bucket-s3-full.test.ts.snap
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1620,6 +1620,51 @@ Array [
1620
1620
]
1621
1621
`;
1622
1622
1623
+
exports[`Queries with the @cubejs-backend/clickhouse-driver export-bucket-s3 SQL API: Timeshift measure from cube 1`] =`
1624
+
Array [
1625
+
Object {
1626
+
"orderDate": 2020-02-01T00:00:00.000Z,
1627
+
"totalQuantity": 2,
1628
+
"totalQuantityPriorMonth": 6,
1629
+
},
1630
+
Object {
1631
+
"orderDate": 2020-03-01T00:00:00.000Z,
1632
+
"totalQuantity": 13,
1633
+
"totalQuantityPriorMonth": 2,
1634
+
},
1635
+
Object {
1636
+
"orderDate": 2020-04-01T00:00:00.000Z,
1637
+
"totalQuantity": 3,
1638
+
"totalQuantityPriorMonth": 13,
1639
+
},
1640
+
Object {
1641
+
"orderDate": 2020-05-01T00:00:00.000Z,
1642
+
"totalQuantity": 15,
1643
+
"totalQuantityPriorMonth": 3,
1644
+
},
1645
+
Object {
1646
+
"orderDate": 2020-06-01T00:00:00.000Z,
1647
+
"totalQuantity": 18,
1648
+
"totalQuantityPriorMonth": 15,
1649
+
},
1650
+
Object {
1651
+
"orderDate": 2020-10-01T00:00:00.000Z,
1652
+
"totalQuantity": 11,
1653
+
"totalQuantityPriorMonth": 27,
1654
+
},
1655
+
Object {
1656
+
"orderDate": 2020-11-01T00:00:00.000Z,
1657
+
"totalQuantity": 43,
1658
+
"totalQuantityPriorMonth": 11,
1659
+
},
1660
+
Object {
1661
+
"orderDate": 2020-12-01T00:00:00.000Z,
1662
+
"totalQuantity": 22,
1663
+
"totalQuantityPriorMonth": 43,
1664
+
},
1665
+
]
1666
+
`;
1667
+
1623
1668
exports[`Queries with the @cubejs-backend/clickhouse-driver export-bucket-s3 SQL API: metabase count cast to float32 from push down: metabase_count_cast_to_float32_from_push_down 1`] =`
0 commit comments