nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aldrin Piri <aldrinp...@gmail.com>
Subject Re: EvaluateJsonPath error: Unable to return a scalar value for the expression
Date Mon, 16 Nov 2015 21:17:07 GMT
The documentation is a little unclear and light.  Made a ticket [1] to
clarify how these properties are interpreted.

Thanks!

[1] https://issues.apache.org/jira/browse/NIFI-1177

On Mon, Nov 16, 2015 at 3:52 PM, Sumanth Chinthagunta <xmlking@gmail.com>
wrote:

> Thanks Aldrin.
> it works after I changed Return Type to JSON.
>
> > On Nov 16, 2015, at 12:47 PM, Aldrin Piri <aldrinpiri@gmail.com> wrote:
> >
> > Sumo,
> >
> > The scalar option has the processor looking for the resultant value of
> the
> > expression to provide a non-Map/List representation of the targeted
> > expression.  In this case, if you change the property to json, it should
> > work as anticipated.  The property itself is more of a validation of the
> > data that is being extracted (in that it is an object/array or a simple
> > value).
> >
> > On Mon, Nov 16, 2015 at 3:20 PM, Sumanth Chinthagunta <xmlking@gmail.com
> >
> > wrote:
> >
> >> I am trying to extract data into   attribute using EvaluateJsonPath.
> when
> >> what JsonPath return complex type, I am getting error: Unable to return
> a
> >> scalar value for the expression $['data'] for FlowFile 152. Evaluated
> value
> >> was {id=1…..}. Transferring to failure
> >>
> >> data  -   $.data  <—  Error
> >> id  -  $.data.id   <— works
> >> {
> >>    "database": "test”,
> >>    "table": "guests”,
> >>    "type": "insert”,
> >>    "ts": 1446422524,
> >>    "xid": 1800,
> >>    "commit": true,
> >>    "data": {
> >>        "reg_date": "2015-11-02 00:02:04",
> >>        "firstname": "sumo",
> >>        "id": 1,
> >>        "lastname": "demo"
> >>    }
> >> }
> >>
> >> if it possible to extract JSON object from FlowFile using
> EvaluateJsonPath?
> >> if not please advice what options I have.
> >>
> >> Thanks
> >> Sumo
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
>
>

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