You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Burgess (Jira)" <ji...@apache.org> on 2022/06/20 18:14:00 UTC

[jira] [Commented] (NIFI-5005) MergeRecord processor ignoring writer schema for JsonRecordSetWriter output

    [ https://issues.apache.org/jira/browse/NIFI-5005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17556492#comment-17556492 ] 

Matt Burgess commented on NIFI-5005:
------------------------------------

Turns out MergeRecord ignores the writer's schema (in terms of names, types, presence/absence of fields) and just uses the reader's schema to get the fields and their types.

> MergeRecord processor ignoring writer schema for JsonRecordSetWriter output
> ---------------------------------------------------------------------------
>
>                 Key: NIFI-5005
>                 URL: https://issues.apache.org/jira/browse/NIFI-5005
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.5.0
>            Reporter: Nick Pettyjohn
>            Priority: Major
>         Attachments: MergeContent_JsonOutput.xml, test.csv, test_schema.avsc
>
>
> Issue noticed when using a MergeRecord processor with a Record Reader of CSVReader and a Record Writer of JsonRecordSetWriter.
> The CSVReader is configured with a Schema Access Strategy of "Use String Fields From Header". The JsonRecordSetWriter is given an Avro schema in the Schema Text property that contains a mix of string, double, and long value types.
> Running sample csv data through the MergeRecord processor produces JSON in which all values are quoted, despite the Avro schema specifying otherwise. However, when using the ConvertRecord processor with the same Reader/Writer config, the output JSON records use the typing given in the avro schema, keeping long and float values unquoted.
> The attached template, with corresponding avro schema and sample input csv file will demonstrate the issue.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)