Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am getting an error when I parse a JSON file from a list of JSON files, I used these two documents:
Here is the part of the JSON file:
I am parsing id, name, firstName, middleName, lastName, gender, initialRegistrationDate, expirationRegistrationDate, and commonName. Note that they are on the first layer of the JSON so they don't have a header.
Hello,
Issue appears for all JSON file you tested or only for one particular cases?
All output columns in your tFileInputJSON are in String?
Can you please provide logs of you execution ?
Does the issue appear for all JSON files you tested or only for one particular case? All cases
All output columns in your tFileInputJSON are in String? Yes
Can you please provide logs of your execution? execution?
Thank you.
It seems that the issue is not on how you describe the json file in Talend, but the json file itself.
I've created the same job as you.
It work with the file attached :
Do you see anything different in your json file?
If I add a } at the end (which is not correct), I receive the same error as in your log : fail to parse the json file
I thought about it before and I did the same test and I got the same result, but I did another extra test:
I attached a pic with two of them at the same time, below is the file after running the job it shows maybe there is a space before the bracket, and up is the original file. when I compare two files with tools like diffchecker they show these two files are the same as each other, so I am really confused here! as these tools show even one file has extra space with the other.
Is your file encoding in UTF8 BOM?
Talend have issues to work with encoding with BOM, and it can also explain the result you obtain with your second job.