Vertica - Lookup
Overview
The Vertica - Lookup Snap provides the ability to look up records in the target table and return a selected set of fields for every matched record.
The Snap executes one request per multiple input documents to avoid making a request for every input record.
JSON paths can be used in the Snap properties and will have values from an incoming document substituted into the properties. However, documents missing values for a given JSON path will be written to the Snap's error view. After a query is executed, the query's results are merged into the incoming document.
Queries produced by the Snap have the format:
SELECT [Output fields] FROM [Table name] WHERE
[C1 = V11 AND C2 = V21 AND...[Cn = Vn1] OR
[C1 = V12 AND C2 = V22 AND...[Cn = Vn2] OR
...................................... OR
[Cn = V1n AND Cm = V2m AND...[Cn = Vnm]]
The Snap ignores any duplicated lookup condition in the input document stream since it maintains a cache for lookup conditions internally.
- This is a Read-type Snap.
Works in Ultra Tasks
Prerequisites
None.
Supported Accounts
Snap views
| Type | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input |
This Snap has exactly one document input view and expects documents in the view. Each document should have values for one AND clause in the WHERE statement. |
|
| Output |
This Snap has exactly one document output view and produces documents in the view. The output document includes the corresponding input data under the original key. If there are no results from the query, each output field will have a null value. |
|
| Learn more about Error handling. | ||
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 | Description |
|---|---|
| Label
|
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: Vertica Lookup Example: Vertica Lookup |
| Schema name
|
Specify the database schema name. Selecting a schema filters the Table name list to show only those tables within the selected schema. Note: The values can be passed using the pipeline parameters but not the upstream parameter. Default value: N/A |
| Table name
|
Required. Specify the name of SQL table on which to execute the lookup query. Note: The values can be passed using the pipeline parameters but not the upstream parameter. Default value: N/A Example: people |
| Output fields
|
Required. Specify output field names for the SQL SELECT statement. If this property is empty, the Snap selects all fields by executing the statement "SELECT * FROM ...". Default value: N/A Example: email, address, first, last |
| Lookup conditions
|
Required. Specify the lookup conditions created by using the lookup column name and the lookup column value. Each row will build a condition, such as lookupColumn1 = $inputField. Each additional row will be concatenated using a logical AND. All rows together build the lookup condition being used to lookup records in the lookup table.
Default value: N/A |
| Pass-through on no lookup match
|
When there is no lookup matching an input document, the input document will pass through to the output view if this property is checked. Otherwise, it will be written to the error view as an error condition. Default value: Not selected |
| Number of retries
|
Specify the maximum number of times that the process must be retried before displaying an error. Default value: 0 Example: 2 |
| Retry interval (seconds)
|
Specify the maximum resting time in seconds between subsequent retries. Default value: 1 Example: 2 |
| Snap Execution
|
Choose one of the three modes in which the Snap executes. The available options are: Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime. Execute only: Performs full execution of the Snap during pipeline execution without generating preview data. Disabled: Disables the Snap and all Snaps that are downstream from it. Default value: Execute only Example: Validate & Execute |