Key Information

Register
Submit
Status: ‌Cancelled client request

Challenge Overview

For this challenge, we'd like to create Java class that will perform generic JSON parsing for a whole JSON record with some constraints. 

The input is a whole JSON record would appear as a single record on Kafka and the result will be the number of Map<String, Object>.

For better understanding, taking the attached json file, the output would have columns as follows:

locationId, gatewayId, zoneId, name, targetenvironment, environment and would result in 11 Map<String, Object> being written out.

They should be discrete map objects (<String, Object>) in this case with information captured about each (e.g. making sure they're related to the correct parent locationId, gatewayId etc.) (So with the sample json we provided there would be 11 discrete objects written out)

So rather than having the nested object (as from the input json) each object is exploded in the output to have all of the associated information. So long as we're getting out the right number of objects related to the input file - with all the called out fields on - we should be good for now.

for the json parsing it should be fairly generic and you should be able to specify which parts to pull out using jsonpath to loop over the data, this is optional, by default, it will parse the whole json string.

the class skelton should be like 

public JSONParser {
    public List<Map<String, Object>> parse(String jsonString) {
       ....
    }

    public List<Map<String, Object>> parse(String jsonString, String jsonPath) {
      ....
    }
}

 



Final Submission Guidelines

  • The implementation of JSONParser
  • clear guide about the usage of the JSONParser and demonstrate the JSONParser generate proper results

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30049881