What is the error you are getting?
It looks like you don't have a type specified for any of the array fields.
Example:
{"type": "array", "items": "string"}
Also, all the arrays are empty in the example json.
On Tue, Sep 17, 2019 at 7:40 AM Wesley C. Dias de Oliveira
<[email protected]> wrote:
>
> Hello, community.
>
> I'm trying to convert a JSON to an Avro using the following Avro schema:
>
> {
> "name": "team",
> "type": "record",
> "namespace": "datarocks",
> "fields": [
> {
> "name": "department_slug",
> "type": "string"
> },
> {
> "name": "slug",
> "type": "string"
> },
> {
> "name": "name",
> "type": "string"
> },
> {
> "name": "team_id",
> "type": "int"
> },
> {
> "name": "roles",
> "type": {
> "name": "roles",
> "type": "record",
> "fields": [
> {
> "name": "manager",
> "type": {
> "type": "array"
> }
> },
> {
> "name": "supervisor",
> "type": {
> "type": "array"
> }
> },
> {
> "name": "revenue_manager",
> "type": {
> "type": "array"
> }
> },
> {
> "name": "analyst",
> "type": {
> "type": "array"
> }
> }
> ]
> }
> },
> {
> "name": "related_teams",
> "type": {
> "type": "array"
> }
> },
> {
> "name": "properties",
> "type": {
> "type": "array"
> }
> }
> ]
> }
>
> Here's the JSON I use to parse:
> {
> "department_slug" : "org-dev",
> "slug" : "content_team",
> "name" : "Content Team",
> "team_id" : 1,
> "roles" : {
> "manager" : [ ],
> "supervisor" : [ ],
> "revenue_manager" : [ ],
> "analyst" : [ ]
> },
> "related_teams" : [ ],
> "properties" : [ ]
> }
>
> Nifi version: 1.9.2
>
> The processor seems to not recognize the array type on the Avro schema.
>
> Does someone have an idea?
>
> Thanks for your help.
> --
> Grato,
> Wesley C. Dias de Oliveira.
>
> Linux User nÂș 576838.