Primeur Online Docs
Data Shaper
Data Shaper
  • 🚀GETTING STARTED
    • What is Primeur Data Shaper
      • What is the Data Shaper Designer
      • What is the Data Shaper Server
      • What is the Data Shaper Cluster
    • How does the Data Shaper Designer work
      • Designer Views and Graphs
      • Data Shaper Graphs
      • Designer Projects and Sandboxes
      • Data Shaper Designer Reference
    • How do the Data Shaper Server and Cluster work
      • Data Shaper Server and Cluster
      • Data Shaper Server Reference
    • VFS Graph Components
      • DataOneFileDescriptor (DOFD) metadata
      • Passing parameters from Data One Contract to Data Shaper graph
      • Inheriting Data One context attributes in Data Shaper graph
  • DATA SHAPER DESIGNER
    • Configuration
      • Runtime configuration
        • Logging
        • Master Password
        • User Classpath
      • Data Shaper Server Integration
      • Execution monitoring
      • Java configuration
      • Engine configuration
      • Refresh Operation
    • Designer User Interface
      • Graph Editor with Palette of Components
      • Project Explorer Pane
      • Outline Pane
      • Tabs Pane
      • Execution Tab
      • Keyboard Shortcuts
    • Projects
      • Creating Data Shaper projects
      • Converting Data Shaper projects
      • Structure of Data Shaper projects
      • Versioning of server project content
      • Working with Data Shaper Server Projects
      • Project configuration
    • Graphs
      • Creating an empty graph
      • Creating a simple graph
        • Placing Components
        • Placing Components from Palette
        • Connecting Components with Edges
    • Execution
      • Successful Graph Execution
      • Run configuration
      • Connecting to a running job
      • Graph states
    • Common dialogs
      • URL file dialog
      • Edit Value dialog
      • Open Type dialog
    • Import
      • Import Data Shaper projects
      • Import from Data Shaper server sandbox
      • Import graphs
      • Import metadata
    • Export
      • Export graphs to HTML
      • Export to Data Shaper Server sandbox
      • Export image
      • Export Project as Library
    • Graph tracking
      • Changing record count font size
    • Search functionality
    • Working with Data Shaper server
      • Data Shaper server project basic principles
      • Connecting via HTTP
      • Connecting via HTTPS
      • Connecting via Proxy Server
    • Graph components
      • Adding components
      • Finding components
      • Edit component dialog box
      • Enable/disable component
      • Passing data through disabled component
      • Common properties of components
      • Specific attribute types
      • Metadata templates
    • Edges
      • Connecting Components with Edges
      • Types of Edges
      • Assigning Metadata to Edges
      • Colors of Edges
      • Debugging Edges
      • Edge Memory Allocation
    • Metadata
      • Records and Fields
        • Record Types
        • Data Types in Metadata
        • Data Formats
        • Locale and Locale Sensitivity
        • Time Zone
        • Autofilling Functions
      • Metadata Types
        • Internal Metadata
        • External (Shared) Metadata
        • SQL Query Metadata
        • Reading Metadata from Special Sources
      • Auto-propagated Metadata
        • Sources of Auto-Propagated Metadata
        • Explicitly Propagated Metadata
        • Priorities of Metadata
        • Propagation of SQL Query Metadata
      • Creating Metadata
        • Extracting Metadata from a Flat File
        • Extracting Metadata from an XLS(X) File
        • Extracting Metadata from a Database
        • Extracting Metadata from a DBase File
        • Extracting Metadata from Salesforce
        • SQL Query Metadata
        • User Defined Metadata
      • Merging Existing Metadata
      • Creating Database Table from Metadata and Database Connection
      • Metadata Editor
        • Opening Metadata Editor
        • Basics of Metadata Editor
        • Record Pane
        • Field Name vs. Label vs. Description
        • Details Pane
      • Changing and Defining Delimiters
      • Editing Metadata in the Source Code
      • Multi-value Fields
        • Lists and Maps Support in Components
        • Joining on multivalue fields (Comparison Rules)
    • Connections
      • Database Connections
        • Internal Database Connections
        • External (Shared) Database Connections
        • Database Connections Properties
        • Encryption of Access Password
        • Browsing Database and Extracting Metadata from Database Tables
        • Windows Authentication on Microsoft SQL Server
        • Snowflake Connection
        • Hive Connection
        • Troubleshooting
      • JMS Connections
      • QuickBase Connections
      • Hadoop Connections
      • Kafka Connections
      • OAuth2 Connections
      • MongoDB Connections
      • Salesforce Connections
    • Lookup Tables
      • Lookup Tables in Cluster Environment
      • Internal Lookup Tables
      • External (Shared) Lookup Tables
      • Types of Lookup Tables
    • Sequences
      • Persistent Sequences
      • Non Persistent Sequences
      • Internal Sequences
      • External (Shared) Sequences
      • Editing a Sequence
      • Sequences in Cluster Environment
    • Parameters
      • Internal Parameters
      • External (Shared) Parameters
      • Secure Graph Parameters
      • Graph Parameter Editor
      • Secure Graph Parameters
      • Parameters with CTL2 Expressions (Dynamic Parameters)
      • Environment Variables
      • Canonicalizing File Paths
      • Using Parameters
    • Internal/External Graph Elements
    • Dictionary
      • Creating a Dictionary
      • Using a Dictionary in Graphs
    • Execution Properties
    • Notes in Graphs
      • Placing Notes into Graph
      • Resizing Notes
      • Editing Notes
      • Formatted Text
      • Links from Notes
      • Folding Notes
      • Notes Properties
    • Transformations
      • Defining Transformations
      • Transform Editor
      • Common Java Interfaces
    • Data Partitioning (Parallel Running)
    • Data Partitioning in Cluster
      • High Availability
      • Scalability
      • Graph Allocation Examples
      • Example of Distributed Execution
      • Remote Edges
    • Readers
      • Common Properties of Readers
      • ComplexDataReader
      • DatabaseReader
      • DataGenerator
      • DataOneVFSReader
      • EDIFACTReader
      • FlatFileReader
      • JSONExtract
      • JSONReader
      • LDAPReader
      • MultiLevelReader
      • SpreadsheetDataReader
      • UniversalDataReader
      • X12Reader
      • XMLExtract
      • XMLReader
      • XMLXPathReader
    • Writers
      • Common Properties of Writers
      • DatabaseWriter
      • DataOneVFSWriter
      • EDIFACTWriter
      • FlatFileWriter
      • JSONWriter
      • LDAPWriter
      • SpreadsheetDataWriter
      • HIDDEN StructuredDataWriter
      • HIDDEN TableauWriter
      • Trash
      • UniversalDataWriter
      • X12Writer
      • XMLWriter
    • Transformers
      • Common Properties of Transformers
      • Aggregate
      • Concatenate
      • DataIntersection
      • DataSampler
      • Dedup
      • Denormalizer
      • ExtSort
      • FastSort
      • Filter
      • Map
      • Merge
      • MetaPivot
      • Normalizer
      • Partition
      • Pivot
      • Rollup
      • SimpleCopy
      • SimpleGather
      • SortWithinGroups
      • XSLTransformer
    • Joiners
      • Common Properties of Joiners
      • Combine
      • CrossJoin
      • DBJoin
      • ExtHashJoin
      • ExtMergeJoin
      • LookupJoin
      • RelationalJoin
    • Others
      • Common Properties of Others
      • CheckForeignKey
      • DBExecute
      • HTTPConnector
      • LookupTableReaderWriter
      • WebServiceClient
    • CTL2 - Data Shaper Transformation Language
    • Language Reference
      • Program Structure
      • Comments
      • Import
      • Data Types in CTL2
      • Literals
      • Variables
      • Dictionary in CTL2
      • Operators
      • Simple Statement and Block of Statements
      • Control Statements
      • Error Handling
      • Functions
      • Conditional Fail Expression
      • Accessing Data Records and Fields
      • Mapping
      • Parameters
      • Regular Expressions
    • CTL Debugging
      • Debug Perspective
      • Importing and Exporting Breakpoints
      • Inspecting Variables and Expressions
      • Examples
    • Functions Reference
      • Conversion Functions
      • Date Functions
      • Mathematical Functions
      • String Functions
      • Mapping Functions
      • Container Functions
      • Record Functions (Dynamic Field Access)
      • Miscellaneous Functions
      • Lookup Table Functions
      • Sequence Functions
      • Data Service HTTP Library Functions
      • Custom CTL Functions
      • CTL2 Appendix - List of National-specific Characters
      • HIDDEN Subgraph Functions
    • Tutorial
      • Creating a Transformation Graph
      • Filtering the records
      • Sorting the Records
      • Processing Speed-up with Parallelization
      • Debugging the Java Transformation
  • DATA SHAPER SERVER
    • Introduction
    • Administration
      • Monitoring
    • Using Graphs
      • Job Queue
      • Execution History
      • Job Inspector
    • Cluster
      • Sandboxes in Cluster
      • Troubleshooting
  • Install Data Shaper
    • Install Data Shaper
      • Introduction to Data Shaper installation process
      • Planning Data Shaper installation
      • Data Shaper System Requirements
      • Data Shaper Domain Master Configuration reference
      • Performing Data Shaper initial installation and master configuration
        • Creating database objects for PostgreSQL
        • Creating database objects for Oracle
        • Executing Data Shaper installer
        • Configuring additional firewall rules for Data Shaper
Powered by GitBook
On this page
  • Short Description
  • Ports
  • Metadata
  • ExtMergeJoin Attributes
  • Details
  • Best Practices
  • See also
  1. DATA SHAPER DESIGNER
  2. Joiners

ExtMergeJoin

Short Description

General purpose joiner that merges sorted data from two or more data sources on a common key.

COMPONENT
SAME INPUT METADATA
SORTED INPUTS
SLAVE INPUTS
OUTPUTS
OUTPUT FOR DRIVER WITHOUT SLAVE
OUTPUT FOR SLAVES WITHOUT DRIVER
JOINING BASED ON EQUALITY
AUTO-PROPAGATED METADATA

ExtMergeJoin

x

✓

1-n

1-2

x

x

✓

✓

Note: If you want to join different slaves with the master on a key with various key fields, use ExtHashJoin instead. But remember that slave data sources have to be sufficiently small.

Ports

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

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

PORT TYPE
NUMBER
REQUIRED
DESCRIPTION
METADATA

Input

0

✓

Master input port

Any

1

✓

Slave input port

Any

2-n

x

Optional slave input ports

Any

Output

0

✓

Output port for the joined data

Any

1

x

Output port for the unjoined data

Input 0

Metadata

ExtMergeJoin propagates metadata from the first input port to the second output port and from the second output port to the first input port.

ExtMergeJoin has no metadata templates.

Metadata on the first input and the second output must be the same. (Metadata fields must have the same types, metadata field names may differ.)

ExtMergeJoin Attributes

ATTRIBUTE
REQ
DESCRIPTION
POSSIBLE VALUES

BASIC

Join key

yes

A key according to which incoming data flows are joined. See Join Key below.

Join type

Type of the join. See Join Types below.

Inner (default) | Left outer | Full outer

Transform

[bl

A transformation in CTL or Java defined in a graph.

Transform URL

[bl

An external file defining the transformation in CTL or Java.

Transform class

[bl

External transformation class.

Transform source charset

Encoding of an external file defining the transformation. The default encoding depends on DEFAULT_SOURCE_CODE_CHARSET in defaultProperties.

E.g. UTF-8

ADVANCED

Allow slave duplicates

If set to true, records with duplicate key values are allowed. If it is false, only the last record is used for join.

true (default) | false

DEPRECATED

Locale

Locale to be used when internationalization is used.

Case sensitive

If set to true, upper and lower cases of characters are considered different. By default, they are processed as if they were equal to each other.

false (default) | true

Error actions

A definition of the action that should be performed when the specified transformation returns an Error code. See Return Values of Transformations.

Error log

An URL of the file to which error messages for specified Error actions should be written. If not set, they are written to Console.

Ascending ordering of inputs

If set to true, incoming records are supposed to be sorted in ascending order. If it is set to false, they are descending.

true (default) | false

Left outer

If set to true, left outer join is performed. By default, the attribute is set to false. However, this attribute has a 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, the attribute is set to false. However, this attribute has a lower priority than Join type. If you set both, only Join type will be applied.

false (default) | true

Details

ExtMergeJoin is a general purpose joiner used in most common situations. It requires the input be sorted and is very fast as there is no caching (unlike ExtHashJoin).

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. For a closer look on how data is merged, see Data Merging below.

You must define the Join key. Records on the input ports must be sorted according to the corresponding parts of the Join key attribute. You can define Join key in the Join key dialog.

In it, you can see the tab for the driver (the Master key tab) and the tabs for all of the slave input ports (the Slave key tabs).

Master Key Tab

In the driver tab, there are two panes. The Fields pane on the left and the Master key pane on the right.

You need to select the driver expression by selecting the fields in the Fields pane on the left and moving them to the Master key pane on the right with the help of the Right arrow button.

To the selected Master key fields, the same number of fields should be mapped within each slave. Thus, the number of key fields is the same for all input ports (both the master and each slave). In addition, the driver (Master) key must be common for all slaves.

Slave Key Tab

In each of the slave tab(s), there are two panes: Fields and Key mapping. The Fields pane is on the left. There you can see the list of the slave field names and their data types. The Key mapping pane is on the right. In the right pane you can see two columns: Master key field and Slave key field. The left column contains the selected field names of the driver input port.

If you want to map some driver field to some slave field, select the slave field in the left pane by clicking its item. Then push the left mouse button, drag the field to the Slave key field column in the right pane and release the button. The same must be done for each slave. Note that you can also use the Auto mapping button or other buttons in each tab.

Example 44. Join Key for ExtMergeJoin

$first_name;$last_name#$fname;$lname#$f_name;$l_name

Following is the part of Join key for the master data source (input port 0): $first_name;$last_name

  • Thus, these fields are joined with the two fields from the first slave data source (input port 1): $fname and $lname, respectively.

  • And, these fields are also joined with the two fields from the second slave data source (input port 2): $f_name and $l_name, respectively.

Data Merging Joining data in ExtMergeJoin works the following way. First of all, let us stress again that data on both the master and the slave have to be sorted.

The component takes the first record from the master and compares it to the first one from the slave (with respect to Join key). There are three possible comparison results:

  • master equals slave - records are joined

  • "slave.key < master.key" - the component looks onto the next slave record, i.e. a one-step shift is performed trying to get a matching slave to the current master

  • slave.key > master.key - the component looks onto the next master record, i.e. a regular one-step shift is performed on the master

Some input data contain sequences of same values. Then they are treated as one unit on the slave (a slave record knows the value of the following record), This happens only if Allow slave duplicates has been set to true. Moreover, the same-values unit gets stored in the memory. On the master, merging goes all the same by comparing one master record after another to the slave.

Note: In case there is a large number of duplicate values on the slave, they are stored on your disk.

Transformation A transformation in ExtMergeJoin is required. Use one of the Transform, Transform URL and Transform class attributes to specify the transformation.

A transformation in ExtMergeJoin lets you define the transformation that sends records to the first output port. The unjoined master records sent to the second output cannot be modified within the ExtMergeJoin transformation.

Best Practices

If the transformation is specified in an external file (with Transform URL), we recommend users to explicitly specify Transform source charset.

See also

PreviousExtHashJoinNextLookupJoin

Last updated 1 month ago

[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 RecordTransforminterface. For more information, see CTL Scripting Specifics or Java Interfaces below. For detailed information about transformations, see also .

Join Key Join Key defines a key that is used to join the records. The Join key attribute is a sequence of individual key expressions for the master and all of the slaves. The parts corresponding to particular input ports are separated from each other by hash. The order of these expressions must correspond to the order of the input ports starting with the master and continuing with the slaves. Driver (master) key is a sequence of driver (master) field names (each of them should be preceded by a dollar sign) separated by a colon, semicolon or pipe. Each slave key is a sequence of slave field names (each of them should be preceded by a dollar sign) separated by a colon, semicolon or pipe; e.g.: $field1(a);$field2(d)#$hello(a);$olleh(d) The Join key string in the example above contains sorting characters (a) (ascending) and (d) (descending). For more details on sorting, see .

CTL Scripting Specifics All Joiners share the same transformation template which can be found in . For detailed information about Data Shaper Transformation Language, see .

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

Defining Transformations
Common Properties of Components
Specific Attribute Types
Common Properties of Joiners
CTL2 - Data Shaper Transformation Language
Sort Key
CTL Templates for Joiners
Java Interfaces for Joiners