informatica 聚合器路由器和表达式

Posted

技术标签:

【中文标题】informatica 聚合器路由器和表达式【英文标题】:informatica aggregator router and expression 【发布时间】:2018-02-19 08:38:21 【问题描述】:

想问我有一个方案可以将此 sql 查询转换为 informatica 映射:

select v.id, 

 case when v.type = 21 then nvl( 

    (SELECT nvl(SUM(nvl(amount,0)),0)  

    FROM view1 

    WHERE ctype IN (252,82) AND id = v.id AND id2 = v.id2

    GROUP BY id, id2) ,0) 

 else -1*nvl(

    (SELECT nvl(SUM(nvl(amt,0)),0)  

    FROM view2  

    WHERE vtype IN (252,82)  AND txn_id = v.txn_id  AND txn_id2 = 1  

    GROUP BY txn_id, txn_id2),0)  end AS amt1, 

case when v.type = 21 then nvl( 

    (SELECT nvl(SUM(nvl(amount,0)),0)  

    FROM view1  

    WHERE ctype IN (253,105) AND id = v.id  AND id2 = v.id2  

    GROUP BY id, id2),0)  

else -1*nvl(

    (SELECT nvl(SUM(nvl(amt,0)),0)  

    FROM view2  

    WHERE vtype IN (253,105)  AND txn_id = v.txn_id  AND txn_id2 = 1 

    GROUP BY txn_id, txn_id2),0)  

end AS amt2, 

case when v.type = 21 then  nvl( 

    (SELECT nvl(SUM(nvl(amount,0)),0)  

    FROM view1  

    WHERE ctype IN (251,75,136,135,149,164) AND id = v.id  AND id2 = v.id2  

    GROUP BY id, id2) ,0)  

else -1*nvl(

    (SELECT nvl(SUM(nvl(amt,0)),0)  

    FROM view2  

    WHERE vtype IN (251,75,136,135,149,164)  AND txn_id = v.txn_id  AND txn_id2 = 1  

    GROUP BY txn_id, txn_id2),0) 

end AS amt3,  

case when v.type = 21 then nvl( 

    (SELECT nvl(SUM(nvl(amount,0)),0)  

    FROM view1  

    WHERE ctype IN (6,101,148) AND id = v.id  AND id2 = v.id2  

    GROUP BY id, id2) ,0)  

else -1*nvl(

    (SELECT nvl(SUM(nvl(amt,0)),0)

    FROM view2  

    WHERE vtype IN (6,101,148) AND txn_id = v.txn_id  AND txn_id2 = 1 

    GROUP BY txn_id, txn_id2),0) end AS amt4    

from tblabc v, tblabc2 x

where v.status=2 and v.last_updated_datetime>sysdate

v.sid=x.sid (+)

如何在 informatica 中编码?

首先我使用 tblabc 中的连接器根据 id 和 id2 来查看 1,然后

tblabc2 -> \
            joiner 1 ----------------------------------------------------?
tblabc ->  /   |
               |                  / -> aggregator for amt1

           joiner2 --> router <     -> aggregator for amt2

view1 -> /                        \ -> aggregator for amt3

                                    \-> aggregator for amt4

view2???

但是如何从 amt1,2,3,4 的聚合器加入回连接器 1?

我无法将它链接回来,当我拖动箭头时,它没有显示链接,知道吗?

【问题讨论】:

【参考方案1】:

在这种情况下,您正在执行自联接(因为两个管道都源自同一来源)。在将端口拖到连接器转换之前,请检查 Sorted input 属性。并确保两个管道确实按键排序 - 否则会出现执行错误。

【讨论】:

以上是关于informatica 聚合器路由器和表达式的主要内容,如果未能解决你的问题,请参考以下文章

Informatica转换组件之表达式转换

informatica 部分组件介绍

获取逗号分隔值到informatica中的多行?

需要将 Informatica reg_extract 表达式转换为 Pyspark 数据帧

在INFORMATICA表达式转换中添加列

Informatica ETL workflow 定时运行功能介绍