【发布时间】:2021-04-03 19:02:52
【问题描述】:
我有以下 XML 结构作为输入
<dataexport>
<header>
<companyinfo>
<companyid> 100 </companyid>
<companyname>ABC Corp</companyname>
</companyinfo>
</header>
<deptinfo>
<electrical>
<response>
<deptid> 1 </deptid>
<totalemp> 200 </totalemp>
<totalunits> 20 </totalunits>
</response>
</electrical>
<mechanical>
<response>
<deptid> 2 </deptid>
<totalemp> 150 </totalemp>
<totalunits> 40 </totalunits>
</response>
</mechanical>
<chemical>
<response>
<deptid> 3 </deptid>
<totalemp> 100 </totalemp>
<totalunits> 20 </totalunits>
</response>
</chemical>
我期待的输出是
| Company ID | Company name | Dept | Dept ID | Total emp |
|---|---|---|---|---|
| 100 | ABC Corp | Electrical | 1 | 200 |
| 100 | ABC Corp | Mechanical | 2 | 150 |
| 100 | ABC Corp | Chemical | 3 | 100 |
我采用的设计方法如下 -
tXMLMap 组件已配置如下 -
使用这种方法,我只能获得一个输出,并且无法将 deptinfo_electrical、deptinfo_mechanical 和 deptinfo_chemical 的结果合并到一个数据流中以加载到雪花表中。
请告知这里可以使用什么设计方法。
【问题讨论】:
标签: xml snowflake-cloud-data-platform talend