简体   繁体   English

Talend +查找

[英]Talend + lookup

I'm starting to learn Talend and I'm facing this problem: I need to compare the column "Departamento" from the excel (input) with my static table db "Departamento" (input) in order to obtain IdDepartmento and insert it into the table Direccion(output) 我开始学习Talend,并且遇到了这个问题:我需要将excel(输入)中的“ Departamento”列与我的静态表db“ Departamento”(输入)进行比较,以获得IdDepartmento并将其插入表Direccion(输出)

地图

工作

How may I achieve this? 我该如何实现?

Thanks! 谢谢!

  • InputA: Excel file InputA:Excel文件
  • InputB: DB table InputB:DB表
  • OutputC: DB Table OutputC:数据库表

Job Graph: 工作图:

Input A ---+
           |
           +---- tMap ---- Output
           |
Input B ---+

Please use below approach- Input1: Excel file Input2: DB table Output: DB Table 请使用以下方法-输入1:Excel文件输入2:数据库表输出:数据库表

Join input1 and input2 with a tMap. 使用tMap将input1和input2连接起来。 Make sure input2 becomes lookup flow and input1 as main flow. 确保input2成为查找流,input1成为主流。 Then apply below settings. 然后应用以下设置。 1) compare Departamento & description. 1)比较Departamento和说明。 2) set join type as left outer join 3) Fetch IdDepartmento now connect the output flow to your DB output component. 2)将连接类型设置为左外部连接。3)现在,获取IdDepartmento将输出流连接到DB输出组件。

I believe by this you must have got your solution. 我相信,您一定已经找到了解决方案。

Well the Query you have written must have given Error... because it does not know what row4.somefield is. 好吧,您编写的查询必须给出Error ...,因为它不知道row4.somefield是什么。 It only takes variables at the component and it does not look like variable so far. 它仅在组件处使用变量,到目前为止看起来还不是变量。

Anyway here is how you can achieve your target 1)excel input as main 2)dbinput as lookup and connect it to tMap component and make the Innerjoin base on the condition that you have written as sql 无论如何,这就是如何实现目标1)excel输入作为主要输入2)dbinput作为查找并将其连接到tMap组件,并在您以sql编写的条件下建立Innerjoin

configure your output and what field you need and 3) Connect the component to the DBoutput component...and here you get the result. 配置您的输出以及所需的字段,然后3)将组件连接到DBoutput组件...即可在其中获得结果。

Plz put your commemnts. 请您发表表彰。

在tmap内的输出过滤器编辑器中,您实际上可以指定查找和主表之间的条件,例如“ row1.yourcolumname = row2.yourcolumnname”,其中row1是您的主表,而row2是您的查找表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM