Informatica PowerCenter - Snowflake Scripting mappings and transformations¶
This page describes how an Informatica PowerCenter Mapping is converted to a Snowflake stored procedure in the Snowflake Scripting output format. For the dbt output format, see dbt mappings and transformations. For the concept map and the supported-component matrix, see the Informatica PowerCenter overview.
Warning
The Snowflake Scripting output format is in active development, so the generated code may change between releases. Most data-flow transformations are converted, but a few are still converted only in the dbt format. A transformation that isn’t converted produces a placeholder marked with an EWI code, as shown in Unsupported transformations. For production migrations, use the generally available dbt output format. For the current status of each transformation, see Supported transformations.
The mapping procedure¶
Each Mapping becomes one stored procedure named public.m_<Mapping>. The procedure takes a single scope parameter, returns VARCHAR, and runs as the caller. The data flow becomes the body, wrapped in a BEGIN ... END block:
The body is built in data-flow order:
- If the Mapping references runtime variables, a
LETdeclaration for each one reads its value withGetControlVariableUDFand thescopeparameter. See Variables and parameters. - If the Mapping uses a Sequence Generator, a
CREATE OR REPLACE SEQUENCEstatement is emitted first. - Each Source Qualifier becomes a
CREATE OR REPLACE TEMPORARY TABLEstatement. - Each intermediate transformation becomes a common table expression (CTE), or a temporary table when its result feeds more than one downstream transformation.
- The Target becomes the final write statement, which carries the upstream CTEs inside its source query. That statement is normally an
INSERT, but an Update Strategy turns it into aMERGEor aDELETE.
The scope parameter is forwarded from the calling Task so the procedure resolves the same variable values the Workflow set at runtime. See Workflows and orchestration.
Source and Source Qualifier¶
A Source Definition emits no SQL of its own: it supplies the table metadata (database, schema, and table name) that the Source Qualifier reads. The Source Qualifier becomes a temporary table that selects the connected columns from the source table:
Informatica (m_SimpleMapping):
Snowflake:
The temporary table is named tmp_sq_<name> after the Source Qualifier. When the source connection cannot be resolved, the YOUR_DB and YOUR_SCHEMA placeholders into the qualified table name.
Important
Replace the YOUR_DB and YOUR_SCHEMA placeholders with your actual Snowflake database and schema before you run the procedure. Informatica does not export connection definitions, so they cannot be filled automatically.
Expression¶
An Expression transformation becomes a CTE whose SELECT list carries each output port. A passthrough port appears as col AS col, and a computed port carries its translated formula. Informatica functions and operators convert to their Snowflake equivalents; for the full list, see Expression functions.
Informatica (m_SimpleMapping):
Snowflake:
When an Expression feeds more than one downstream transformation, it is materialized as a CREATE OR REPLACE TEMPORARY TABLE tmp_cte_<name> instead of a CTE, so the result is computed once and reused.
Target¶
The Target becomes the procedure’s final statement: an INSERT into the target table whose source query carries the upstream CTEs. The upstream data flow is aliased as sd:
Informatica (m_SimpleMapping):
Snowflake:
The CTEs are nested inside the INSERT rather than placed before it, because Snowflake Scripting does not accept a leading WITH clause as a statement inside a BEGIN ... END block.
Naming conventions¶
Every generated object name is derived from the name of the transformation it came from, lowercased:
| Name | What it is |
|---|---|
tmp_sq_<name> | The temporary table for a Source Qualifier. |
cte_<name> | The CTE for an intermediate transformation. |
tmp_cte_<name> | The same intermediate transformation, materialized as a temporary table instead because more than one downstream transformation reads it. |
source_data | The inner CTE that carries a transformation’s input rows. |
sd | The alias for the upstream data flow in the final write statement. |
Filter¶
A Filter becomes a WHERE clause on its source_data input:
This example is materialized as a temporary table because two downstream transformations read the filtered rows. A Filter with a single consumer becomes a cte_<name> CTE instead.
Router¶
A Router materializes its input once, then emits one write statement per output group. Each group’s condition becomes that statement’s WHERE clause. The default group is written last, and its condition is the negation of every other group’s condition:
The default group wraps the negated condition in COALESCE(..., FALSE) so that rows where the condition evaluates to NULL still reach the default group, which is how PowerCenter routes them.
Joiner¶
A Joiner becomes a CTE that joins its master and detail inputs on the join condition. The Informatica join type determines the SQL join: a normal join becomes an inner join, and master or detail outer joins become the corresponding outer join.
Union¶
A Union becomes a CTE whose source_data combines every input with UNION ALL, which preserves duplicate rows the way PowerCenter does:
Aggregator¶
An Aggregator becomes a CTE with a GROUP BY over its group-by ports. Each aggregate port carries its translated aggregate function, cast to the port’s declared type:
An Aggregator with no group-by ports aggregates over the whole input, producing a single row.
Sorter¶
A Sorter becomes an ORDER BY on its input. When the transformation has the distinct option enabled, duplicate rows are removed as well.
Sequence Generator¶
A Sequence Generator becomes a native Snowflake sequence, created at the top of the procedure body before any data flows. Downstream ports read it with NEXTVAL:
The sequence is named <transformation>_seq and persists after the procedure finishes, because a Snowflake sequence isn’t a temporary object. Reusable and non-reusable Sequence Generators are both converted.
Normalizer¶
A Normalizer becomes a chain of CTEs that expand each repeating group into separate output rows, one CTE per generated occurrence.
Lookup¶
A connected Lookup becomes a CTE containing two inner CTEs: lookup_reference reads the lookup table, and input_data carries the incoming rows. They’re joined with a LEFT JOIN on the lookup condition, so rows with no match still pass through with NULL lookup values.
Because PowerCenter returns a single row per lookup, lookup_reference is deduplicated with QUALIFY ROW_NUMBER() partitioned by the lookup condition ports:
Input ports are aliased <source_qualifier>__<port> inside input_data so they can’t collide with the lookup table’s own column names.
The SSC-FDM-INF0070 note is emitted because the ORDER BY inside ROW_NUMBER() has no deterministic key. If a lookup can match several rows and you need a specific one, add an ORDER BY to the Lookup SQL override.
An unconnected Lookup is converted differently: it becomes a Snowflake scalar UDF that the calling expression invokes. A flat file Lookup follows the connected shape, but it reads the file from a stage, so it needs a stage path mapping.
Update Strategy¶
An Update Strategy changes the Target’s write statement instead of adding a CTE of its own. A DD_UPDATE strategy becomes a MERGE that matches on the target’s primary key:
A DD_DELETE strategy becomes a DELETE of the target rows whose key matches an incoming row. The SSC-FDM-INF0019 note records that the strategy’s logic now lives in the target write statement rather than in a transformation of its own.
Important
Update Strategy is only partially converted in this format. Data-driven strategies whose expression resolves to a recognized dispatch shape are converted as shown earlier. Any other shape falls back to the dbt output for that Mapping, so review the generated procedure to confirm the write statement matches the strategy you expect.
A complete example¶
The following Mapping reads a source table, passes the columns through an Expression, and writes them to a target.
Informatica (m_SimpleMapping):
Snowflake:
The Workflow’s Task calls this procedure and forwards the scope:
Unsupported transformations¶
When a Mapping uses a transformation that the Snowflake Scripting format doesn’t convert, such as a Stored Procedure or a Java transformation, the data flow is kept connected by emitting a placeholder CTE. The placeholder selects NULL for each output port, includes the original transformation definition as comments, and is marked with SSC-EWI-INF0001:
Informatica (m_StoredProcMapping):
Snowflake:
Downstream transformations still reference this CTE by name, so the rest of the procedure is generated normally. Convert the flagged transformation manually, or generate the Mapping in the dbt output format, which supports it today.