I think this can be achieved using
https://docs.wso2.com/display/CEP400/Inbuilt+Windows#InbuiltWindows-sortsort

As this will collect sort and output the max or min value.

Suho

On Thu, Sep 24, 2015 at 9:58 PM, Maheshakya Wijewardena <[email protected]
> wrote:

> An approach to do this is: first group by each result, then order by the
>> descending order of the count of each result and finally retrieving the
>> first entry from that.
>>
>
> Sorry, the approach should be as follows:
> First group by result, then order by the descending order of the count of
> each result and finally retrieving the first entry from that.
>
> On Thu, Sep 24, 2015 at 9:50 PM, Maheshakya Wijewardena <
> [email protected]> wrote:
>
>> Hi Lasantha,
>>
>> Thank you for the references.
>>
>> What I want to is something similar to the following:
>>
>> Suppose you have an input stream and there are multiple number of
>> processing logics. Each logic will generate a result after consuming the
>> events the stream. What I'm trying to do is obtaining the most frequent
>> outcome out of these multiple processing logics. i.e. what result has been
>> produced most.
>>
>> An approach to do this is: first group by each result, then order by the
>> descending order of the count of each result and finally retrieving the
>> first entry from that.
>>
>> I was wondering whether this type of task can be done with Siddhi.
>>
>>
>> Best regards.
>>
>> On Thu, Sep 24, 2015 at 8:34 PM, Lasantha Fernando <[email protected]>
>> wrote:
>>
>>> Hi Maheshakya,
>>>
>>> Ordering of events for real-time analytics need to be done within a time
>>> frame or an event frame. Siddhi does have a sort window processor that can
>>> be used to sort events within the window itself.
>>>
>>> You can find the documentation at [1] or refer to our test cases at [2].
>>> If you can describe your use case in more detail, we might be able to point
>>> you to some constructs in Siddhi language that would let you achieve the
>>> 'order by' characteristics of a standard SQL query.
>>>
>>> [1]
>>> https://docs.wso2.com/display/CEP400/Inbuilt+Windows#InbuiltWindows-sortsort
>>> [2]
>>> https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/test/java/org/wso2/siddhi/core/query/window/SortWindowTestCase.java
>>>
>>> Thanks,
>>> Lasantha
>>>
>>> On 24 September 2015 at 18:13, Maheshakya Wijewardena <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Does SiddhiQL support "ORDER BY" statement? I couldn't find that in the
>>>> documentation[1].
>>>>
>>>> Best regards,
>>>>
>>>> [1] https://docs.wso2.com/display/CEP400/SiddhiQL+Guide+3.0
>>>>
>>>> --
>>>> Pruthuvi Maheshakya Wijewardena
>>>> Software Engineer
>>>> WSO2 : http://wso2.com/
>>>> Email: [email protected]
>>>> Mobile: +94711228855
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> *Lasantha Fernando*
>>> Senior Software Engineer - Data Technologies Team
>>> WSO2 Inc. http://wso2.com
>>>
>>> email: [email protected]
>>> mobile: (+94) 71 5247551
>>>
>>
>>
>>
>> --
>> Pruthuvi Maheshakya Wijewardena
>> Software Engineer
>> WSO2 : http://wso2.com/
>> Email: [email protected]
>> Mobile: +94711228855
>>
>>
>>
>
>
> --
> Pruthuvi Maheshakya Wijewardena
> Software Engineer
> WSO2 : http://wso2.com/
> Email: [email protected]
> Mobile: +94711228855
>
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*S. Suhothayan*
Technical Lead & Team Lead of WSO2 Complex Event Processor
*WSO2 Inc. *http://wso2.com
* <http://wso2.com/>*
lean . enterprise . middleware


*cell: (+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
<http://suhothayan.blogspot.com/>twitter: http://twitter.com/suhothayan
<http://twitter.com/suhothayan> | linked-in:
http://lk.linkedin.com/in/suhothayan <http://lk.linkedin.com/in/suhothayan>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to