Hi all,
I have a JSON input step that reads JSON content from a field. The JSON content will either be:
* a successful request-result containing all the fields I expect; or
* an unsuccessful request-result contain fields related to the error.
I have a transformation that looks for the JSON path for the "error code" that would appear only in an unsuccessful request-result.
If it finds this path it records the error_code number (if the request-result was OK, error_code will be NULL).
It then filters rows on the returned error code.
If error_code is > 0 (ie: the request-result contained returned an error) then it creates dummy (constant) values in the stream.
Otherwise, if the request-result did not return errors, the transformation runs a second JSON input step to extract the values.
I have attached a zip containing 2 files:
* "json_input_problem_example.ktr" - a cutdown version of this transformation using datagrid to generate the rows (one to be successful, one to be unsuccessful).
* "get_messages.ktr" - the full transformation. I've included this transformation to compare against the cutdown version. The complete job is too large to include and contains sensitive information.
The cutdown version using datagrid works without issue!
The full version produces the following error which I cannot explain.
Code:
2016/06/15 16:03:03 - Get Property Details Returned.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Unexpected error2016/06/15 16:03:03 - Get Property Details Returned.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : java.lang.NullPointerException
2016/06/15 16:03:03 - Get Property Details Returned.0 - at org.pentaho.di.trans.steps.jsoninput.JsonInput.prepareToRowProcessing(JsonInput.java:153)
2016/06/15 16:03:03 - Get Property Details Returned.0 - at org.pentaho.di.trans.steps.jsoninput.JsonInput.processRow(JsonInput.java:101)
2016/06/15 16:03:03 - Get Property Details Returned.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2016/06/15 16:03:03 - Get Property Details Returned.0 - at java.lang.Thread.run(Unknown Source)
I can guarantee that the datagrid string (clapi_property_detail_result) that mimics my HTTP request in the cutdown sample is exactly the same as the output from the HTTP request because that's where I copied it from in the first place.
Can anybody tell my why this is not working? :confused:
I've done a bit of searching around and the closest issue I can find is this one:
http://forums.pentaho.com/showthread...SON-Input-step
...however I don't think it's relevant in this case because my cutdown version works.
Regards,
Chris
EDIT: I am using Pentaho v6.1. However when I test the exact same Job in 5.3 it works as expected!