[ 
https://issues.apache.org/jira/browse/NIFI-8365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tamas Palfy updated NIFI-8365:
------------------------------
    Description: 
The AbstractJsonRowRecordReader when trying to find the correct schema for a 
given record it may come with a wrong one.
For example:

Suppose the following record:

{code:json}
{
  "dataCollection":[
    {
      "record": {
        "integer": 1,
        "boolean": true
      }
    },
    {
      "record": {
        "integer": 2,
        "string": "stringValue2"
      }
    }
  ]
}
{code}
Even if the schema is correctly set (which may not be the case as infer schema 
itself has a similar issue),
the second record
{code:json}
    {
      "record": {
        "integer": 2,
        "string": "stringValue2"
      }
    }
{code}
will be assigned the schema of the first.

This will cause the fields that are not present in the schema to be omitted 
when writing it out.


  was:
The AbstractJsonRowRecordReader when trying to find the correct schema for a 
given record it may come with a wrong one.
For example:

Suppose the following record:

{code:json}
{
  "dataCollection":[
    {
      "record": {
        "integer": 1,
        "boolean": true
      }
    },
    {
      "record": {
        "integer": 2,
        "string": "stringValue2"
      }
    }
  ]
}
{code}
Even if the schema is correctly set (which is may not be the case as infer 
schema itself has a similar issue),
the second record
{code:json}
    {
      "record": {
        "integer": 2,
        "string": "stringValue2"
      }
    }
{code}
will be assigned the schema of the first.

This will cause the fields that are not present in the schema to be omitted 
when writing it out.



> JSON record reader mishandles deep CHOICE types
> -----------------------------------------------
>
>                 Key: NIFI-8365
>                 URL: https://issues.apache.org/jira/browse/NIFI-8365
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Tamas Palfy
>            Priority: Major
>
> The AbstractJsonRowRecordReader when trying to find the correct schema for a 
> given record it may come with a wrong one.
> For example:
> Suppose the following record:
> {code:json}
> {
>   "dataCollection":[
>     {
>       "record": {
>         "integer": 1,
>         "boolean": true
>       }
>     },
>     {
>       "record": {
>         "integer": 2,
>         "string": "stringValue2"
>       }
>     }
>   ]
> }
> {code}
> Even if the schema is correctly set (which may not be the case as infer 
> schema itself has a similar issue),
> the second record
> {code:json}
>     {
>       "record": {
>         "integer": 2,
>         "string": "stringValue2"
>       }
>     }
> {code}
> will be assigned the schema of the first.
> This will cause the fields that are not present in the schema to be omitted 
> when writing it out.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to