nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff <jtsw...@gmail.com>
Subject Re: Can't Chain "count()" with "plus()"
Date Tue, 23 Aug 2016 19:00:23 GMT
Paul,

Also, the table of examples shows the results of the example expressions
that use the allDelinatedValues function in conjunction with function
chaining, not the result of the allDelineatedValues function itself, in
which case the types and values shown for each example are correct.

On Tue, Aug 23, 2016 at 2:53 PM Jeff <jtswork@gmail.com> wrote:

> Paul,
>
> I refer you to the documentation for count[1], which states: "Aggregate
> function that counts the number of non-null, non-false values returned"
>
> [1]
> https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#count
>
> On Tue, Aug 23, 2016 at 2:37 PM Paul Nahay <pnahay@sprynet.com> wrote:
>
>> Thanks.
>>
>> However, your documentation is lacking, because in your documentation for
>> "allDelineatedValues", there is nothing that explains how ":count()" can be
>> applied to:
>> *Return Type*: Boolean
>> meaning, how ":count()" can be applied to each boolean separately to
>> produce a "4".
>>
>> Yes, I understand what it's doing, but your documentation doesn't explain
>> what it needs to. If this is true:
>>
>> *Return Type*: Boolean
>>
>> then your table with examples with "Value" in the right-hand column
>> should have only booleans, not the integer 4 in it.
>>
>> Paul
>>
>> -----Original Message-----
>> From: Jeff
>> Sent: Aug 23, 2016 1:00 PM
>> To: Paul Nahay , "dev@nifi.apache.org"
>> Subject: Re: Can't Chain "count()" with "plus()"
>>
>> Hello Paul,
>>
>> The documentation for allDelineatedValues[1] states that each of the
>> resulting values are evaluated against the rest of the Expression.  You
>> need to use an embedded expression, since you don't want the plus function
>> to be evaluated against each split from allDelineatedValues.  Try this
>> slightly more complex expression:
>>
>> ${literal(${allDelineatedValues("aaa,bbb,ccc",","):count()}):plus(1)}
>>
>> [1]
>> https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#alldelineatedvalues
>>
>> On Tue, Aug 23, 2016 at 12:21 PM Paul Nahay <pnahay@sprynet.com> wrote:
>>
>>> The following NiFi Expression Language construct gives me an error, and
>>> I don't understand why:
>>>
>>> ${allDelineatedValues("aaa,bbb,ccc",","):count():plus(1)}
>>>
>>> It's fine without the ":plus(1)", but fails with it, with this error:
>>>
>>> AttributeExpressionLanguageException:
>>> Cannot evaluate Expression because it attempts to reference multiple
>>> attributes but does not use a reducing function
>>>
>>> (I am typing the error message above)
>>>
>>> It would seem like I should be able to add 1 to a count.
>>>
>>> It's NiFi version 0.6.1.c
>>>
>>>
>>> Paul Nahay
>>> 1013 Rosemere Ave.
>>> Silver Spring, MD 20904-3008
>>> 301-680-3825 (home)
>>> 301-806-9265 (cell)
>>> pnahay@sprynet.com
>>>
>>
>> Paul Nahay
>> 1013 Rosemere Ave.
>> Silver Spring, MD 20904-3008
>> 301-680-3825 (home)
>> 301-806-9265 (cell)pnahay@sprynet.com
>>
>>
>>
>>

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