OnComponentOrder flow and tMap connections in Talend

[亡魂溺海] 提交于 2019-12-11 04:48:35

问题


I have the following flow:

  • 1 Component that needs to be executed to extract from MYSQL a certain timestamp
  • 3 MYSQL inputs that needs to use that timestamp
  • 1 tMap which needs to get the 3 mysql input

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?


回答1:


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") + "';"

Two subjobs, one for getting the variable and storing it, and another for doing your three queries into tMap, etc.



来源:https://stackoverflow.com/questions/42704560/oncomponentorder-flow-and-tmap-connections-in-talend

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!