# MERGE\_JOIN does not work with different mappings in joinKey?

**URL:** <https://forum.cloverdx.com/t/merge-join-does-not-work-with-different-mappings-in-joinkey/301>\
**Category:** CloverDX Platform\
**Created:** [April 4, 2008, 12:00am UTC](https://forum.cloverdx.com/t/merge-join-does-not-work-with-different-mappings-in-joinkey/301 "2008-04-04T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![achan](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@achan](https://forum.cloverdx.com/u/achan)\
**Post date:** [April 4, 2008, 12:00am UTC](https://forum.cloverdx.com/t/merge-join-does-not-work-with-different-mappings-in-joinkey/301/1 "2008-04-04T00:00:00Z")

</div>

Hi,

I encountered a problem when trying to join 3 files. File 1 is join to File 2 with key “REFERENCE”, and File 1 is join to File 3 with key “NAME”. The error from CloverETL is:

Graph definition file: palmer.grf  
ERROR [main] - Can’t create object of type EXT\_MERGE\_JOIN with reason: MERGE\_JOIN:JOIN:Driver keys differ  
Exception in thread “main” java.lang.RuntimeException: Can’t create object of type EXT\_MERGE\_JOIN with reason: MERGE\_JOIN:JOIN:Driver keys differ  
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:132)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:446)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:409)  
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:317)  
at org.jetel.graph.runtime.GraphExecutor.loadGraph(GraphExecutor.java:213)  
at org.jetel.graph.runtime.GraphExecutor.loadGraph(GraphExecutor.java:227)  
at org.jetel.main.runGraph.main(runGraph.java:268)

here is my graph file:

\<?xml version="1.0" encoding="UTF-8"?\> 

so does that mean that we cannot join files using different keys? or is my joinKey=“REFERENCE=REFERENCE#NAME=NAME” not correct? isn’t the first mapping “REFERENCE=REFERENCE” meant for File 1 to File 2, and second mapping “NAME=NAME” meant for File 1 to File 3?

Any suggestions/help is greatly appreciated 🙂

al

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [April 7, 2008, 7:09am UTC](https://forum.cloverdx.com/t/merge-join-does-not-work-with-different-mappings-in-joinkey/301/2 "2008-04-07T07:09:02Z")

</div>

Hi,  
it impossible to join files using different keys. Merge Join joins driver records with slaves due to key field(s) value, so the driver key has to be the same for all slaves. Moreover records have to be sorted due to this key.

---

<div class="post-metadata">

**Author:** ![achan](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@achan](https://forum.cloverdx.com/u/achan)\
**Post date:** [April 7, 2008, 3:59pm UTC](https://forum.cloverdx.com/t/merge-join-does-not-work-with-different-mappings-in-joinkey/301/3 "2008-04-07T15:59:32Z")

</div>

actually, that makes sense… the driver key has to be the same, but the slaves’ keys can be different… thanks for clarifying my thoughts 🙂
