Skip to content

Commit

Permalink
Mention anti join in the Join Tutorial (#5345)
Browse files Browse the repository at this point in the history
  • Loading branch information
philrz authored Oct 21, 2024
1 parent ead81c9 commit ff6c9e0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/tutorials/join.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,32 @@ produces
{name:"chris",age:47,likes:"tart",fruit:"apple"}
```

## Anti join

:::tip note
In some databases an anti join is called a _left anti join_.
:::

The join type `anti` allows us to see which fruits are not liked by anyone.
Note that with anti join only values from the left-hand input appear in the
results.

The Zed script `anti-join.zed`:
```mdtest-input anti-join.zed
file fruit.ndjson
| anti join (
file people.ndjson
) on flavor=likes
```
Executing the Zed script:
```mdtest-command
zq -z -I anti-join.zed
```
produces
```mdtest-output
{name:"avocado",color:"green",flavor:"savory"}
```

## Inputs from Pools

In the examples above, we used the
Expand Down

0 comments on commit ff6c9e0

Please sign in to comment.