如何将查询的输出用作另一个查询的输入 [英] How to use the output of a query as input to another query

查看:111
本文介绍了如何将查询的输出用作另一个查询的输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Talend的新手,但我想从事与此类似的工作: 在tMysqlInput中,执行select语句以返回具有单列的单行,然后在tMongoDBInput查询中使用该值以获取多个文档.
我无法通过行(Main)将tMysqlInput链接到tMongoDBInput来完成一项工作?

I am new to Talend, but I want to have a job similar to this: in a tMysqlInput, make a select statement that returns a single row with a single column and then use that value in a tMongoDBInput query to get multiple documents.
How can I do that in a single job, as I am unable to link tMysqlInput to tMongoDBInput with a row(Main)?

推荐答案

您可以执行以下操作:

tMysqlInput -- main -- tFlowToIterate -- Iterate -- tMongoDBInput -- tMap -- etc

tFlowToIterate的输入流将转换为全局变量,因此您可以通过引用全局变量(String)globalMap.get("rowX.MyColumn")

The input flow of tFlowToIterate gets converted to global variables, so you can use it in your mongoDB component query by referencing the global variable : (String)globalMap.get("rowX.MyColumn")

rowX是tFlowToIterate传入主行的名称,而MyColumn是列名.确保将变量强制转换为适当的Java类型.

rowX is the name of tFlowToIterate's incoming main row, and MyColumn is the column name. Make sure to cast the variable to the appropriate java type.

这篇关于如何将查询的输出用作另一个查询的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆