AlloyDB Execute
Overview

Write-type Snap
Works in Ultra Tasks
Limitations
Does not support $$ as an escape character for enclosing string input, as
$ is a reserved character for variable substitution in SnapLogic.
Behavior changes
- The following are the behavior changes caused by the JDBC driver upgrade for PostgreSQL Snap Pack and Google AlloyDB Snap Pack
- Some error messages will now include the data type for certain values, for example:
-
Old:
"...where (badId = 1) was aborted:..." -
New:
"...where (badId = ('1'::numeric)) was aborted:..."
-
- There are some minor text changes to a few of the error messages, for example:
-
Old:
"Hint: No operator matches the given name and argument types." -
New:
"Hint: No operator matches the given name and argument type(s)."
-
Snap views
| View | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input |
If the input view is defined, then the WHERE clause can substitute incoming values for a given expression. Valid JSON paths that are defined in the WHERE clause for queries or statements are substituted with values from an incoming document. If the document is missing a value to be substituted into the query or statement documents, it is written to the error view. |
|
| Output | The executed query result. If a SELECT query is executed, the query's results are merged into the incoming document and any existing keys will have their values overwritten. On the other hand, the original document is written if there are no results from the query. | |
| 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: AlloyDB Execute Example: AlloyDB Execute |
| SQL Statement | String/Expression | Required. Specify the SQL statement to execute
on the server. We recommend you to add a single query in the SQL Statement
field. Note: Scenarios to successfully execute your SQL statements You must understand the following scenarios to successfully execute your SQL statements: Scenario 1: Executing SQL statements without
expressionsIf the expression toggle of the SQL statement field is not
selected:
If the SQL statement starts with SELECT (case-insensitive), the Snap
regards it as a select-type query and executes once per input document. If not,
it regards it as write-type query and executes in batch mode. Scenario 2:
Executing SQL queries with expressions Enable the expression toggle of
the SQL statement field is selected:
Note: Table name and column names must not be provided as bind parameters. Only
values can be provided as bind parameters.
Example:
|
| Query type | Dropdown list/Expression | Select the type of query for your SQL statement (Read or
Write). When Auto is selected, the Snap tries to determine the query type automatically.If the execution result of the query is not as expected, you can change the query type to Read or Write. Default value: Auto Example: Read |
| Pass through | Checkbox | Select this checkbox to pass the input document to the output view under the
key original. Note: This field applies only to queries with the
SELECT statement. Default status: Selected |
| Ignore empty result | Checkbox | Select this checkbox to not write any document to the output view when a SELECT
operation does not produce any result. If this checkbox is not selected and the
Pass-through checkbox is selected, the input document is passed through to the
output view. Default status: Deselected |
| Number of Retries | Integer/Expression | Specify the maximum number of retry attempts the Snap must make in case of
network failure. When you set the Number of retries to more than 0,
the Snap generates duplicate records when the connection is not established. To
prevent duplicate records, we recommend that you follow one of the following:
Default value: 0 Example: 3 |
| Retry Interval (Seconds) | Integer/Expression | Specify the time interval between two successive retry requests. A retry
happens only when the previous attempt results in an exception. Default value: 1 Example: 10 |
| Auto Commit | Dropdown list | Choose one of the following options to override the state of the Auto commiton
the account.
Note: Auto commit may be enabled for certain use cases if the AlloyDB JDBC
driver is used in either the Redshift, AlloyDB, or generic JDBC Snap. However, the
JDBC driver may cause out of memory issues when SELECT statements are executed. In
such cases, Auto Commit in the Snap should be set to False and the
Fetch size in the Account settings can be increased for optimal
performance. Note: Behavior of DML Queries in Database Execute Snap when
auto-commit is false
Default value: Use account setting Example: True |
| Snap execution | Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
Default value: Execute only Example: Validate & Execute |