Informatica - MD5

来源:互联网 发布:java split 去除空格 编辑:程序博客网 时间:2024/06/07 07:31
在对数据进行增量抽取的时候,通常的方法是按照时间戳或者 Identity 字段来过滤历史数据。当然还有更加简便的方式,那就是 MD5加密函数,它可以跟他特定列或者整行数据进行hash处理成一个组32位/64位字符串。之后根据该哈希值来 SCD-2 类型抽取。
MD5有很多加密形式,不同的加密形式输出的结果是不一样的。之所以这么说是因为在 Informatica 里面使用 MD5 函数之后,在数据库中再 Check 的时候发现数据对不上,也是Google 之后才找到了匹配的函数形式。

1. How to use MD5
2. How to validate MD5 results.

Part 1. How to use MD5 function in Mapping
1. define a reuse expression for MD5 hash function.


Trying to convert other datatype to string.


Part 2 : How to validate MD5 results according to SQL querying.

UT scripts _ Premium_2.sqlUnit Test - m_POL_FEED_ActuarialAnalysis39Monthly_EarnedPremium_2014-05-14 .xlsxUnit Test - m_POL_FEED_ActuarialAnalysis39Monthly_Loss _2014-05-14.xlsxUnit Test - m_POL_FEED_ActuarialAnalysis39Monthly_Premium_2014-05-14.xlsxUT scripts _ Loss.sqlUT scripts _ Premium.sql
SELECTCONVERT(VARCHAR(32),HashBytes('MD5','Hello World'),2)SELECT UPPER(master.dbo.fn_varbintohexsubstring(0, HashBytes('MD5','Hello World'),1,0))

Need added all involded field into joint together....
Validate results:


Part 3.  Some mapping which use MD5 function
m_POL_FEED_ActuarialAnalysis39Monthly_Dividend.XMLm_POL_FEED_ActuarialAnalysis39Monthly_EarnedPremium.XMLm_POL_FEED_ActuarialAnalysis39Monthly_Loss.XMLm_POL_FEED_ActuarialAnalysis39Monthly_PassThrough.XMLm_POL_FEED_ActuarialAnalysis39Monthly_Premium.XML
MD5 Funcation.sql




0 0
原创粉丝点击