Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
mattg1221
Contributor II
Contributor II

Why doesn't Talend allow for JSONpath recursive descent?

Talend Studio Latest Version

jars used (as seen in Modules view) - json-path:2.9.0

take a json as such: 

{
    "person": {"name": "bob", "id" : "100101"},
    "relationList": [
        {
        "person":
            {
            "name":"Steve",
            "id":"100102"
            },        
        "relationList": [
            {"person": {"name":"mary","id":"100104"}},
            {"parentId" : "100103"}
            ],
        "parentId": "100101"
        },
        {
        "person":
            {
            "name":"Sam",
            "Id":"100105"
            },
        "parentId":"100101"
        }
    ]
}
where a person json object may have a parentId and/or relationList[] object at the same level accompanying it.

To get all parentIds in the order that they show up in a depth first manner, the query is simply "$..parentId" where '..' is the recursive descent operator.

In a TfileInputJson component, if $ is the loop query and ..parentId is the query for parentId column, it throws and error. If '$..' is the loop query and 'parentId' is the parentId column query, it also throws an error.

What gives????
Labels (2)
1 Reply
Xiaodi_Shi
Employee
Employee

Hello,

It looks like a bug on JSON parsing logic.

Could you please try to use tExtractJSONFields component to parse the data to fields, in one of the "JSON query" lines? where '..' is recursive descent or does .*. work for you?

Best regards

Sabrina