开发者

Data validations while transforming data in Pentaho

开发者 https://www.devze.com 2023-04-08 17:18 出处:网络
How do I check for foreign key validations while using Pentaho for transformation? Like I would like to transfer one table named employee from a source MySQL database to another target MySQL, and if t

How do I check for foreign key validations while using Pentaho for transformation? Like I would like to transfer one table named employee from a source MySQL database to another target MySQL, and if the employee table in target MySQL database is linked to a country table.

The incoming employee data to Pentaho(during transformation) may have any country or null, I would like to leave the country field as such if it is already a country existing in the target MySQL database country table, other wise set it to NULL.

Similar to country, I have few other fields also to be transformed in the sam开发者_JAVA百科e way. I checked the "Data validation" in Pentaho but it just gives an option to predefine or enter predefined values, which is not so good as the country table may be subject to CRUD operations.


Just perform a "database lookup" against your country table. It can return the key or the country name whatever you need. It will return null if not found, or you can set a default value. then use the field returned from the database lookup step in your target table.

0

精彩评论

暂无评论...
验证码 换一张
取 消