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
  • Join Types
  • Slave Duplicates
  • CTL Templates for Joiners
  • Java Interfaces for Joiners
  1. DATA SHAPER DESIGNER
  2. Joiners

Common Properties of Joiners

PreviousJoinersNextCombine

Last updated 1 month ago

Joiners serve to put together records with potentially different metadata according to the specified key and the specified transformation.

Joiners have both input and output ports. The first input port is called master (driver), the other(s) are called slave(s).

Joiners join records from a master port with particular records from an error port. Joiners do not join records between slave ports.

They can join records incoming through at least two input ports (, and ). The others can also join records incoming through a single input port with those from a lookup table () or database table (). In them, their slave data records are considered to be incoming through a virtual second input port.

Sorted or Unsorted Records Two of these Joiners require that incoming records are sorted: and .

Matching on Equality and Non-equality Generally, joiners match on equality: all join key fields from a master must match the corresponding fields from a slave.

joins data records based on the non-equality conditions.

Output Port for Unmatched Records , , and have optional output ports for unmatched master data records, as well.

Metadata Joiners propagate metadata between a master input port and output port for unmatched records. Joiners do not propagate metadata in any other direction. Joiners have no metadata templates.

You must assign metadata on input edges to be able to specify the transformation. The metadata on an output edge can be created and edited in a transformation editor.

Transformation These components use transformations that are described in the section concerning transformers. For detailed information about how transformation should be defined, see . All transformations in Joiners use a common transformation template (CTL Templates for Joiners below) and common Java interface (Java Interfaces for Joiners below).

Here is an overview of all Joiners:

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

x

x

1-n

1-n

x

x

x

1

1

x

x

x

✓

x

x

1 (virtual)

1-2

✓

x

✓

✓

x

x

1-n

1

x

x

✓

✓

x

✓

1-n

1

x

x

✓

✓

x

x

1 (virtual)

1-2

✓

x

✓

✓

x

✓

1

1

x

x

x

x

Join Types

Joiners can work under the following three processing modes:

  • Inner Join In this processing mode, only master records in which values of Join key fields are equal to values of their slave counterparts are processed and sent out through the output port for joined records. Unmatched master records can be sent out through the optional output port for master records without a slave (in ExtHashJoin, ExtMergeJoin, LookupJoin or DBJoin only).

  • Left Outer Join In this processing mode, all master records are joined and forwarded to the output. Master records with no corresponding item in a lookup table have null values in fields containing data from the lookup table.

  • Full Outer Join In this processing mode, all master and slave records are processed and sent out through the output port for joined records, regardless of whether the values of Join key fields are equal to the values of their slave counterparts or not.

Warning! Full outer join mode is not allowed in LookupJoin and DBJoin.

Note: Null Values Joiners parse each pair of records (master and slave) in which the same fields of the Join key attribute have null values as if these nulls were different. Thus, these records do not match one another in such fields and are not joined.

Slave Duplicates

In Joiners, sometimes more slave records have the same values of corresponding fields of Join key. These slaves are called duplicates. If such duplicate slave records are allowed, all of them are parsed and joined with a master record if they match any. If the duplicates are not allowed, only one of them or at least some of them is/are parsed (if they match any master record) and the others are discarded.

Different Joiners allow to process slave duplicates in a different way. Here is a brief overview of how these duplicates are parsed and what can be set in these components or other tools:

  • The Allow slave duplicates attribute is included in the following Joiners (It can be set to true or false):

    • ExtHashJoin The default value is false. Only the first record is processed, the others are discarded.

    • ExtMergeJoin The default value is true. If switched to false, only the last record is processed, the rest is discarded.

    • RelationalJoin The default value is false. Only the first record is processed, the rest is discarded.

  • The SQL query attribute is included in DBJoin. SQL query allows to specify the exact number of slave duplicates explicitly.

  • LookupJoin parses slave duplicates according to the setting of used lookup table in the following way:

    • Simple lookup table also has the Allow key duplicate attribute. Its default value is true. If you uncheck the checkbox, only the last record is processed, the others are discarded.

    • DB lookup table allows to specify the exact number of slave duplicates explicitly.

    • Range lookup table does not allow slave duplicates. Only the first slave record is used, the rest is discarded.

    • Persistent lookup table can work in two modes: with and without slave duplicates. See Range Lookup Table.

    • Aspell lookup table allows that all slave duplicates are used. No limitation of the number of duplicates is possible.

CTL Templates for Joiners

Here is an example of how the Source tab for defining the transformation in CTL looks.

CTL TEMPLATE FUNCTIONS
boolean init()

Required

No

Description

Initializes the component, setup the environment and global variables

Invocation

Called before processing the first record

Returns

true | false (if false, the graph fails)

CTL TEMPLATE FUNCTIONS
integer transform()

Required

Yes

Input parameters

None

Returns

Integer numbers. For detailed information, see Return Values of Transformations.

Invocation

Called repeatedly for each set of joined or intersected input records (Joiners and DataIntersection) and for each input record (Map).

Description

Allows you to map input fields to the output fields using a script. If any part of the transform() function for some output record causes fail of the transform() function, and if the user has defined another function (transformOnError()), processing continues in this transformOnError() at the place where transform() failed. If transform() fails and the user has not defined any transformOnError(), the whole graph will fail. The transformOnError() function gets the information gathered by transform() that was gotten from previously successfully processed code. Also an error message and stack trace are passed to transformOnError().

Example

See here below

function integer transform() {
   $out.0.name = $in.0.name;
   $out.0.address = $in.0.city + $in.0.street + $in.0.zip;
   $out.0.country = toUpper($in.0.country);
   return ALL;
}
CTL TEMPLATE FUNCTIONS
integer transformOnError(string errorMessage, string stackTrace, integer idx)

Required

No

Input parameters

string errorMessage string stackTrace

Returns

Integer numbers. For detailed information, see Return Values of Transformations.

Invocation

Called if transform() throws an exception.

Description

It creates output records. If any part of the transform() function for some output record causes fail of the function, and if the user has defined another function (transformOnError()), processing continues in this transformOnError() at the place where transform() failed. If transform() fails and the user has not defined any transformOnError(), the whole graph will fail. The transformOnError() function gets the information gathered by transform() that was gotten from previously successfully processed code. Also an error message and stack trace are passed to transformOnError().

Example

See here below

function integer transformOnError(
                       string errorMessage,
                       string stackTrace) {
   $in.0.name = $in.0.name;
   $in.0.address = $in.0.city + $in.0.street + $in.0.zip;
   $in.0.country = "country was empty";
   printErr(stackTrace);
   return ALL;
}
CTL TEMPLATE FUNCTIONS
string getMessage()

Required

No

Description

Prints an error message specified and invoked by user.

Invocation

Called in any time specified by the user (called only when transform() returns value less than or equal to -2).

Returns

string

CTL TEMPLATE FUNCTIONS
void preExecute()

Required

No

Input parameters

None

Returns

void

Description

May be used to allocate and initialize resources required by the transformation. All resources allocated within this function should be released by the postExecute() function.

Invocation

Called during each graph run before the transform is executed.

CTL TEMPLATE FUNCTIONS
void postExecute()

Required

No

Input parameters

None

Returns

void

Description

Should be used to free up any resources allocated within the preExecute() function.

Invocation

Called during each graph run after the entire transform was executed.

  • Input records or fields and output records or fields Both inputs and outputs are accessible within the transform() and transformOnError() functions only.

    • All of the other CTL template functions allow to access neither inputs nor outputs.

Warning! Remember that if you do not hold these rules, NPE will be thrown.

Java Interfaces for Joiners

This is used in every Joiner, Map and DataIntersection.

Following are the methods of the RecordTransform interface:

  • boolean init(Properties parameters, DataRecordMetadata[] sourcesMetadata, DataRecordMetadata[] targetMetadata) Initializes a transformation class/function. This method is called only once at the beginning of transformation process. Any object allocation/initialization should happen here.

  • int transform(DataRecord[] sources, DataRecord[] target) Performs transformation of source records to target records. This method is called as one step in transforming flow of records. For detailed information about return values and their meaning, see Return Values of Transformations.

  • int transformOnError(Exception exception, DataRecord[] sources, DataRecord[] target) Performs transformation of source records to target records. This method is called as one step in transforming flow of records. For detailed information about return values and their meaning, see Return Values of Transformations. Called only if transform(DataRecord[], DataRecord[]) throws an exception.

  • void signal(Object signalObject) A method which can be used for signalling into transformation that something outside happened. (For example in aggregation component key changed.)

  • Object getSemiResult() A method which can be used for getting intermediate results out of a transformation. May or may not be implemented.

This transformation template is used in every Joiner and also in and .

The transformation implements methods of the RecordTransform interface and inherits other common methods from the Transform interface. See .

ExtHashJoin
ExtMergeJoin
RelationalJoin
LookupJoin
DBJoin
ExtMergeJoin
RelationalJoin
RelationalJoin
DBJoin
ExtHashJoin
ExtMergeJoin
LookupJoin
Defining Transformations
Map
DataIntersection
Common Java Interfaces
Combine
CrossJoin
DBJoin
ExtHashJoin
ExtMergeJoin
LookupJoin
RelationalJoin