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. Pre-SQL and post-SQL on that Source Qualifier becomeEXECUTE IMMEDIATEstatements around the table. See Pre-SQL and post-SQL. - Each intermediate transformation becomes a common table expression (CTE), or a temporary table when its result feeds more than one downstream transformation.
- A Mapplet instance first materializes its input as
tmp_mplt_in_cte_<instance>, then either reads the Mapplet procedure inline withTABLE(...)or breaks the pipeline withCALLplusRESULT_SCAN. See Mapplets. - 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. Pre-SQL and post-SQL on the Target run around that write statement.
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 are inserted 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. |
tmp_mplt_in_cte_<instance> | The temporary table that holds a Mapplet instance’s input rows before the Mapplet procedure runs. |
<folder>_<mapplet>_<hash> | The Mapplet’s own result-set procedure, for example
|
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.
Mapplets¶
A Mapplet becomes its own result-set stored procedure, separate from the procedures of the Mappings that use it, so a Mapplet shared by several Mappings is converted once. Mapping procedures stay public.m_<Mapping>. Mapplet procedures use a hashed, folder-qualified name such as ScriptingCases_AnActiveMapplet_eeb91c86, because Informatica allows the same Mapplet name in different folders while Snowflake puts every procedure in one schema.
Input Transformation and Output Transformation objects inside a Mapplet are the Mapplet’s ports. They aren’t rows in the 34-name transformation catalog.
The Mapplet procedure takes an in_table VARCHAR parameter, reads the caller’s table through IDENTIFIER(:in_table), and returns the Output Transformation’s exposed ports:
cte_input is name-bound: it maps the Input Transformation’s port names onto columns of the caller’s table, and it casts each port to the declared type. The body is wrapped in the DECLARE res RESULTSET; ... RETURN TABLE(res) scaffold that Snowflake requires to return a result set.
The calling Mapping materializes those input rows as tmp_mplt_in_cte_<instance> and reads the procedure with TABLE(...):
Call sites that pass scope¶
The previous example is the inline form, where the Mapplet composes as a CTE. When the Mapplet procedure takes a scope parameter, Snowflake rejects :scope inside FROM TABLE(), so the converter emits a pipeline break instead: a CALL as a pre-hook, then TABLE(RESULT_SCAN(LAST_QUERY_ID())):
A scope VARCHAR parameter is added to the Mapplet procedure only when the Mapplet references a control variable. The pipeline-break form is also used when the Mapplet body runs DDL or DML before its final query, because Snowflake rejects those statements inside FROM TABLE().
No-input mapplets¶
A Mapplet that contains its own Source Qualifier has no input boundary, so its procedure takes no parameters and the call site passes no arguments, including no :scope:
Passive mapplets¶
A passive Mapplet returns one row for each row you pass in, and the enclosing Mapping usually needs columns that bypass the Mapplet. Those carry columns are reunited with a converter-synthesized __row_id. Passive cte_input reads that surrogate as the first positional column ($1 AS __row_id) and reads the Input Transformation ports by name:
The call site materializes __row_id on tmp_mplt_in_cte_<instance> and left-joins the Mapplet result back to the carry columns:
The carry columns are aliased <source_qualifier>__<port> so they can’t collide with the Mapplet’s own output ports. __row_id doesn’t appear in your PowerCenter metadata.
Multiple inputs or outputs¶
A Mapplet with more than one Input Transformation or Output Transformation isn’t converted to a procedure. The enclosing Mapping emits the same SSC-EWI-INF0001 placeholder shown in Unsupported transformations, including Unsupported transformation 'mplt_multi_io' and null AS out_a for the connected output port. No FROM TABLE(public.ScriptingCases_mplt_multi_io(...)) call site is generated, and no Mapplet procedure file is emitted.
Pre-SQL and post-SQL¶
Pre-SQL and post-SQL attached to a Source Qualifier or a Target become EXECUTE IMMEDIATE statements in the procedure body, positioned around the statement they belong to. Mapping-level hooks on a Source Qualifier run before and after the temporary table:
EXECUTE IMMEDIATE is used rather than inlining the statement because the hook is arbitrary SQL that the converter doesn’t parse as part of the data flow.
When a Target has both mapping-level and session-level Pre-SQL or Post-SQL, the session value overrides the mapping value. Only the session hook is emitted around the INSERT:
A hook that contains several statements is wrapped in its own BEGIN ... END block, and a hook that references Informatica variables is built by concatenating the variable values into the string before it runs. See Workflows and orchestration.
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.