Re: [Dev] [Siddhi] Partition with two attributes of same stream

2017-09-28 Thread Gobinath
Thank you very much.
Your solution works.


Thanks & Regards,
Gobinath

On Thu, Sep 28, 2017 at 3:09 PM, Sriskandarajah Suhothayan 
wrote:

> Apparently, it does not support multiple attributes as partition keys.
> but you can use
> partition with ( str: concat(srcIp,'-', dstIp) of PacketStream ) ...
>
> or use a previous query to content and send as one data.
>
>
>
> On Thu, Sep 28, 2017 at 10:41 PM, Gobinath  wrote:
>
>> Hi,
>>
>> During my recent testing, Siddhi does not allow partition with two
>> attributes of the same stream. For example, the following query throws
>> *SiddhiAppValidationException* with a message partition already exists
>> because the streamId is used to uniquely identify the partition [1].
>>
>> define stream PacketStream (srcIp string, dstIp string, packets int);
>>
>> partition with (srcIp of PacketStream, dstIp of PacketStream)
>> begin
>>   from PacketStream
>>   select srcIp, dstIp, count(packets) as count
>>   insert into OutputStream;
>> end;
>>
>> I wonder whether it is not supported due to any constraints. If there is
>> nothing like that, I can have a look at it.
>>
>> FYI: I tried to change the partition id as a combination of stream id and
>> the attribute name but it does not register a PartitionReceiver for the
>> later one.
>>
>> [1] https://github.com/slgobinath/siddhi/blob/master/modules/sid
>> dhi-query-api/src/main/java/org/wso2/siddhi/query/api/execut
>> ion/partition/Partition.java#L101
>>
>> Thanks & Regards,
>> Gobinath
>>
>> --
>> *Gobinath** Loganathan*
>> Graduate Student,
>> Electrical and Computer Engineering,
>> Western University.
>> Email  : slgobin...@gmail.com
>> Blog: javahelps.com 
>>
>>
>
>
>
> --
>
> *S. Suhothayan*
> Associate Director / Architect
> *WSO2 Inc. *http://wso2.com
> * *
> lean . enterprise . middleware
>
>
> *cell: (+94) 779 756 757 <077%20975%206757> | blog:
> http://suhothayan.blogspot.com/ twitter:
> http://twitter.com/suhothayan  | linked-in:
> http://lk.linkedin.com/in/suhothayan *
>



-- 
*Gobinath** Loganathan*
Graduate Student,
Electrical and Computer Engineering,
Western University.
Email  : slgobin...@gmail.com
Blog: javahelps.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Siddhi] Partition with two attributes of same stream

2017-09-28 Thread Sriskandarajah Suhothayan
Apparently, it does not support multiple attributes as partition keys.
but you can use
partition with ( str: concat(srcIp,'-', dstIp) of PacketStream ) ...

or use a previous query to content and send as one data.



On Thu, Sep 28, 2017 at 10:41 PM, Gobinath  wrote:

> Hi,
>
> During my recent testing, Siddhi does not allow partition with two
> attributes of the same stream. For example, the following query throws
> *SiddhiAppValidationException* with a message partition already exists
> because the streamId is used to uniquely identify the partition [1].
>
> define stream PacketStream (srcIp string, dstIp string, packets int);
>
> partition with (srcIp of PacketStream, dstIp of PacketStream)
> begin
>   from PacketStream
>   select srcIp, dstIp, count(packets) as count
>   insert into OutputStream;
> end;
>
> I wonder whether it is not supported due to any constraints. If there is
> nothing like that, I can have a look at it.
>
> FYI: I tried to change the partition id as a combination of stream id and
> the attribute name but it does not register a PartitionReceiver for the
> later one.
>
> [1] https://github.com/slgobinath/siddhi/blob/master/modules/sid
> dhi-query-api/src/main/java/org/wso2/siddhi/query/api/
> execution/partition/Partition.java#L101
>
> Thanks & Regards,
> Gobinath
>
> --
> *Gobinath** Loganathan*
> Graduate Student,
> Electrical and Computer Engineering,
> Western University.
> Email  : slgobin...@gmail.com
> Blog: javahelps.com 
>
>



-- 

*S. Suhothayan*
Associate Director / Architect
*WSO2 Inc. *http://wso2.com
* *
lean . enterprise . middleware


*cell: (+94) 779 756 757 <077%20975%206757> | blog:
http://suhothayan.blogspot.com/ twitter:
http://twitter.com/suhothayan  | linked-in:
http://lk.linkedin.com/in/suhothayan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [Siddhi] Partition with two attributes of same stream

2017-09-28 Thread Gobinath
Hi,

During my recent testing, Siddhi does not allow partition with two
attributes of the same stream. For example, the following query throws
*SiddhiAppValidationException* with a message partition already exists
because the streamId is used to uniquely identify the partition [1].

define stream PacketStream (srcIp string, dstIp string, packets int);

partition with (srcIp of PacketStream, dstIp of PacketStream)
begin
  from PacketStream
  select srcIp, dstIp, count(packets) as count
  insert into OutputStream;
end;

I wonder whether it is not supported due to any constraints. If there is
nothing like that, I can have a look at it.

FYI: I tried to change the partition id as a combination of stream id and
the attribute name but it does not register a PartitionReceiver for the
later one.

[1]
https://github.com/slgobinath/siddhi/blob/master/modules/siddhi-query-api/src/main/java/org/wso2/siddhi/query/api/execution/partition/Partition.java#L101

Thanks & Regards,
Gobinath

-- 
*Gobinath** Loganathan*
Graduate Student,
Electrical and Computer Engineering,
Western University.
Email  : slgobin...@gmail.com
Blog: javahelps.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev