Hi Talend team,
I believe I should open a bug right away but just in case let me post here first. I would appreciate any feedback on this one which just add more to other issues like the one I posted before: http://jira.talendforge.org/browse/TDI-19350
The issue is related to the way tFileInputJSON component handles mappings. It relies on building arrays per each field and then later associating them by index. That approach is wrong considering the arrays are built based on jsonpath expressions.
The component should be changed to use a parser API (DOM or stream based).
Here is a simple JSON example:
If you use the below expressions:
You do not get any errors but yet the results are wrong:
Starting job json2 at 16:30 12/06/2012.
[statistics] connecting to socket on port 3849
Job json2 ended at 16:30 12/06/2012. [exit code=0]
The only way to do this right relying on just json path is too cumbersome as one would need to build complicated expressions like just show the name where there is a state and the state where there is a name (in this example simple enough but consider what will happen with several more fields):
which results correctly in:
And yet it is far from ideal. The below result should be the one everybody will be looking for: