You can create mappings in SQL ELT mode to read data from Amazon Redshift or Amazon S3, load it to Amazon Redshift, and perform all of the data transformation within Amazon Redshift.
To create a mapping in SQL ELT mode, you create a mapping, and then select Mapping - SQL ELT as the mapping type. You're then prompted to choose Amazon Redshift as the cloud ecosystem and an Amazon Redshift V2 target connection. If your organization doesn't have any Amazon Redshift V2 connections, you're prompted to create one.
After you choose the target connection, the Mapping Designer opens. When you create a mapping, a Source transformation and a Target transformation are already on the canvas for you to configure.
Sources in mappings in SQL ELT mode
When you configure the source connection in the Source transformation, you can choose an Amazon Redshift V2 or an Amazon S3 V2 connection.
Amazon Redshift V2 source properties
You can configure the following properties for an Amazon Redshift source:
•Source connection - Parameter
•Source Type - Single, Query, Parameter
•Schema Name
•Source Table Name
•Pre-SQL
•Post-SQL
•SQL Query
•Select Distinct
Amazon S3 V2 source properties
You can configure the following properties for an Amazon S3 V2 source:
•Source connection - Parameter
•Source Type - Single, parameter
• Format - Delimited, Avro, JSON, ORC, Parquet
Note:
You cannot read binary data from an Amazon S3 source. Even if you set the format to None, you still cannot read binary data.
•Source Type - File and directory
•Folder Path
•File Name
•Compression Format - Gzip
For information on how to configure the supported properties, see the help for Amazon S3 V2 Connector.
Targets in mappings in SQL ELT mode
When you configure a Target transformation in a mapping in SQL ELT mode, you need to use only a Amazon Redshift V2 connection.
You can configure the following properties in a Amazon Redshift V2 target transformation in a mapping in SQL ELT mode:
•Target Connection - Parameter
•Operation - Insert, Update, Delete
•Truncate Target Table Before Data Load
•Require Null Value For Char And Varchar
•Copy Options
• Treat Source Rows As - Insert, Update, Upsert, Delete
You cannot use the None option. To upsert data, ensure that you select update in the Operation field.
•Override Target Query
•Schema Name
•Target Table Name
•Pre-SQL
•Post-SQL
For information on how the targets in mappings in SQL ELT mode behave differently from the targets in other types of mappings, see Targets in mappings in SQL ELT mode in Mappings in the Data Integration help.
Transformations in mappings in SQL ELT mode
A mapping in SQL ELT mode includes transformations that Amazon Redshift can process.
You can use the following transformations in a mapping in SQL ELT mode:
•Source
•Target
•Aggregator
•Expression
•Filter
•Joiner
• Lookup - Connected and unconnected
You can use Amazon Redshift V2 objects and Amazon S3 objects as lookups.
•Router
•Sorter
•Union
Functions in mappings in SQL ELT mode
When you create expressions within a mapping in SQL ELT mode, you must use the native functions and expression syntax of Amazon Redshift and not Informatica functions and expression syntax.
You can use the following native functions in a mapping in SQL ELT mode:
Aggregate and bit-wise aggregate functions
ANY_VALUE()
COUNT()
STDDEV_SAMP()
AVG()
LISTAGG()
SUM()
BIT_AND()
MAX()
VAR_POP()
BIT_OR()
MEDIAN()
VAR_SAMP()
BOOL_AND()
MIN()
-
BOOL_OR()
STDDEV_POP()
-
Conditional functions
COALESCE()
LEAST()
NVL2()
DECODE()
NULLIF()
-
GREATEST()
NVL()
-
Data type formatting functions
TEXT_TO_INT_ALT()
TO_CHAR()
TO_NUMBER()
TEXT_TO_NUMERIC_ALT()
TO_DATE()
-
Date and time functions
ADD_MONTHS()
DATE_PART_YEAR()
TIMEOFDAY()
CONVERT_TIMEZONE()
DATE_TRUNC()
TIMESTAMP_CMP()
DATE_CMP()
GETDATE()
TIMESTAMP_CMP_DATE()
DATE_CMP_TIMESTAMP()
INTERVAL_CMP()
TIMEZONE()
DATEADD()
LAST_DAY()
TRUNC()
DATEDIFF()
MONTHS_BETWEEN()
-
DATE_PART()
NEXT_DAY()
-
Hash functions
CHECKSUM()
FNV_HASH()
SHA1()
farmFingerprint64()
MD5()
SHA2()
FUNC_SHA1()
SHA()
MURMUR3_32_HASH()
Math functions
ABS()
DEGREES()
POW()
ACOS()
DEXP()
POWER()
ASIN()
DLOG1()
RADIANS()
ATAN()
DLOG10()
RANDOM()
ATAN2()
EXP()
ROUND()
CBRT()
FLOOR()
SIGN()
CEIL()
LN()
SIN()
CEILING()
LOG()
SQRT()
COS()
MOD()
TAN()
COT()
PI()
TRUNC()
String functions
ASCII()
LENGTH()
REVERSE()
BPCHARCMP()
LOWER()
RIGHT()
BTRIM()
LPAD()
RPAD()
BTTEXT_PATTERN_CMP()
LTRIM()
RTRIM()
CHAR_LENGTH()
OCTETINDEX()
SOUNDEX()
CHARACTER_LENGTH()
OCTET_LENGTH()
SPLIT_PART()
CHARINDEX()
QUOTE_IDENT()
STRPOS()
CHR()
QUOTE_LITERAL()
STRTOL()
COLLATE()
REGEXP_COUNT()
SUBSTRING()
CONCAT()
REGEXP_INSTR()
TEXTLEN()
CRC32()
REGEXP_REPLACE()
TRANSLATE()
DIFFERENCE()
REGEXP_SUBSTR()
TRIM()
INITCAP()
REPEAT()
UPPER()
LEFT()
REPLACE()
-
LEN()
REPLICATE()
-
Window functions
AVG()
MAX()
STDDEV_SAMP()
COUNT()
MEDIAN()
STDDEV()
CUME_DIST()
MIN()
STDDEV_POP()
DENSE_RANK()
NTH_VALUE()
SUM()
FIRST_VALUE()
NTILE()
VAR_SAMP()
LAG()
PERCENT_RANK()
VARIANCE()
LAST_VALUE()
RANK()
VAR_POP()
LEAD()
RATIO_TO_REPORT()
-
LISTAGG()
ROW_NUMBER()
-
For more information about the native functions and expression syntax of Amazon Redshift, see SQL functions reference in Amazon Redshift documentation.
Operators in mappings in SQL ELT mode
When you use mappings in SQL ELT mode, Data Integration converts the expression in the transformation by determining equivalent operators in the database. If there is no equivalent operator, Data Integration processes the transformation logic.
The table lists the operators that you can push to Amazon Redshift:
Operator
+
-
*
/
%
Rules and guidelines in mappings in SQL ELT mode
Consider the following rules and guidelines when you run mappings in SQL ELT mode:
General guidelines
•When you read from multiple sources and use a Joiner or Union transformation, ensure that you use the same connection in all the sources.
•When you provide more than five arguments in the Greatest() or Least() function, the following error message is displayed:
Function [LEAST] doesn't contain the required number of arguments. The number of required arguments is [1] The number of provided arguments is [5].
The error message is misleading. You can specify a maximum of four arguments in the Greatest() and Least() functions.
•Do not use keywords or function names as column names or output port names.
•When you perform an update, upsert, or delete operation, ensure that you specify a primary key or a column name in the update column field for the target table.
•You cannot use nested aggregate functions. For example, you cannot specify SUM(AVG(col1)) in the aggregate function.
Use nested aggregations by adding multiple Aggregator transformations in the mapping.
•When you configure a connected lookup, you can use only Return All and Return Any multiple match policies. When you configure an unconnected lookup, you can use only Return Any multiple match policy.
•When you use a connected or an unconnected lookup transformation and the Multiple Match Policy option is set to Return Any, ensure that the lookup condition doesn't contain operators other than equal to (=). Else, the mapping fails.
• When you use the TEXT_TO_NUMERIC_ALT() function, you can use one of the following syntaxes:
- TEXT_TO_NUMERIC_ALT (expression, format, precision, scale)
Ensure that the format argument is a string and the precision parameter is an integer. Also, if you specify the precision, you must specify the scale along with the precision.
•When you pass a function as an argument within another function, ensure that the data type of the value that the argument returns is supported by the parent function.
Amazon Redshift source and target
•When you read from and write to Amazon Redshift, ensure that you use the same connection in the source and target transformations.
•Ensure that the source data doesn't contain Boolean, Time, TIMESTAMPTZ, and Super data types.
•If you select Query as the source type, ensure that there are no duplicate columns in the query.
•When you configure a Lookup transformation with Multiple Match Policy option set to Return Any, and use a SQL query to override the lookup objects at runtime, ensure that number of columns that the SQL query returns is the same as that in the lookup object.
•When you use an unconnected Lookup transformation and set the Multiple Match Policy option to Return Any, the columns defined in the lookup condition are redundantly added to the SELECT clause of the query.
•When you use a custom query as source, do not enable the Select Distinct option in the advanced source properties. Else, the Select Distinct query overrides the custom query and eliminates the duplicate rows.
Amazon S3 source and Amazon Redshift target
•You cannot read encrypted files from an Amazon S3 source.
•Ensure that the source data doesn't contain hierarchical data types.
•You cannot read Date, Decimal, and Timestamp data types from an Avro file.
•You can read only String data type from a delimited file.
•You can't preview data in transformations configured midstream in the mapping flow.
•When you read from an Avro file, ensure that column names do not contain unicode characters.
•When you read data from an Avro or a JSON file, ensure that the columns names are in lowercase.
•When you read data from an ORC or a Parquet file, specify AWS_IAM_ROLE in the COPY command.
•When you read data from a delimited, Avro, or JSON file and the precision of the values is greater than the default precision, specify the attribute TRUNCATECOLUMNS=ON in the Copy command.
•When you read data from a delimited, Avro, or JSON file and the Amazon S3 bucket and the Amazon Redshift cluster are located in different regions, specify the Amazon S3 bucket region in the REGION attribute in the COPY command.