You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
I have been messing around with the JSONPath expressions but have not been able to get it to work.
JSON structure sample:
{
"type": "Actors",
"detail": [
{
"firstname": "Kevin",
"lastname": "Smith",
"movies": [
{
"moviename": "Clerks",
"release": "1994",
"rating": "8",
"role": "Silent Bob"
},
{
"name": "Jay and Silent Strike Back",
"release": "2001",
"rating": "7",
"role": "Silent Bob"
}
]
},
{
"firstname": "Jason",
"lastname": "Mewes",
"movies": [
{
"moviename": "Clerks",
"release": "1994",
"rating": "8",
"role": "Jay"
},
{
"name": "Jay and Silent Strike Back",
"release": "2001",
"rating": "7",
"role": "Jay"
}
]
}
]
}
I want my output to look like:
Actors|Kevin Smith | Clerks | 1994 |8| Silent Bob
Actors|Kevin Smith | Jay and Silent Strike Back |2001 | 7|Silent Bob
Actors|Jason Mewes | Clerks | 1994 |8| Jay
Actors|Jason Mewes | Jay and Silent Strike Back | 2001 |7| Jay
But right now I get an output more like this:
Actors|Kevin Smith | Clerks | 1994 |8| Silent Bob
|| Jay and Silent Strike Back | 2001 |7| Silent Bob
|| Clerks | 1994 |8| Jay
|| Jay and Silent Strike Back | 2001 |7| Jay
Also, even though my JSON is valid per lint, I sometimes get an error message: "The Json resource datas maybe have some problems, please make sure the data structure with the same fields."
Thanks,
Ben
Offline
Hi Ben
Can you upload a screenshot of basic setting of tFileInputJson?
Best regards
Shong
Offline
Image attached. I have tried a few different path notations. ex $.detail[*]. vs $..
Output
The Json resource datas maybe have some problems, please make sure the data structure with the same fields.
The Json resource datas maybe have some problems, please make sure the data structure with the same fields.
Actors|Kevin|Smith|Clerks|1994|8|Silent Bob
|Jason|Mewes|Jay and Silent Strike Back|2001|7|Silent Bob
|||Clerks|1994|8|Jay
|||Jay and Silent Strike Back|2001|7|Jay
BTW, I had to fix the moviename field in the JSON file, and I am open to restructuring the JSON if that is required.
Last edited by phobucket (2011-08-23 18:08:51)
Offline
Hi Ben
I got the same problem with many examples and confirmed that the component can't cascading the header to next level element if there are many rows.
Can you please report a bug on our bugtracker? Our developer will investigate it further and see if it is possible.
Best regards
Shong
Offline
phobucket wrote:
Bug created. Thanks, Ben
Thank you, Ben, please add the issue ID here.
Best regards
Shong
Offline
Is there a workaround to achieve cascading header to detail.. Im new to Talend and Im not able to find a workaround.
Hello,
I have the same problem with this JSON data:
{
"championships":
[
{
"name": "Serie A",
"teams":
[
{"name": "Milan AC"},
{"name": "Juventus Turin"}
]
},
{
"name": "Premier League",
"teams":
[
{"name": "Liverpool FC"}
]
}
]
}I would like to have a result like:
Serie A | Milan AC
Serie A | Juventus Turin
Premier League | Liverpool FC
Is there any workaround to resolve it?
Many thanks in advance!
Hi All
For your information, we will enhance this component on v5.3.0, see jira issue.
This modification might be available in next release, we sincerely invite you to test the changes and feedback to us!
Shong
Offline
Pages: 1