Amazon Redshift Connectors > Part II: Data Integration with Amazon Redshift V2 Connector > SQL ELT with Amazon Redshift V2 Connector > SQL ELT optimization for mapping tasks
  

SQL ELT optimization for mapping tasks

You can configure SQL ELT optimization from a mapping task to enhance the mapping performance.
After you create a mapping, add the mapping to a mapping task, and then configure SQL ELT optimization in the mapping task. You can select how Data Integration handles SQL ELT optimization in the SQL ELT Optimization Fallback Option menu on the Runtime Options tab.
The task converts the transformation logic to Amazon Redshift queries, sends the queries to Amazon Redshift, and the mapping logic is processed in the Amazon Redshift database.
If your mapping contains multiple pipelines, you can define the flow run order to load the targets from the pipelines in a particular order.
You cannot use SQL ELT optimization when you run a mapping in advanced mode.

SQL ELT optimization types

When you apply SQL ELT optimization , the task pushes transformation logic to the source or target database based on the optimization type you specify in the task properties. Data Integration translates the transformation logic into SQL queries or Amazon Redshift commands to the Amazon Redshift database. The database runs the SQL queries or Amazon Redshift commands to process the transformations.
You can configure the following types of SQL ELT optimization in a mapping:
None
The task does not push down the transformation logic to the Amazon Redshift database.
Full
The task pushes as much of the transformation logic as possible to process in the target database. When a transformation is not supported in the mapping, the task partially pushes down the mapping logic to the point where the transformation is supported for SQL ELT optimization.
Source
The task pushes down as much as the transformation logic as possible to process in the source database. When you select source SQL ELT optimization, the task pushes the transformation logic for all the configured transformations downstream in the mapping until it reaches the Target transformation. It leaves out the target transformation logic and pushes down the rest of the mapping logic to the source database.

Data Integration behavior with source and full SQL ELT optimization

When you select full or source SQL ELT optimization for a mapping that reads from or writes to Amazon Redshift, Data Integration analyzes the mapping from the source to the target or until it reaches a downstream transformation to determine whether to push down only partial or the entire mapping logic for processing to the database.
If all the transformations in the mapping are supported for SQL ELT optimization, the task pushes down the entire mapping logic to the database.
When a transformation is not supported in the mapping, the task partially pushes down the mapping logic to the point where the transformation is supported for SQL ELT optimization. Data Integration generates and executes a SELECT statement for the transformation logic that needs to be pushed down. Then, it reads the results of this SQL query and processes the remaining transformations in the mapping.

SQL ELT optimization scenarios

You can configure SQL ELT optimization using the Amazon Redshift V2 Connector or the Amazon Redshift ODBC Connector in mappings.
You can use configure SQL ELT optimization for the following scenarios when you use Amazon Redshift V2 Connector in mappings:
Note: You cannot configure SQL ELT optimization for a mapping task that is based on mapping in advanced mode.
Source and target endpoints
Supported SQL ELT optimization scenarios in mappings
SQL ELT optimization type
Amazon S3 source
Amazon Redshift target
Reads from Amazon S3 and writes to Amazon Redshift using the Amazon Redshift V2 connection.
When data is read from the source to the target, this connection uses the AWS commands.
Full
Amazon Redshift source
Amazon Redshift target
Reads from Amazon Redshift and writes to Amazon Redshift using the Amazon Redshift V2 connection.
The source and target can be in the same or different cluster regions.
Source, Full
Note: The Secure Agent pushes the entire mapping logic or only the partial mapping logic, as applicable, for processing to Amazon Redshift.
Amazon Redshift source
Reads from Amazon Redshift using the Amazon Redshift V2 connection and writes to other targets.
Source
Note: You can use the Secure Agent or the Hosted Agent to run mappings enabled with SQL ELT optimization.
Note: You can configure SQL ELT for a mapping that uses an Amazon Redshift ODBC connection to read from and write to Amazon Redshift. Informatica recommends that you use the Amazon Redshift V2 connection in mappings to configure SQL ELT optimization. If you cannot push down specific transformation logic using the Amazon Redshift V2 connection, you can explore configuring SQL ELT optimization using the Amazon Redshift ODBC connection.
The Amazon Redshift ODBC connection uses the Amazon ODBC 64-bit drivers on Windows and Linux systems. For more information, see the How-To Library article, Configuring SQL ELT optimization for Amazon Redshift using the ODBC Connector.

SQL ELT compatibility

You can configure the task to push transformations, functions, and operators to the database.
When you use SQL ELT optimization, the Secure Agent converts the expression in the transformation by determining equivalent operators and functions in the database. If there is no equivalent operator and function, the Secure Agent processes the transformation logic.

Functions with Amazon Redshift V2

When you use SQL ELT optimization, the Secure Agent converts the expression in the transformation by determining equivalent functions in the database. If there is no equivalent function, the Secure Agent processes the transformation logic.
The following table summarizes the availability of SQL ELT functions in an Amazon Redshift database. Columns marked with an X indicate that the function can be pushed to the Amazon Redshift database. Columns marked with a dash (-) symbol indicate that the function cannot be pushed to the database.
Function
SQL ELT
Function
SQL ELT
Function
SQL ELT
ABORT()
-
INITCAP()
X
REG_MATCH()
X
ABS()
X
INSTR()
X
REG_REPLACE
X
ADD_TO_DATE()
X
IS_DATE()
-
REPLACECHR()
X
AES_DECRYPT()
-
IS_NUMBER()
X
REPLACESTR()
X
AES_ENCRYPT()
-
IS_SPACES()
X
REVERSE()
-
ASCII()
X
ISNULL()
X
ROUND(DATE)
-
AVG()
X
LAST()
-
ROUND(NUMBER)
X
CEIL()
X
LAST_DAY()
X
RPAD()
X
CHOOSE()
-
LEAST()
-
RTRIM()
X
CHR()
X
LENGTH()
X
SET_DATE_PART()
-
CHRCODE()
-
LN()
X
SIGN()
X
COMPRESS()
-
LOG()
X
SIN()
X
CONCAT()
X
LOOKUP()
X
SINH()
-
COS()
X
LOWER()
X
SOUNDEX()
-
COSH()
-
LPAD()
X
SQRT()
X
COUNT()
X
LTRIM()
X
STDDEV()
X
CRC32()
-
MAKE_DATE_TIME()
-
SUBSTR()
X
CUME()
-
MAX()
X
SUM()
X
DATE_COMPARE()
X
MD5()
X
SYSTIMESTAMP()
X
DATE_DIFF()
X
MEDIAN()
X
TAN()
X
DECODE()
X
METAPHONE()
-
TANH()
-
DECODE_BASE64()
-
MIN()
X
TO_BIGINT
X
DECOMPRESS()
-
MOD()
X
TO_CHAR(DATE)
X
ENCODE_BASE64()
-
MOVINGAVG()
-
TO_CHAR(NUMBER)
X
EXP()
X
MOVINGSUM()
-
TO_DATE()
X
FIRST()
-
NPER()
-
TO_DECIMAL()
X
FLOOR()
X
PERCENTILE()
-
TO_FLOAT()
X
FV()
-
PMT()
-
TO_INTEGER()
X
GET_DATE_PART()
X
POWER()
X
TRUNC(DATE)
X
GREATEST()
-
PV()
-
TRUNC(NUMBER)
X
IIF()
X
RAND()
-
UPPER()
X
IN()
X
RATE()
-
VARIANCE()
X
INDEXOF()
-
REG_EXTRACT()
-

Operators with Amazon Redshift V2

When you use SQL ELT optimization, Data Integration converts the expression in the transformation by determining equivalent operators in the database. If there is no equivalent operator, the Data Integration processes the transformation logic.
These operator can be pushed to the Amazon Redshift database by using full SQL ELT optimization.
The following table lists the operators that you can push to an Amazon Redshift database:
Operator
Operator
+
=
-
>=
*
<=
/
!=
%
AND
||
OR
>
NOT
<

Variables with Amazon Redshift V2

You can use full SQL ELT to push the SYSDATE variable to the Amazon Redshift database in an expression transformation.
Note: When you use full SQL ELT to push the SYSDATE variable, it corresponds to the date/time data type of the Amazon Redshift cluster, while for mappings without SQL ELT optimization the SYSDATE variable corresponds to the date/time data type of the agent.

Configuring SQL ELT optimization

To optimize a mapping, add the mapping to a task, and then configure SQL ELT optimization in the mapping task.
    1Create a mapping task.
    2In the SQL ELT optimization section on the Runtime Options tab, set the SQL ELT optimization value to Full or To Source.
    You can use Source SQL ELT optimization only when you read from an Amazon Redshift source.
    Note: The optimization context type option is not applicable for an Amazon Redshift V2 mapping task.
    3If full SQL ELT optimization is not available, select how Data Integration handles SQL ELT optimization in the SQL ELT optimization Fallback Option menu:
    Note: The fallback options are not applicable to mappings in advanced mode.
When you run the mapping task, the transformation logic is pushed to the Amazon Redshift database. To verify that the SQL ELT optimization has taken place, you can check the session log for the job. You can monitor the jobs that you initiated on the My Jobs page.

Transformations for Amazon Redshift V2 mappings

When you configure SQL ELT optimization, the Secure Agent tries to push the configured transformation to Amazon Redshift.
The following list summarizes the availability of transformations that you can push down to Amazon Redshift.

Aggregator transformation

You can configure full SQL ELT optimization to push an Aggregator transformation to process in Amazon Redshift.

Aggregate calculations

You can perform the following aggregate calculations:

Incoming fields

When you configure an Aggregator transformation and the incoming field is not used in an aggregate function or in a group by field, the output is not deterministic as the ANY_VALUE() function returns any value from the field.

Expression transformation

You can configure full SQL ELT optimization to push an Expression transformation to process in Amazon Redshift.
You can add an Expression transformation to each of the sources in the mapping, followed by a join downstream in the mapping. Additionally, you can add multiple Expression transformations that branch out from a transformation and then branch in into a transformation downstream in the mapping.
When you configure an Expression transformation, consider the following rules to include variables in the expression:

Joiner transformation

You can configure a Joiner transformation between two Amazon S3 sources or two Amazon Redshift sources.

Lookup transformation

You can configure full SQL ELT optimization to push a Lookup transformation to process in Amazon Redshift. You can push both a connected and an unconnected lookup.
Consider the following rules when you configure a lookup in a mapping:
You can nest the unconnected lookup function with other expression functions.For more information on specific rules for lookups, see Rules and guidelines for Lookup transformation.

Sorter transformation

You can configure full SQL ELT optimization to push a Sorter transformation to process in Amazon Redshift.
When you configure a Sorter transformation, only the following sorter advanced properties are applicable:

SQL transformation

You can use an SQL transformation to push Redshift supported scalar functions to Amazon Redshift.
When you configure SQL ELT optimization for a mapping, you can use SQL user-defined functions (UDFs) in a SQL transformation and run queries with the Amazon Redshift target endpoint.
You can use only the SELECT clause SQL statement to push down a function. The following snippet demonstrates the syntax of a simple select SQL query:
SELECT <function_name1>(~Arg~), <function_name2> (~Arg~)...
You must provide the corresponding query in the following format:
select <Redshift_supported_scalar_function1> (~Arg~), <Redshift_supported_scalar_function2> (~Arg~)
You can push a SQL transformation with the following restrictions:

Router transformation

When you configure a Router transformation, you must connect or map only one output group to the target transformation.

Features

You can configure SQL ELT optimization for a mapping that reads from the following sources and writes to an Amazon Redshift target:
When you configure a mapping, some parameters are not supported for a mapping enabled for SQL ELT optimization. You can refer to the list of parameters that each source supports.

Amazon Redshift V2 sources, targets, and lookups

You can configure an Amazon Redshift V2 connection in the source transformation with basic, IAM, and assume role authentication and enable SQL ELT optimization in the mapping task.

Connection properties

When you configure SQL ELT optimization, you can use the following advanced properties for an Amazon Redshift V2 source in the Amazon Redshift V2 connection:

Source properties

When you configure SQL ELT optimization, you can use the following properties for an Amazon Redshift V2 source in the Source transformation:

Target properties

When you configure SQL ELT optimization, you can use the following properties for an Amazon Redshift V2 target:
Note: If you configure source and target advanced properties that are not applicable, the mappings run in the Informatica runtime environment.

Lookup properties

When you configure SQL ELT optimization, you can use the following properties for Amazon Redshift V2 lookups:
Note: You can specify a parameter file in the mapping task to override the Amazon Redshift V2 source, lookup, and target connections and objects in a mapping.

Amazon S3 V2 source

You must configure an Amazon S3 V2 connection with basic, assume role, and IAM authentication when you enable SQL ELT optimization in a mapping task.

Source properties

When you configure SQL ELT optimization, you can use the following properties for an Amazon S3 V2 source in a mapping:

SQL ELT optimization for multiple targets

You can add multiple Amazon Redshift V2 targets in a mapping.
When you configure a mapping to write to multiple Amazon Redshift V2 targets, you can further optimize the write operation when you configure full SQL ELT optimization.
To optimize, you can choose to configure an insert, update, upsert, delete, or data driven operation for multiple targets individually.
You can select the same or different Amazon Redshift V2 target table in multiple Target transformations and perform different operations for each of the Target transformations to run independent of each other.
If your mapping contains multiple pipelines, you can define the flow run order to load the targets from the pipelines in a particular order.
When you define the flow run order for multiple pipelines and also set -DEnableSingleCommit=true for a single pipeline, the -DEnableSingleCommit=true property in given precedence.

Rules and guidelines

Consider the following rules and guidelines when you optimize full SQL ELT optimization for multiple targets:

Determine the order of processing for multiple targets

When you configure a mapping to write to multiple targets in a single pipeline, with each target configured for any write operation, the target operations are processed in a predefined order of delete, update, upsert, and insert.
To process the target operations in the predefined order, you need to set certain properties in the Secure Agent and in the task properties.

Set -DEnableSingleCommit=true in the Secure Agent properties

Perform the following tasks to set the property for the Secure Agent:
  1. 1Open Administrator and select Runtime Environments.
  2. 2Select the Secure Agent for which you want to set the property.
  3. 3On the upper-right corner of the page, click Edit.
  4. 4In the System Configuration Details section, select the Type as DTM for the Data Integration Service.
  5. 5Edit the JVM options and set the property to -DEnableSingleCommit=true.

Set the EnableSingleCommit property in the task properties

Perform the following tasks to set the property in the task:
  1. 1On the Runtime Options tab in the mapping task properties, navigate to the Advanced Session Properties section.
  2. 2From the Session Property Name list, select Custom Properties, and set the Session Property Value to Yes.
Consider the following guidelines when the target operations are processed in a predefined order:

Clean stop a SQL ELT optimization job

When a task enabled for SQL ELT optimization is running, you can clean stop the job to terminate all the issued statements and processes spawned by the job.
Use the Clean Stop option on the My Jobs page in Data Integration and the All Jobs and Running Jobs page in Monitor.
See the following exceptions before you clean stop a SQL ELT optimization task:

Rules and guidelines for SQL ELT optimization

Use the following rules and guidelines when configuring SQL ELT optimization for an Amazon Redshift database:

Rules for SQL ELT optimization in mappings that read from and write to Amazon Redshift

Consider the following guidelines when you configure full SQL ELT optimization for mappings that read from or write to Amazon Redshift:

Rules for source SQL ELT optimization in mappings that read from Amazon Redshift

Consider the following guidelines when you configure source SQL ELT optimization for mappings that read from Amazon Redshift:

Rules and guidelines for adding multiple source objects

Consider the following rules and guidelines when you add multiple source objects:

Rules and guidelines for functions

Use the following rules and guidelines when pushing functions to an Amazon Redshift database:

Rules and guidelines for aggregate functions

Use the following rules and guidelines when pushing aggregate functions to an Amazon Redshift database:

Rules and guidelines for Router transformation

Consider the following rules and guidelines for a Router transformation:

Rules and guidelines for Lookup transformation

When you configure a Lookup transformation, adhere to the following guidelines:

Connected lookups

Consider the following rules and guidelines for a connected Lookup transformation:

Unconnected lookups

Consider the following rules and guidelines for an unconnected Lookup transformation:

Rules and guidelines for SQL transformation

Consider the following rules and guidelines for a SQL transformation: