nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Thomsen <mikerthom...@gmail.com>
Subject Record API fails to pull nested record
Date Fri, 21 Jun 2019 12:12:15 GMT
I'm trying to fetch an nested record (schema is attached). Code and error
are below. When I step through it with a debugger, it looks like every
nested record is just a LinkedHashMap and not a MapRecord now.

RecordPath sourcePath =
recordPathCache.getCompiled("/associatedAddress/address");
RecordPathResult result = sourcePath.evaluate(record);
Optional<FieldValue> resultFV = result.getSelectedFields().findFirst();

Results in:

java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to
org.apache.nifi.serialization.record.Record

at
org.apache.nifi.record.path.paths.ChildFieldPath.getChild(ChildFieldPath.java:49)
at
org.apache.nifi.record.path.paths.ChildFieldPath.lambda$evaluate$0(ChildFieldPath.java:71)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Streams.java:405)
at
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at
org.apache.nifi.graph.mapping.GremlinCodeGenerator.lambda$generate$1(GremlinCodeGenerator.java:36)
at
java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at
java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message