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
* **api-gateway:** allow switch sql user when the new user is the same ([#9037](https://github.com/cube-js/cube/issues/9037)) ([a69c28f](https://github.com/cube-js/cube/commit/a69c28f524fa0625b825b98a38e7f5a211a98f74))
23
+
* **api-gateway:** make sure DAP works sql pushdown ([#9021](https://github.com/cube-js/cube/issues/9021)) ([23695b2](https://github.com/cube-js/cube/commit/23695b2b5e886b5b7daf8b3f74003bb04e5b2e0b))
24
+
* **cubestore:** Allow create an index from expressions ([#9006](https://github.com/cube-js/cube/issues/9006)) ([222cab8](https://github.com/cube-js/cube/commit/222cab897c289bfc929f217483e4905204bac12f))
25
+
* **schema-compiler:** fix DAP with query_rewrite and python config ([#9033](https://github.com/cube-js/cube/issues/9033)) ([849790f](https://github.com/cube-js/cube/commit/849790f965dd0d9fddba11e3d8d124b84397ca9b))
* **cubesql:** Basic VALUES support in rewrite engine ([#9041](https://github.com/cube-js/cube/issues/9041)) ([368671f](https://github.com/cube-js/cube/commit/368671fd1b53b2ed5ad8df6af113492982f23c0c))
32
+
* **dremio-driver:** Add Dremio Cloud Support ([#8956](https://github.com/cube-js/cube/issues/8956)) ([d2c2fcd](https://github.com/cube-js/cube/commit/d2c2fcdaf8944ea7dd27e73b63c0b151c317022e))
33
+
* **tesseract:** Support multiple join paths within single query ([#9047](https://github.com/cube-js/cube/issues/9047)) ([b62446e](https://github.com/cube-js/cube/commit/b62446e3c3893068f8dd8aa32d7204ea06a16f98))
Copy file name to clipboardExpand all lines: docs/pages/reference/data-model/joins.mdx
+113Lines changed: 113 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -404,6 +404,119 @@ cubes:
404
404
405
405
</CodeTabs>
406
406
407
+
## Chasm and fan traps
408
+
409
+
Cube automatically detects chasm and fan traps based on the `many_to_one` and `one_to_many` relationships defined in join.
410
+
When detected, Cube generates a deduplication query that evaluates all distinct primary keys within the multiplied measure's cube and then joins distinct primary keys to this cube on itself to calculate the aggregation result.
411
+
If there's more than one multiplied measure in a query, then such query is generated for every such multiplied measure, and results are joined.
412
+
Cube solves for chasm and fan traps during query time.
413
+
If there's pre-aggregregation that fits measure multiplication requirements it'd be leveraged to serve such a query.
414
+
Such pre-aggregations and queries are always considered non-additive for the purpose of pre-aggregation matching.
415
+
416
+
Let's consider an example data model:
417
+
418
+
<CodeTabs>
419
+
420
+
```javascript
421
+
cube(`orders`, {
422
+
sql_table: `orders`
423
+
424
+
dimensions: {
425
+
id: {
426
+
sql: `id`,
427
+
type: `number`,
428
+
primary_key: true
429
+
},
430
+
city: {
431
+
sql: `city`,
432
+
type: `string`
433
+
}
434
+
},
435
+
436
+
joins: {
437
+
customers: {
438
+
relationship: `many_to_one`,
439
+
sql: `${CUBE}.customer_id = ${customers.id}`,
440
+
},
441
+
},
442
+
});
443
+
444
+
cube(`customers`, {
445
+
sql_table: `customers`
446
+
447
+
measures: {
448
+
count: {
449
+
type: `count`,
450
+
}
451
+
},
452
+
453
+
dimensions: {
454
+
id: {
455
+
sql: `id`,
456
+
type: `number`,
457
+
primary_key: true
458
+
}
459
+
}
460
+
});
461
+
```
462
+
463
+
```yaml
464
+
cubes:
465
+
- name: orders
466
+
sql_table: orders
467
+
468
+
dimensions:
469
+
- name: id
470
+
sql: id
471
+
type: number
472
+
primary_key: true
473
+
- name: city
474
+
sql: city
475
+
type: string
476
+
477
+
joins:
478
+
- name: customers
479
+
relationship: many_to_one
480
+
sql: "{orders}.customer_id = {customers.id}"
481
+
482
+
- name: customers
483
+
sql_table: customers
484
+
485
+
dimensions:
486
+
- name: id
487
+
sql: id
488
+
type: number
489
+
primary_key: true
490
+
491
+
measures:
492
+
- name: average_age
493
+
sql: age
494
+
type: avg
495
+
496
+
```
497
+
498
+
</CodeTabs>
499
+
500
+
If we try to query `customers.average_age` by `orders.city`, the Cube detects that the `average_age` measure in the `customers` cube would be multiplied by `orders` to `customers` and would generate SQL similar to:
Copy file name to clipboardExpand all lines: docs/pages/reference/data-model/pre-aggregations.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -921,7 +921,7 @@ cubes:
921
921
922
922
</CodeTabs>
923
923
924
-
For possible `every` parameter values please refer to
924
+
To have a pre-aggregation rebuild at a specific time of day, you can use a CRON string with some limitations. For more details about values that can be used with the `every` parameter, please refer to the
***api-gateway:** allow switch sql user when the new user is the same ([#9037](https://github.com/cube-js/cube/issues/9037)) ([a69c28f](https://github.com/cube-js/cube/commit/a69c28f524fa0625b825b98a38e7f5a211a98f74))
12
+
***api-gateway:** make sure DAP works sql pushdown ([#9021](https://github.com/cube-js/cube/issues/9021)) ([23695b2](https://github.com/cube-js/cube/commit/23695b2b5e886b5b7daf8b3f74003bb04e5b2e0b))
13
+
***schema-compiler:** fix DAP with query_rewrite and python config ([#9033](https://github.com/cube-js/cube/issues/9033)) ([849790f](https://github.com/cube-js/cube/commit/849790f965dd0d9fddba11e3d8d124b84397ca9b))
0 commit comments