如何在 Pentaho Kettle 中迁移具有一致外键的表?
我有包含 data 的 csv 文件
name, state
。
我想将这些数据放入表中:
Table1{id[PK], name}
State{table1_id[FK], state}.
这里的主要问题是如何存储新创建的 Table1 id 并在插入状态表期间使用它 如何用 pentaho 做到这一点?
I have csv file with data
name, state
.
I want to put those data to tables:
Table1{id[PK], name}
State{table1_id[FK], state}.
Main problem here is to how store newly created Table1 id and use it during inserting to State table
How to do this with pentaho?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Table1(在您的示例中为维度),请使用“数据仓库”选项卡中的“组合查找/更新”:
将“组合查找/更新”连接到“插入/更新” '。对状态表(在您的示例中是事实表)使用“插入/更新”
“组合查找/更新”的 Y 标志,检查维度表中是否存在给定字段,如果是,则您拥有数据库中的 id,如果不存在,则将插入新值和新键回来了。
问候
马特乌什
For Table1 (in your example it is dimension) use 'Combination lookup/update' from 'Data Warehouse' tab:
Connect 'Combination lookup/update' to 'Insert / Update'. Use 'Insert / Update' for State table (in your example it is fact table)
'Combination lookup/update' check if given Field exists in Dimension table if yes then you have id from database if not then new value will be inserted and new key returned.
Regards
Mateusz