Looks like I missed this:

https://community.hortonworks.com/questions/212877/want-to-convert-csv-to-nested-json-using-nifi.html

I'll get crackin on Jolt since that seems to be the best answer at the
moment.

On Mon, Dec 3, 2018 at 11:24 AM Mike Thomsen <[email protected]> wrote:

> 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