# Semi join
> Supported in: Batch, Faster
Semi joins left and right dataset inputs together. This removes all rows that don't match the join condition.
**Transform categories**: Join
## Declared arguments
* **Condition for columns to select on the left:** All columns in the left input schema will be tested to see if they match this condition. If they match, the column will be selected in the output.
*ColumnPredicate*
* **Join condition:** Condition on which to join.
*Expression\*
* **Left dataset:** Left dataset to use in join.
*Table*
* **Right dataset:** Right dataset to use in join.
*Table*
## Examples
### Example 1: Base case
**Argument values:**
* **Condition for columns to select on the left:**
columnNameIsIn(
columnNames: \[tail\_number, airline],
)
* **Join condition:**
equals(
left: `tail_number`,
right: `tail_number`,
)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
**Inputs:**
ri.foundry.main.dataset.left
| tail\_number | airline | miles | factor |
| ----- | ----- | ----- | ----- |
| XB-123 | foundry air | 124 | 2 |
| MT-222 | new airline | 1123 | 5 |
| XB-123 | foundry airline | 335 | 5 |
| MT-222 | new air | 565 | 4 |
| KK-452 | new air | 222 | 1 |
| PA-452 | new air | 212 | 2 |
| XB-123 | foundry airline | 1134 | 2 |
ri.foundry.main.dataset.right
| tail\_number | home\_airport |
| ----- | ----- |
| XB-123 | LHR |
| MT-222 | CPH |
| KK-452 | JFK |
| JR-201 | IAD |
**Output:**
| tail\_number | airline |
| ----- | ----- |
| XB-123 | foundry air |
| MT-222 | new airline |
| XB-123 | foundry airline |
| MT-222 | new air |
| KK-452 | new air |
| XB-123 | foundry airline |
***
### Example 2: Base case
**Description:** Simple complex join condition.
**Argument values:**
* **Condition for columns to select on the left:**
columnNameIsIn(
columnNames: \[tail\_number, airline, factor],
)
* **Join condition:**
and(
conditions: \[
lessThan(
left: `factor`,
right: `factor`,
),
equals(
left: `tail_number`,
right: `tail_number`,
)],
)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
**Inputs:**
ri.foundry.main.dataset.left
| tail\_number | airline | miles | factor |
| ----- | ----- | ----- | ----- |
| XB-123 | foundry air | 124 | 2 |
| MT-222 | new airline | 1123 | 5 |
| XB-123 | foundry airline | 335 | 5 |
| MT-222 | new air | 565 | 4 |
| KK-452 | new air | 222 | 1 |
| PA-452 | new air | 212 | 2 |
| XB-123 | foundry airline | 1134 | 2 |
ri.foundry.main.dataset.right
| tail\_number | home\_airport | factor |
| ----- | ----- | ----- |
| XB-123 | LHR | 2 |
| MT-222 | CPH | 1 |
| KK-452 | JFK | 10 |
| JR-201 | IAD | 4 |
**Output:**
| tail\_number | airline | factor |
| ----- | ----- | ----- |
| KK-452 | new air | 1 |
***
### Example 3: Base case
**Argument values:**
* **Condition for columns to select on the left:**
columnNameIsIn(
columnNames: \[tail\_number, airline, factor],
)
* **Join condition:**
and(
conditions: \[
equals(
left: `tail_number`,
right: `tail_number`,
),
equals(
left: `factor`,
right: `factor`,
)],
)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
**Inputs:**
ri.foundry.main.dataset.left
| tail\_number | airline | miles | factor |
| ----- | ----- | ----- | ----- |
| XB-123 | foundry air | 124 | 2 |
| MT-222 | new airline | 1123 | 5 |
| XB-123 | foundry airline | 335 | 5 |
| MT-222 | new air | 565 | 4 |
| KK-452 | new air | 222 | 1 |
| PA-452 | new air | 212 | 2 |
| XB-123 | foundry airline | 1134 | 2 |
ri.foundry.main.dataset.right
| tail\_number | home\_airport | factor |
| ----- | ----- | ----- |
| XB-123 | LHR | 2 |
| MT-222 | CPH | 1 |
| KK-452 | JFK | 10 |
| JR-201 | IAD | 4 |
**Output:**
| tail\_number | airline | factor |
| ----- | ----- | ----- |
| XB-123 | foundry air | 2 |
| XB-123 | foundry airline | 2 |
***
### Example 4: Base case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Join condition:**
equals(
left: `tail_number`,
right: `tail_number`,
)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
**Inputs:**
ri.foundry.main.dataset.left
| tail\_number | airline | miles | factor |
| ----- | ----- | ----- | ----- |
| XB-123 | foundry air | 124 | 2 |
| MT-222 | new airline | 1123 | 5 |
| XB-123 | foundry airline | 335 | 5 |
| MT-222 | new air | 565 | 4 |
| KK-452 | new air | 222 | 1 |
| PA-452 | new air | 212 | 2 |
| XB-123 | foundry airline | 1134 | 2 |
ri.foundry.main.dataset.right
| tail\_number | home\_airport |
| ----- | ----- |
| XB-123 | LHR |
| MT-222 | CPH |
| KK-452 | JFK |
| JR-201 | IAD |
**Output:**
| tail\_number | airline | miles | factor |
| ----- | ----- | ----- | ----- |
| XB-123 | foundry air | 124 | 2 |
| MT-222 | new airline | 1123 | 5 |
| XB-123 | foundry airline | 335 | 5 |
| MT-222 | new air | 565 | 4 |
| KK-452 | new air | 222 | 1 |
| XB-123 | foundry airline | 1134 | 2 |
***