2

对于一个简化的示例,我有一个 DB2Input -> tMap -> DB2Output。在 DB2Input 中,我编写了一个从两个表中获取数据的查询。

我收到警告:参数(查询):架构与查询不同。

我只需要指定其中一张表吗?谢谢。

更新:

好吧,我想我明白了。您单击“编辑架构”按钮并手动输入查询选择的列。

4

3 回答 3

2

这是我在这些情况下倾向于做的事情(只查询两个表):

DB2Input --------
                -
               tMap ------- DB2Output
                -
DB2Input --------

换句话说 :

  • 每个查询的表一个 DB2Input
  • 使用第二个表作为“查找”表在 tMap 中进行连接(例如:http ://bekwam.blogspot.com/2012/05/efficient-lookups-with-talend-open.html )

但是,当您已经有一个复杂的查询时,您可以使用一个输入组件,就像您在 EDIT 中提到的那样。

在这种情况下,您可以按“猜测查询”按钮,Talend 可能会成功检测到结果架构。为此,您需要选择“内置”模式选项。

于 2013-08-06T07:17:23.110 回答
1

我认为我们最好先通过在数据库中编写复杂的查询来创建一个视图,然后在 talend 组件中将该视图用作表,以避免在 talend 中创建多个输入和连接:)

于 2015-06-05T08:16:31.263 回答
0

If you have a non-repository query (manually entered/adjusted/whatever) and you get the "Schema is different than the query" warning, you can use the "guess schema" button. If the system is performing correctly, it should look at the fields you have in your query and give you an output schema to match them. You may have to adjust the field types if the system doesn't understand them.

I use this (writing my own input SELECT queries) a lot to control input from one db based on records in another db...

于 2014-01-07T03:35:25.253 回答