We have a need to be able to take a CSV file and convert it into a nested
JSON structure. I did a simple test with GenerateFlowFile and a few
ConvertRecord processors. Test was:

GenerateFlowFile (JSON) -> ConvertRecord (JSON in, CSV out) ->
ConvertRecord (CSV in, JSON out) and it threw an exception in the last
ConvertRecord when it went from something that looked like this:

user
"MapRecord[{name=Test User, [email protected]}]"

Sample data and schema:

{
    "user": {
        "name": "Test User",
        "email": "[email protected]"
    }
}

{
    "type": "record",
    "name": "User",
    "fields": [
        {
            "name": "user",
            "type": {
                "name": "UserDetails",
                "type": "record",
                "fields": [
                    {
                        "name": "name",
                        "type": "string"
                    },
                    {
                        "name": "email",
                        "type": "string"
                    }
                ]
            }
        }
    ]
}

Any ideas on how to do this? I honestly don't recall every seeing anyone
try to do this, and understand if the Record API needs a ticket or two to
make it happen. Just need to know if I'm missing something.

Thanks,

Mike

Reply via email to