In-Memory Lookup
Overview
This Snap joins left and right input data streams. It uses the right input data as an in-memory lookup table. Ensure the first input is always New and the second input is Original so the output (insertions/deletions/modifications) is shown in reference to the original document.
Arrays are not handled. Flatten arrays into documents using the JSON Splitter, then sort the data before sending it to the In-Memory Lookup Snap.
Transform-type Snap
-
Works in Ultra Tasks when the Single document output field is selected. Only one document is written to the output view for each input document, which is a prerequisite for Ultra Pipelines.
Prerequisites
Enough free memory should be available to load all right input data to the in-memory lookup table.
Snap views
| View | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input | This Snap has exactly two document input views (left and right). Users may want to edit the right input view label in the Views section of the Snap, since the right input view label is used as a prefix during the JOIN operation if the same column name exists in the left input data. | |
| Output | This Snap has exactly one document output view. | |
| Error |
Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
|
Snap settings
- Expression icon (
): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
| Field / Field set | Type | Description |
|---|---|---|
| Label | String |
Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline. Default value: In-Memory Lookup Example: InMemoryLookup_Join |
| Join paths | String/Expression | Required. Field names to use for left and right sides of
join. Each row defines a relationship between a left field and a right field. The
Snap supports flat map data only for all input documents; a structured JSON path
like $customer.address is not supported. |
| Left path | String/Expression |
Required. Field name in the left input data. It can be
selected from the suggested list. This property does not support expressions. Default value: None (expression toggle enabled) Example: customer_id, $customer_id, _leftFieldName (for pipeline parameter with the expression button enabled) |
| Right path | String/Expression | Required. Field name in the right input data. The Right
path suggestion is not available yet, except pipeline parameters. This property does
not support expressions. Default value: None (expression toggle enabled) Example: customer_id, $customer_id, _rightFieldName |
| Single document output | Checkbox |
If selected, only one document is written to the output view for each input document. If more than one row in the lookup table matches the left input data, the first match is joined. If there is no match, the left input data is written to the output view. Leave this selected for Ultra Tasks. If unselected, each matching row is joined with the left input data; the number of output documents may exceed the number of input documents. |
| Minimum memory (MB) | String/Expression |
If the available memory is less than this value while building the in-memory
lookup table from the right input documents, the Snap pauses fetching the next
right input document until more memory is available. Set to This Snap loads all right input documents into memory before performing the JOIN. If the right input exceeds available memory, it may cause an out-of-memory failure. This field helps reduce that possibility. Default value: 200 Example: 500 |
| Out-of-memory timeout (minutes) | String/Expression | If the Snap pauses longer than this value while waiting for more memory to
become available, it throws an exception to prevent the system from running out of
memory. Default value: 30 minutes Example: 10 minutes |
| Snap execution | Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
Default value: Execute Only Example: Validate and Execute |
Examples
- Use JSON Splitter to flatten arrays, then sort both sides on the same field before joining.