exceptionfactory commented on PR #9347:
URL: https://github.com/apache/nifi/pull/9347#issuecomment-2426549131

   > While this does solve the issue, I'm a bit conflicted on the current 
approach. Not only this could have a performance impact (we are likely going to 
not use the serialized form as often), but it also feels like the default 
should be to ignore the unknown fields when reading the record.
   > 
   > If we consider the below scenario:
   > 
   >     * GFF Processor, generating a JSON with 3 fields: `a`, `b`, and `c`
   > 
   >     * ConvertRecord with JSON Reader / JSON Writer
   >       
   >       * JSON reader with a schema only specifying fields `a` and `b`
   >       * JSON writer with a schema specifying fields `a`, `b`, and `c` (`c` 
defaulting to `null`)
   > 
   > 
   > It feels like the expected result should be a JSON with the field `c` and 
a `null` value, because the reader would drop the field when reading the JSON 
and converting it into a record and pass it to the writer.
   > 
   > If we agree on the above, then it may be easier to juste override 
`nextRecord()` in `AbstractJsonRowRecordReader` and default to 
`nextRecord(true, true)`.
   
   Thanks for summarizing the options and highlighting this alternative 
approach @pvillard31.
   
   Based on your summary, I agree that changing the behavior of `nextRecord()` 
to set `dropUnknownFields` to `true` in `AbstractJsonRowRecordReader` seems 
like a better way forward.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to