Pierre Villard created NIFI-7930:
------------------------------------

             Summary: QueryRecord fails with RPATH on arrays
                 Key: NIFI-7930
                 URL: https://issues.apache.org/jira/browse/NIFI-7930
             Project: Apache NiFi
          Issue Type: Task
          Components: Extensions
            Reporter: Pierre Villard


When executing QueryRecord using a query with RPATH on arrays like the one 
provided in the additional details of the processor's configuration, it fails 
with the following stack trace:
{noformat}
2793 [pool-1-thread-1] ERROR org.apache.nifi.processors.standard.QueryRecord - 
QueryRecord[id=56b8b985-0609-4e52-9124-1bcbbbb8afab] Unable to query 
FlowFile[0,fields-value-name.json,465B] due to java.lang.ClassCastException: 
[Ljava.lang.Object; cannot be cast to java.util.List: 
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to 
java.util.List
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to 
java.util.List
        at Baz$1$1.moveNext(Unknown Source)
        at 
org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.<init>(Linq4j.java:675)
        at org.apache.calcite.linq4j.Linq4j.enumeratorIterator(Linq4j.java:95)
        at 
org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
        at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:82)
        at 
org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:184)
        at 
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:64)
        at 
org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:43)
        at 
org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:573)
        at 
org.apache.calcite.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:137)
        at 
org.apache.nifi.processors.standard.QueryRecord.query(QueryRecord.java:465)
        at 
org.apache.nifi.processors.standard.QueryRecord.onTrigger(QueryRecord.java:320)
        at 
org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
        at 
org.apache.nifi.util.StandardProcessorTestRunner$RunProcessor.call(StandardProcessorTestRunner.java:270)
        at 
org.apache.nifi.util.StandardProcessorTestRunner$RunProcessor.call(StandardProcessorTestRunner.java:264)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748) {noformat}
A unit test reproducing the issue is available here:

[https://github.com/pvillard31/nifi/commit/1016b4a540fab22bcad119e7ffe2363b99c07a0c]

I didn't get the time/opportunity to work on a fix for this.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to