Talend 中的 OnComponentOrder 流和 tMap 连接 [英] OnComponentOrder flow and tMap connections in Talend
问题描述
我有以下流程:
- 1 需要执行以从 MYSQL 中提取某个特定的组件时间戳
- 3 个需要使用该时间戳的 MYSQL 输入
- 1 个 tMap 需要获取 3 个 mysql 输入
但是,我不允许将 3 个 mysql 连接到单个 tMap 中,因为它们取决于第一个组件(通过 OnComponentOk)但顺序不同.我该如何安排这种情况?
However, I am not allowed to connect the 3 mysql into the single tMap because they are depending on the first component (through OnComponentOk) but with different order. How do I orchestrate this sort of situations?
推荐答案
您可以使用 tSetGlobalVar 组件(例如,引用 row1.mydate)执行查询并设置全局变量,然后在进入 tMap 的每个查询中, 引用全局变量,如:
You could execute a query and set a global variable using the tSetGlobalVar component (referencing row1.mydate, for example), then in each of your queries going into tMap, reference the global variable like:
SELECT ...
FROM ...
WHERE mydate >= '" + (String) globalMap.get("myDate") + "';"
两个子作业,一个用于获取变量并存储它,另一个用于对 tMap 等进行三个查询.
Two subjobs, one for getting the variable and storing it, and another for doing your three queries into tMap, etc.
这篇关于Talend 中的 OnComponentOrder 流和 tMap 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!