nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Lawrence <wesleyll...@gmail.com>
Subject Re: Converting between avro formats
Date Wed, 14 Jun 2017 20:05:55 GMT
You may have to use 1.3's 'UpdateRecord'.

You can set the 'Replacement Value Strategy' to 'Record Path Value', and
add a custom property of key '/attributes/baz' with a value of '/baz'.

That should convert from the input to output schemas.

--Wes

On Wed, Jun 14, 2017 at 2:57 PM, Mika Borner <nifi@my2ndhead.com> wrote:

> Hi
>
> I'm struggling with a record conversion. Not sure if it's my lack of
> knowledge about AVRO or if this even possible with the ConvertRecord
> processor.
>
> My input record schema is:
>
> {
>   "name": "inputrecord",
>   "namespace": "event",
>   "type": "record",
>   "fields": [
>     { "name": "foo", "type": "string" },
>     { "name": "bar", "type": "string" },
>     { "name": "baz", "type": "string" }
>   ]
> }
>
> My output record schema:
>
> {
>   "name": "outputrecord",
>   "namespace": "event",
>   "type": "record",
>   "fields": [
>     { "name": "foo", "type": "string" },
>     { "name": "bar", "type": "string" },
>     { "name": "attributes",
>               "type": { "type": "record",
>                 "name": "attributes",
>                 "namespace": "event",
>                 "fields" : [
>                            {"name": "baz", "type": "string"}
>                            ]
>               }
>     }
>   ]
> }
>
> So basically, I want to have baz as a child attribute under the
> "attributes" element.
>
> Currently I'm only getting "null" values back. If I use the inputrecord as
> the output schema, I'm getting a value back for baz.
>
> Thanks for your help!
>
> Mika>
>
>
>
>

Mime
View raw message