Ask Your Question
0

convert JSON object into multiple records

asked 2018-11-16 17:07:09 -0600

Ben A gravatar image

Trying to convert a single JSON object that contains multiple records. Using /RestResponse/result as the 'Field to Parse" in a 'Data Parser' processor with 'Mulitple Values Behavior' set to 'split into multiple records' results in an error.

Cannot parse the field '/RestResponse/result' as type LIST is not supported

{ "RestResponse" : { "messages" : [ "Total [2] records found." ], "result" : [ { "name" : "Afghanistan", "alpha2_code" : "AF", "alpha3_code" : "AFG" }, { "name" : "Zimbabwe", "alpha2_code" : "ZW", "alpha3_code" : "ZWE" } ] } }

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-19 17:22:07 -0600

iamontheinet gravatar image

Hi!

If you're looking to create multiple records off /RestResponse/result, you can use Field Pivoter. Here's a sample pipeline based on your input:

image description

Cheers, Dash

edit flag offensive delete link more

Comments

Thank you, that is what I was looking to do. I also found this excellent blog post. https://streamsets.com/blog/transform-data-streamsets-data-collector/

Ben A gravatar imageBen A ( 2018-11-20 07:51:49 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-11-16 17:07:09 -0600

Seen: 189 times

Last updated: Nov 19