Support Questions

Find answers, ask questions, and share your expertise

Read Avro record for the QueryRecord processor

avatar
Contributor

83389-flow.png

Hey there,

I'm trying to query an Avro record with the QueryRecord processor. The Avro gets created with a ExecuteSQL processor. The output of the ExecuteSQL seems fine and I can convert it in e.g. JSON without any problems. But when I try to query it I get a NullPointerException. Anyone able to help me with the problem?

QueryRecord

queryrecord.png

AvroReader

avroreader.png

AvroRecordSetWriter

avrorecordsetwriter.png

Exception in the QueryRecord processor

2018-07-24 14:27:37,277 ERROR [Timer-Driven Process Thread-4] o.a.nifi.processors.standard.QueryRecord QueryRecord[id=ac799474-0164-1000-ffff-ffffc83bf6e1] Unable to query StandardFlowFileRecord[uuid=78d37332-b122-4433-b16d-099757d8d839,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1532435241579-3, container=default, section=3], offset=0, length=108732158],offset=0,name=6117269883610207,size=108732158] due to java.lang.NullPointerException: {}
java.lang.NullPointerException: null
        at Baz$5$1.current(Unknown Source)
        at org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.next(Linq4j.java:672)
        at org.apache.calcite.avatica.util.IteratorCursor.next(IteratorCursor.java:46)
        at org.apache.calcite.avatica.AvaticaResultSet.next(AvaticaResultSet.java:227)
        at org.apache.nifi.serialization.record.ResultSetRecordSet.<init>(ResultSetRecordSet.java:51)
        at org.apache.nifi.processors.standard.QueryRecord$1.process(QueryRecord.java:313)
        at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2571)
        at org.apache.nifi.processors.standard.QueryRecord.onTrigger(QueryRecord.java:306)
        at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
        at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1124)
        at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
        at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
        at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:128)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
1 ACCEPTED SOLUTION

avatar
Contributor

Seems like a error in the SQL statement threw the NullPointerException. Not really the place I would have looked with this kind of error.

View solution in original post

1 REPLY 1

avatar
Contributor

Seems like a error in the SQL statement threw the NullPointerException. Not really the place I would have looked with this kind of error.