Skip to content

PowerCenter → Noria

Philosophie

Un mapping PowerCenter devient une ou plusieurs tâches SQL Noria. Le workflow devient le pipeline (noria.yml). Les paramètres de session deviennent des params:.

Correspondances clés

Transformations

PowerCenter Noria (SQL)
Source Qualifier + filtre SELECT ... FROM source WHERE ...
Expression Transformation Colonnes calculées dans SELECT
Aggregator GROUP BY + SUM(), COUNT(), etc.
Lookup (connecté) LEFT JOIN
Lookup (non connecté) Sous-requête scalaire
Joiner INNER JOIN / LEFT JOIN
Filter WHERE
Router (branches) Plusieurs tâches avec WHERE différent
Union UNION ALL
Sorter ORDER BY
Normalizer UNNEST() (DuckDB)
Rank ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...)
Sequence Generator ROW_NUMBER() OVER (ORDER BY ...)

Stratégies de load_orders (Update Strategy)

Update Strategy Noria
DD_INSERT output_write: replace ou append
DD_UPDATE output_write: update + update_key: [col]
DD_DELETE + DD_INSERT output_write: merge + merge_key: [col]
Partition refresh output_write: incremental + incremental_key: col
SCD Type 2 output_write: scd2 + scd2_key: [col]

Paramètres

PowerCenter Noria
$Param (Session Parameter) {{ params.nom }} dans le SQL
Parameter File --params-file prod.yml en CLI
Mapping Parameter params: dans la tâche
Connection Object database: dans noria.yml

Orchestration

PowerCenter Noria
Workflow Pipeline (noria.yml)
Session Tâche (nodes:)
Worklet Groupe de tâches avec needs:
Pre/Post SQL pre_hook: / post_hook:
Sessions en parallèle DAG parallèle (max_workers) ou loop_parallel: true
On Success / On Failure soft_fail: / notifications:
Recovery (reprise) retry: N + retry_delay_s: N

Exemple complet

Mapping PowerCenter (description)

Source : STG.COMMANDES filtrée sur STATUT = 'V'
Expression : calcul de MONTANT_TTC = MONTANT_HT * 1.20
Aggregator : somme par CLIENT_ID et MOIS
Cible : DWH.STATS_CLIENT en Insert/Update sur (CLIENT_ID, MOIS)

Réécriture Noria

nodes:
  stats_client:
    sql: sql/stats_client.sql
    target: "{{ params.schema_dwh }}.stats_client"
    output_write: merge
    merge_key: [client_id, mois]
    description: "Statistiques mensuelles par client (commandes validées)"
    tags: [daily, finance]
-- sql/stats_client.sql
SELECT
    client_id,
    {{ date_trunc('month', 'date_commande') }}        AS mois,
    COUNT(*)                                          AS nb_commandes,
    ROUND(SUM(montant_ht), 2)                        AS montant_ht_total,
    ROUND(SUM(montant_ht * 1.20), 2)                AS montant_ttc_total,
    {{ current_timestamp() }}                         AS updated_at
FROM {{ params.schema_stg }}.commandes
WHERE statut = 'V'
GROUP BY
    client_id,
    {{ date_trunc('month', 'date_commande') }}