我正在研究ETL工具(如Talend)并调查是否可以使用Apache Nifi.可以使用Nifi执行以下操作:
我已经尝试在Nifi中设置工作,但无法看到如何执行两个单独的CSV文件的连接.这个任务在Apache Nifi中是否可行?
看起来QueryDNS处理器可以用于使用另一个来执行一个CSV文件的丰富,但对于这个用例来说这似乎过于复杂.
以下是输入CSV的示例,需要在state_id上加入:
customers.csv
id | name | address | state_id
---|------|--------------|---------
1 | John | 10 Blue Lane | 100
2 | Bob | 15 Green St. | 200
Run Code Online (Sandbox Code Playgroud)
states.csv
state_id | state
---------|---------
100 | Alabama
200 | New York
Run Code Online (Sandbox Code Playgroud)
output.csv
id | name | address | state
---|------|--------------|---------
1 | John | 10 Blue Lane | Alabama
2 | Bob | 15 Green St. | New York
Run Code Online (Sandbox Code Playgroud) 我有两个有效负载并希望将它们合并为单个 JSON 对象(流式连接)。在少数地方,人们建议使用 AttributesToJSON,但由于其中一个 JSON 没有固定的属性集,我想这是不可能的。
第一个有效载荷是
{
"title":"API-Actions Documentation",
"title_link":"https://api.slack.com/",
"author_name":"name",
"author_link":"http://flickr.com/bobby/",
"author_icon":"http://flickr.com/icons/bobby.jpg",
"text":"Optional",
"image_url":"http://my-website.com/path/to/image.jpg",
"thumb_url":"http://example.com/path/to/thumb.png",
"footer":null,
"pretext":"@name",
"color":"#7CD197"
}
Run Code Online (Sandbox Code Playgroud)
第二个是,
{
"fields":[
{
"title":"Priority",
"value":"low",
"short":"true"
},
{
"title":"Priority",
"value":"medium",
"short":"true"
},
{
"title":"Priority",
"value":"high",
"short":"true"
},
{
"title":"Priority",
"value":"blocker",
"short":"true"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我希望输出为
{
"title":"API-Actions Documentation",
"title_link":"https://api.slack.com/",
"author_name":"name",
"author_link":"http://flickr.com/bobby/",
"author_icon":"http://flickr.com/icons/bobby.jpg",
"text":"Optional",
"image_url":"http://my-website.com/path/to/image.jpg",
"thumb_url":"http://example.com/path/to/thumb.png",
"footer":null,
"pretext":"@name",
"color":"#7CD197",
"fields":[
{
"title":"Priority",
"value":"low",
"short":"true"
},
{
"title":"Priority",
"value":"medium",
"short":"true"
},
{
"title":"Priority",
"value":"high",
"short":"true"
},
{
"title":"Priority",
"value":"blocker",
"short":"true" …Run Code Online (Sandbox Code Playgroud)