Re: [Dev] Siddhi long value comparison

2018-03-07 Thread Niveathika Rajendran
Hi Dinusha,

The reason for the above issue is that the '259200'  value, we get from
the multiplication exceeds the maximum value of the int datatype(
2,147,483,647).

As per the use case, since only the 30 in the multiplication needs to be
configured, you can use the following query,

*from democondition[ timediff > 30***8640l ]*
*select timediff, status*
*insert into finalStream;*

Best Regards,
Niveathika Rajendran



On Tue, Mar 6, 2018 at 2:13 PM, Dinusha Dissanayake 
wrote:

> Hi all,
>
> I came across with an issue regarding comparing a long value.
> My intention was to check if the time difference is greater that 30 days,
> and then insert the corresponding values to target stream.
>
> I tested this behavior with APIM Analytics 2.0.0.
>
> However I noticed an unusual behavior.
>
> I have mentioned an example stream below.
>
> *@Import('demoConditions:1.0.0')*
> *define stream democondition (timediff long, status bool);*
>
> *@Export('finalStream:1.0.0')*
> *define stream finalStream (timediff long, status bool);*
>
>
> *from democondition[timediff > 30*24*60*60*1000]*
> *select timediff, status*
> *insert into finalStream;*
>
> Ideally, If I give a value greater than 30*24*60*60*1000 only, values
> should be inserted into finalStream.
> However I observed even if I give 1 as timeDiff, the values in timeDiff
> and status get inserted into finalStream.
>
> When I check the validity of the execution plan through the admin console,
> it gets success.
> However I replaced the value 30*24*60*60*1000 with 259200 and it
> produces and error.
>
>
>
> However when I append the "l" add the end (259200l), it got worked.
> I tried to use the same with 30*24*60*60*1000 -> 30l*24l*60l*60l*1000l
> and I couldn't get it worked since it produce an error while validating the
> script.
>
> The reason I am using 30*24*60*60*1000 is because I want the value "30" to
> be configured. It should be changed using the template manager.
>
> Please advice on how should I get it into working?
>
> Thanks,
> DinushaD.
>
>
> --
> Dinusha Dissanayake
> Software Engineer
> WSO2 Inc
> Mobile: +94712939439 <+94%2071%20293%209439>
> 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Best Regards,
*Niveathika Rajendran,*
*Software Engineer.*
*Mobile : +94 077 903 7536*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Siddhi long value comparison

2018-03-06 Thread Dinusha Dissanayake
Hi all,

I came across with an issue regarding comparing a long value.
My intention was to check if the time difference is greater that 30 days,
and then insert the corresponding values to target stream.

I tested this behavior with APIM Analytics 2.0.0.

However I noticed an unusual behavior.

I have mentioned an example stream below.

*@Import('demoConditions:1.0.0')*
*define stream democondition (timediff long, status bool);*

*@Export('finalStream:1.0.0')*
*define stream finalStream (timediff long, status bool);*


*from democondition[timediff > 30*24*60*60*1000]*
*select timediff, status*
*insert into finalStream;*

Ideally, If I give a value greater than 30*24*60*60*1000 only, values
should be inserted into finalStream.
However I observed even if I give 1 as timeDiff, the values in timeDiff and
status get inserted into finalStream.

When I check the validity of the execution plan through the admin console,
it gets success.
However I replaced the value 30*24*60*60*1000 with 259200 and it
produces and error.



However when I append the "l" add the end (259200l), it got worked.
I tried to use the same with 30*24*60*60*1000 -> 30l*24l*60l*60l*1000l and
I couldn't get it worked since it produce an error while validating the
script.

The reason I am using 30*24*60*60*1000 is because I want the value "30" to
be configured. It should be changed using the template manager.

Please advice on how should I get it into working?

Thanks,
DinushaD.


-- 
Dinusha Dissanayake
Software Engineer
WSO2 Inc
Mobile: +94712939439 <+94%2071%20293%209439>

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev