[
https://issues.apache.org/jira/browse/NIFI-1234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15034768#comment-15034768
]
ASF GitHub Bot commented on NIFI-1234:
--------------------------------------
GitHub user apiri opened a pull request:
https://github.com/apache/nifi/pull/136
NIFI-1234 Correcting container functionality for single Avro records.
@joemeszaros Had a user open an issue concerning the processor's handling
of events with only one record. I agree that the functionality seems a bit odd
and was wondering if there was a specific case that would be missed should the
containerOption be the only item to dictate format.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apiri/incubator-nifi NIFI-1234
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/136.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #136
----
commit 4e07619fd48737b003361070a583330abd2e5d8b
Author: Aldrin Piri <[email protected]>
Date: 2015-12-01T22:38:46Z
NIFI-1234 Correcting container functionality for single Avro records.
----
> 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)