# Merge Join

## ![](/files/yAh7mkWeDXmpSgIcHx2A) Merge Join

### Description <a href="#description" id="description"></a>

The Merge Join transform performs a classic merge join between data sets with data coming from two different input transforms.

This transform assumes your data is sorted on the join keys. Use [Sort Rows](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/sort.md) transforms on the incoming streams to enforce sorting if necessary.

Join options include INNER, LEFT OUTER, RIGHT OUTER, and FULL OUTER.

| Hop Engine | <sup>✓</sup> |
| ---------- | ------------ |
| Spark      | <sup>✓</sup> |
| Flink      | <sup>✓</sup> |
| Dataflow   | <sup>✓</sup> |

### Options

| Option           | Description                                                                                                   |
| ---------------- | ------------------------------------------------------------------------------------------------------------- |
| First Transform  | The first transform to read data from (left hand side of the join)                                            |
| Second Transform | The second transform to read data from (right hand side of the join)                                          |
| Join type        | The join type that should be used; INNER, LEFT OUTER, RIGHT OUTER, and FULL OUTER                             |
| Key Field        | The fields used for the join key, this only supports equal joins (key first transform = key second transform) |

For guidance on preventing deadlocks when using the Merge Join transform, refer to this how-to guide: [Avoiding deadlocks](/data-shaper-1.21/knowing-the-data-shaper-designer/index-5/avoiding-deadlocks.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/mergejoin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
