[
https://issues.apache.org/jira/browse/NIFI-8148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283333#comment-17283333
]
Mark Payne commented on NIFI-8148:
----------------------------------
[~jsizzle] I can't say for certain, as I don't have those logs anymore, but it
should be very simple to reproduce, as it looks like you have.
Looking at this again briefly, I stated that it should result in two records,
each having a single String field named 'zip'. But perhaps it should consist of
a single Record, having a field named 'zip' that is an array of strings. Either
of those seems reasonable to me. Not sure if there's a more 'correct' answer.
But it's something we should probably document well either way.
> Selecting field from array with QueryRecord routes to failure
> -------------------------------------------------------------
>
> Key: NIFI-8148
> URL: https://issues.apache.org/jira/browse/NIFI-8148
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Jon Kessler
> Priority: Major
>
> Given the following JSON document coming into QueryRecord:
> {{ {}}
> {{ "name": "John Doe",}}
> {{ "try": [}}
> {{ {}}
> {{ "workAddress": {}}
> {{ "number": "123",}}
> {{ "street": "5th Avenue",}}
> {{ "city": "New York",}}
> {{ "state": "NY",}}
> {{ "zip": "10020"}}
> {{ },}}
> {{ "homeAddress": {}}
> {{ "number": "456",}}
> {{ "street": "116th Avenue",}}
> {{ "city": "New York",}}
> {{ "state": "NY",}}
> {{ "zip": "11697"}}
> {{ }}}
> {{ }}}
> {{ ]}}
> {{}}}
> When using a JSON Reader (inferred schema) and JSON Writer (inherit record
> schema), we should be able to use the query:
> SELECT RPATH(try, '/*/zip') AS zip
> FROM FLOWFILE
> The result should be two records, each consisting of a single field named
> 'zip' that is of type String.
> Currently, it throws an Exception and routes to failure.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)