ExtHashJoin

We assume that you have already learned what is described in:

If you want to find the right Joiner for your purposes, see Joiners Comparison.

Short Summary

General purpose joiner, merges potentionally unsorted data from two or more data sources on a common key.

Component Same input metadata Sorted inputs Slave inputs Outputs Output for drivers without slave Output for slaves without driver Joining based on equality
ExtHashJoinnono1-n1nonoyes

Abstract

This is a general purpose joiner used in most common situations. It does not require the input be sorted and is very fast as it is processed in memory.

The data attached to the first input port is called the master (as usual in other Joiners). All remaining connected input ports are called slaves. Each master record is matched to all slave records on one or more fields known as the join key. The output is produced by applying a transformation that maps joined inputs to the output. For details, see Joining Mechanics.

This joiner should be avoided in case of large inputs on the slave port. The reason is slave data is cached in the memory.

[Tip]Tip

If you have larger data, consider using the ExtMergeJoin component. If your data sources are unsorted, use a sorting component first (ExtSort, FastSort, or SortWithinGroups).

Icon

Ports

ExtHashJoin receives data through two or more input ports, each of which may have a different metadata structure.

The joined data is then sent to the single output port.

Port typeNumberRequiredDescriptionMetadata
Input0yesMaster input portAny
1yesSlave input portAny
2-nnoOptional slave input portsAny
Output0yesOutput port for the joined dataAny

ExtHashJoin Attributes

AttributeReqDescriptionPossible values
Basic
Join keyyesKey according to which the incoming data flows are joined. See Join key. 
Join type Type of the join. See Join Types.Inner (default) | Left outer | Full outer
Transform1)Transformation in CTL or Java defined in the graph. 
Transform URL1)External file defining the transformation in CTL or Java. 
Transform class1)External transformation class. 
Allow slave duplicates If set to true, records with duplicate key values are allowed. If it is false, only the first record is used for join.false (default) | true
Advanced
Transform source charset Encoding of external file defining the transformation.ISO-8859-1 (default)
Hash table size Initial size of hash table that should be used when joining data flows. If there are more records that should be joined, hash table can be rehashed, however, it slows down the parsing process. See Hash Tables for more information:512 (default)
Deprecated
Error actions Definition of the action that should be performed when the specified transformation returns some Error code. See Return Values of Transformations. 
Error log URL of the file to which error messages for specified Error actions should be written. If not set, they are written to Console. 
Left outer If set to true, left outer join is performed. By default it is false. However, this attribute has lower priority than Join type. If you set both, only Join type will be applied.false (default) | true
Full outer If set to true, full outer join is performed. By default it is false. However, this attribute has lower priority than Join type. If you set both, only Join type will be applied.false (default) | true

Legend:

1) One of these must be set. These transformation attributes must be specified. Any of these transformation attributes must use a common CTL template for Joiners or implement a RecordTransform interface.

See CTL Scripting Specifics or Java Interfaces for more information.

See also Defining Transformations for detailed information about transformations.

Advanced Description

Joining Mechanics

All slave input data is stored in the memory. However, the master data is not. As for memory requirements, you therefore need to consider only the size of your slave data. In consequence, be sure to always set the larger data to the master and smaller inputs as slaves. ExtHashJoin uses in-memory hash tables for storing slave records.

[Important]Important

Remember each slave port can be joined with the master using different numbers of various master fields.

CTL Scripting Specifics

When you define your join attributes you must specify a transformation that maps fields from input data sources to the output. This can be done using the Transformations tab of the Transform Editor. However, you may find that you are unable to specify more advanced transformations using this easist approach. This is when you need to use CTL scripting.

For detailed information about CloudConnect Transformation Language see Part XI, CTL - CloudConnect Transformation Language. (CTL is a full-fledged, yet simple language that allows you to perform almost any imaginable transformation.)

CTL scripting allows you to specify custom field mapping using the simple CTL scripting language.

All Joiners share the same transformation template which can be found in CTL Templates for Joiners.

Java Interfaces

If you define your transformation in Java, it must implement the following interface that is common for all Joiners:

Java Interfaces for Joiners