gpt4 book ai didi

java - 来自 tFileInputJSON 的 tExtractJSONField - Talent Open Studio

转载 作者:行者123 更新时间:2023-12-02 13:00:32 29 4
gpt4 key购买 nike

我对 Talend Open Studio for DI 非常陌生。我正在尝试从下面的 JSON 文件读取数据:

{
"data": [
{
"id": "X999_Y999",
"from": {
"name": "Tom Brady", "id": "X12"
},
"message": "Looking forward to 2010!",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/X999/posts/Y999"
},
{
"name": "Like",
"link": "http://www.facebook.com/X999/posts/Y999"
}
],
"type": "status",
"created_time": "2010-08-02T21:27:44+0000",
"updated_time": "2010-08-02T21:27:44+0000"
},
{
"id": "X998_Y998",
"from": {
"name": "Peyton Manning", "id": "X18"
},
"message": "Where's my contract?",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/X998/posts/Y998"
},
{
"name": "Like",
"link": "http://www.facebook.com/X998/posts/Y998"
}
],
"type": "status",
"created_time": "2010-08-02T21:27:44+0000",
"updated_time": "2010-08-02T21:27:44+0000"
}
]
}

我想将三个属性加载到我的表中(id、actions_name 和 actions_link)。因此,在第一步(tFileInputJSON)中 - 我尝试执行循环 Json 查询,如下所示:

enter image description here

在这里,我能够根据需要提取行。但是,然后我使用 tExtractJSONField 使用 XPath 表达式提取每个“id”的“actions”下的各个字段,如下所示: enter image description here

我尝试了几种其他方法来提取字段,但无法做到这一点。另外,无法在堆栈溢出和人才论坛中找到与我的问题非常相关的任何正确帖子。有人可以帮忙吗?

最佳答案

像这样安排工作, enter image description here

tFileInputJSON 就像,

enter image description here

tExtractJSONFields 就像,

enter image description here

然后您将得到输出为 enter image description here

关于java - 来自 tFileInputJSON 的 tExtractJSONField - Talent Open Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44322876/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com