left-join
Keep every row of x, adding the matching columns from y.
NoteExperimental
This function is experimental; its interface may change without notice.
Since 0.6.0.
Rows match on the by: key columns (a natural join on the common columns when by: none); key values compare by their string form, so a native 1 matches the string "1". Output columns are x’s columns, then y’s non-key columns. An x row with no match keeps none in the y columns; multiple y matches emit one output row each (x order then y match order). A non-key column present in both inputs is an error (no automatic suffixing).
Usage
left-join(
x,
y,
by: none,
)Parameters
| Parameter | Default | Description |
|---|---|---|
x |
Left dataset (row-store or column-store). | |
y |
Right dataset (row-store or column-store). | |
by |
none |
Key columns: none for the common columns, a name, or an array. |
Returns
A row-store array of x augmented with y’s columns.
Examples
Attach each customer’s city to their orders.
#let joined = left-join(orders, customers, by: "customer")