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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tExtractJsonFields error

Hello,
I followed the steps from the example with facebook friends, but with a different json, but valid.
this are the errors that I receive:
statistics] connecting to socket on port 4033
connected
java.io.IOException: Illegal character: <g>
A JSONObject text must begin with '{' at character 1 of 1391433900
java.io.IOException: Illegal character: <g>
java.io.IOException: Illegal character: <s>
A JSONObject text must begin with '{' at character 1 of ENTER_LOC
thi is a long message for all the values from my json.
Please let me know if you have any ideea why I have this error.
(I am using talend for the first time.)
Thank you!
Labels (4)
8 Replies
Anonymous
Not applicable
Author

Can you please give us an example your json string?
Shong
Anonymous
Not applicable
Author

so for me the "likes/data" is actually "events/params" , and "user/friends" is actually all json data "$."
I can send also print screen with my settings
Thanks you!
{
"sessionTimestamp":1391433900,
"accountId":"stage-local",
"events":,
"userId":"100006603450795",
"tracking":{
"accountId":"stage-local",
"created":1391434031,
"createdMicroTimestamp":1391434031.2963,
"type":"session",
"userId":100006603450795,
"sessionTimestamp":1391433900
}
}
Anonymous
Not applicable
Author

As you can see, some keys from params might be missing, is that an issue?
Thank you!
Anonymous
Not applicable
Author

If you read json data from a file, you don't need a tExtractJsonField component, only use a tFileInputJson and set the loop jsonpath query as "/events/params", and then you are able to extract all the values, see my screenshot. As a newbie, I would suggest you to create a json metadata follows the wizards step by step.
Shong
0683p000009MCtO.png
Anonymous
Not applicable
Author

so if I moved the columns from extract Json to input Json and removed the extractJson palette, it worked.
The question is, why for this sample works with a json file?
https://help.talend.com/search/all?query=tExtractJSONFields&content-lang=en?focusedCommentId=2864749...
Thank you!
Anonymous
Not applicable
Author

Like the sample in the component manual, you can read the events node from the json file, and then extract the values from the events node with tExtractJsonField, see my screenshots, however, only with a tFileInputJson component is enough to read the data from the json file.
Shong
0683p000009MCtT.png 0683p000009MClg.png 0683p000009MCZ0.png
Anonymous
Not applicable
Author

yes, true, but this means that I wont have acces to the first level of keys (sessionId,tracking etc), in which events is part of it.
thank you!
Anonymous
Not applicable
Author

If you read the first node of the json file with query path "$.", tFileInputJson do not return an normal json string, the result do not start with the syntax {, (you can test it by yourself, add a tLogRow after tFileInputJson to print the result on the console), that leads to the failure on tExtractJsonField, that's why you get the error "A JSONObject text must begin with '{' at character 1 of 1391433900" in your job.
Shong