[
https://issues.apache.org/jira/browse/NIFI-1234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15035926#comment-15035926
]
ASF GitHub Bot commented on NIFI-1234:
--------------------------------------
Github user trkurc commented on the pull request:
https://github.com/apache/nifi/pull/136#issuecomment-161325906
So, some evidence that this was intentional.
1) it is *harder* to handle the single record case without arrays.
@markap14 appears to have contributed this as part of NIFI-855 (even though
@joemeszaros added the comments and was the last to touch these lines of code)
2) the processor description clearly states it has different behavior with
multiple records
3) It makes sense to me that if you were administering a flow that only
ever had a single avro record per flow file, you would NOT want it inside an
array
I believe 3 is a valid use case, and this change may break flows. I highly
recommend adding a flag to preserve this behavior. I explained more in jira
(https://issues.apache.org/jira/browse/NIFI-1234)
> Inconsistent container behavior in ConvertAvroToJSON
> ----------------------------------------------------
>
> Key: NIFI-1234
> URL: https://issues.apache.org/jira/browse/NIFI-1234
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 0.4.0
> Reporter: Douglas Doughty
> Assignee: Aldrin Piri
> Priority: Minor
>
> ConvertAvroToJSON has 2 container options: array and none.
> When set to 'array', usage dictates an "array of objects" should be produced.
> But, if only a single Avro record is passed in, an array is not created--a
> JSON object is created.
> I believe it should be wrapped in an array. This caused errors when chained
> with SplitJSON (which expects an array).
> Use case scenario: ExecuteSQL returns an unknown number of results ->
> ConvertAvroToJSON -> SplitJSON. If ExecuteSQL returns 1 result, then the
> operation fails.
> Work around: Set up a failure relationship between SplitJSON and the next
> processor--the object will be forwarded, but an error will be logged on the
> SplitJSON processor.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)