• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » tJSONFileInput cascading header level to detail

#1 2011-08-22 17:22:35

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

tJSONFileInput cascading header level to detail

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

#2 2011-08-23 09:50:53

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: tJSONFileInput cascading header level to detail

Hi Ben
Can you upload a screenshot of basic setting of tFileInputJson?

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2011-08-23 18:08:07

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

Re: tJSONFileInput cascading header level to detail

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.


Uploaded Images

Last edited by phobucket (2011-08-23 18:08:51)

Offline

#4 2011-08-24 03:06:16

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: tJSONFileInput cascading header level to detail

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


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#5 2011-08-24 15:29:58

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

Re: tJSONFileInput cascading header level to detail

Bug created.  Thanks, Ben

Offline

#6 2011-08-25 02:35:57

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: tJSONFileInput cascading header level to detail

phobucket wrote:

Bug created.  Thanks, Ben

Thank you, Ben, please add the issue ID here.

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#7 2012-03-30 22:55:34

bharathi
Guest

Re: tJSONFileInput cascading header level to detail

Is there a workaround to achieve cascading header to detail.. Im new to Talend and Im not able to find a workaround.

#8 2012-07-21 12:44:14

damiengo
Guest

Re: tJSONFileInput cascading header level to detail

Hello,

I have the same problem with this JSON data:

Code:

{
    "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!

#9 2013-01-25 10:59:53

nuhaab
Member
Registered: 2012-12-24
Posts: 11

Re: tJSONFileInput cascading header level to detail

has this issue been resolved yet? i'm currently facing the same problem. thanks

Offline

#10 2013-01-31 16:48:38

johnlynn
Member
Registered: 2011-07-07
Posts: 41

Re: tJSONFileInput cascading header level to detail

Me too +1

Running TOS 4.2.3.r67267

Offline

#11 2013-02-01 10:32:12

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: tJSONFileInput cascading header level to detail

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


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » tJSONFileInput cascading header level to detail

Board footer

Powered by FluxBB