Hi Yogi,

This is something that needs to be fixed in Filter operator. I see at line
130 in filter operator that the expected return type is Boolean.class.. I
think it should be boolean.class, unless there was some other reason why it
was made like that.

I would prefer not to add implicit pair of parentheses in PojoUtils as the
auto-boxing affects performance.

- Chinmay.



On Fri, Jul 15, 2016 at 5:52 PM, Yogi Devendra <[email protected]>
wrote:

> Hi,
>
> I am working on creating example app
> for com.datatorrent.lib.filter.FilterOperator
> For condition property, I gave following value:
> {$}.getAmount() >= 20000
>
> This gives following exception:
> java.lang.RuntimeException: org.codehaus.commons.compiler.CompileException:
> Line 1, Column 29: Cannot cast "double" to "java.lang.Boolean"
> at com.datatorrent.lib.util.PojoUtils.compileExpression(PojoUtils.java:778)
> at com.datatorrent.lib.util.PojoUtils.createExpression(PojoUtils.java:741)
> at com.datatorrent.lib.util.PojoUtils.createExpression(PojoUtils.java:719)
> at
>
> com.datatorrent.lib.filter.FilterOperator.createExpression(FilterOperator.java:130)
>
> When I change property to :
> ({$}.getAmount() >= 20000)
>
> It works smoothly.
>
> This does not look user intuitive.
>
> Question: How about adding extra pair of parentheses at
> PojoUtils.createExpression(PojoUtils.java:719)?
>
> ~ Yogi
>

Reply via email to