You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Jon Kessler (Jira)" <ji...@apache.org> on 2021/02/10 16:34:00 UTC

[jira] [Commented] (NIFI-8148) Selecting field from array with QueryRecord routes to failure

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

Jon Kessler commented on NIFI-8148:
-----------------------------------

[~markap14], will you please confirm that this is the exception you saw so that I know I'm on the right track?


60867 [pool-1-thread-1] ERROR org.apache.nifi.processors.standard.QueryRecord - QueryRecord[id=56c7553f-f299-4e5d-b0fc-a2fc6b2a99f7] Failed to write MapRecord[\{zip=[Ljava.lang.Object;@6de8ce3c}] with schema ["zip" : "RECORD"] as a JSON Object due to org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [[Ljava.lang.Object;@6de8ce3c] of type class [Ljava.lang.Object; to Record for field zip: org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [[Ljava.lang.Object;@6de8ce3c] of type class [Ljava.lang.Object; to Record for field zip
org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [[Ljava.lang.Object;@6de8ce3c] of type class [Ljava.lang.Object; to Record for field zip
    at org.apache.nifi.serialization.record.util.DataTypeUtils.toRecord(DataTypeUtils.java:398)
    at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:219)
     at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:171)
     at org.apache.nifi.json.WriteJsonResult.writeValue(WriteJsonResult.java:327)
     at org.apache.nifi.json.WriteJsonResult.writeRecord(WriteJsonResult.java:199)
     at org.apache.nifi.json.WriteJsonResult.writeRecord(WriteJsonResult.java:148)
     at org.apache.nifi.serialization.AbstractRecordSetWriter.write(AbstractRecordSetWriter.java:59)
     at org.apache.nifi.serialization.AbstractRecordSetWriter.write(AbstractRecordSetWriter.java:52)
     at org.apache.nifi.processors.standard.QueryRecord$1.process(QueryRecord.java:347)
....

 

> 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)