Skip to content

Commit

Permalink
move bullets adn consolidate
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 committed Dec 24, 2024
1 parent 1c41464 commit 13a1be3
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions website/docs/docs/build/join-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ MetricFlow automatically generates the necessary joins to the defined semantic o
This section explains the different types of joins that can be used with entities and how to query them.
:::

- MetricFlow primarily uses left joins for joins.
- For queries that involve multiple `fct` models, MetricFlow uses full outer joins.
- It restricts the use of fan-out and chasm joins.
Metricflow uses these specific join strategies:

- Primarily uses left joins when joining `fct` and `dim` models. Left joins make sure all rows from the "base" table are retained, while matching rows are included from the joined table.
- For queries that involve multiple `fct` models, MetricFlow uses full outer joins to ensure all data points are captured, even when some `dim` or `fct` models are missing in certain tables.
- MetricFlow restricts the use of fan-out and chasm joins.

Refer to [SQL examples](#sql-examples) for more information on how MetricFlow handles joins in practice.

The following table identifies which joins are allowed based on specific entity types to prevent the creation of risky joins. This table primarily represents left joins unless otherwise specified. For scenarios involving multiple `fct` models, MetricFlow uses full outer joins.

Expand All @@ -41,14 +45,6 @@ The following table identifies which joins are allowed based on specific entity
| Foreign | Unique | ✅ Left |
| Foreign | Foreign | ❌ Fan-out (Not allowed) |


### Explanation of joins

- **Left joins** — MetricFlow defaults to left joins when joining `fct` and `dim` models. Left joins make sure all rows from the "base" table are retained, while matching rows are included from the joined table.
- **Full outer joins** — For queries that involve multiple `fct` models, MetricFlow uses full outer joins to ensure all data points are captured, even when some `dim` or `fct` models are missing in certain tables.

Refer to [SQL examples](#sql-examples) for more information on how MetricFlow handles joins in practice.

### Semantic validation

MetricFlow performs semantic validation by executing `explain` queries in the data platform to ensure that the generated SQL gets executed without errors. This validation includes:
Expand Down

0 comments on commit 13a1be3

Please sign in to comment.