Skip to content

Commit f7772be

Browse files
committed
re-write
1 parent ab27669 commit f7772be

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/unify/data-graph/index.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,25 @@ For many:many relationships, define the join on between the two entity tables wi
354354

355355
**Junction table spec**
356356

357-
> info ""
358-
> When used in junctions tables, `left join` is the column on the junction table to link with the parent (left) entity, and `right join` is the column on the junction table to join with the child (right) entity. These values don’t manipulate the type of join - they are always `INNER JOINS`.
359-
360-
361357
| Parameters |Definition |
362358
| --------------- | --------------------------------- |
363359
| `table_ref` | Defines the fully qualified table reference to the join table: `[database name].[schema name].[table name]`. Segment flexibly supports tables, views and materialized views |
364360
| `primary_key` | The unique identifier for the given table. Must be a column with unique values per row |
365361
| `left_join_on` | Define the relationship between the left entity table and the junction table: `[left entity slug].[column name] = [junction table column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again |
366362
| `right_join_on` | Define the relationship between the junction table and the right entity table: `[junction table column name] = [right entity slug].[column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again |
367363

364+
365+
When you define a many-to-many relationship using a junction table, `left_join_on` and `right_join_on` tell Data Graph how to connect each entity to the junction table:
366+
367+
* Use `left_join_on` to specify which column in the junction table links to the parent (left) entity.
368+
369+
* Use `right_join_on` to specify which column links to the child (right) entity.
370+
371+
These fields define the join conditions, but they don’t control how the join is executed. Data Graph always performs inner joins, even if you specify a `left_join_on`.
372+
373+
If you need behavior similar to a left join (like including unmatched rows), create a view in your warehouse with the logic you’re targeting and reference that view as an entity in your graph.
374+
375+
368376
**Example:**
369377

370378
```python

0 commit comments

Comments
 (0)