[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-c-dev
Subject:    Re: [Dev] [Siddhi] Partition with two attributes of same stream
From:       Gobinath <slgobinath () gmail ! com>
Date:       2017-09-28 19:23:38
Message-ID: CACzQGW64dik_Cj0biKZ7ydaZbdfjS=1680KD6p+SfudRC_3m9A () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you very much.
Your solution works.


Thanks & Regards,
Gobinath

On Thu, Sep 28, 2017 at 3:09 PM, Sriskandarajah Suhothayan <suho@wso2.com>
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 <slgobinath@gmail.com> 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  : slgobinath@gmail.com
>> Blog    : javahelps.com <http://www.javahelps.com/>
>>
>>
>
>
>
> --
>
> *S. Suhothayan*
> Associate Director / Architect
> *WSO2 Inc. *http://wso2.com
> * <http://wso2.com/>*
> lean . enterprise . middleware
>
>
> *cell: (+94) 779 756 757 <077%20975%206757> | 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>*
>



-- 
*Gobinath** Loganathan*
Graduate Student,
Electrical and Computer Engineering,
Western University.
Email  : slgobinath@gmail.com
Blog    : javahelps.com <http://www.javahelps.com/>

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:verdana,sans-serif">Thank you very much.<br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif">Your solution \
works.</div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Thanks &amp; Regards,</div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif">Gobinath<br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 28, 2017 at 3:09 PM, \
Sriskandarajah Suhothayan <span dir="ltr">&lt;<a href="mailto:suho@wso2.com" \
target="_blank">suho@wso2.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Apparently, it does not support multiple  \
attributes as partition keys.  <div>but you can use  </div><div><font \
face="monospace, monospace" color="#666666">partition with ( str: \
concat(srcIp,&#39;-&#39;, dstIp)  of PacketStream ) ...</font><br></div><div><br>or \
use a previous query to content and send as one data.<span \
style="color:rgb(102,102,102);font-family:monospace,monospace">  \
</span><br></div><div><span \
style="color:rgb(102,102,102);font-family:monospace,monospace">  \
</span></div><div><div><br><div class="gmail_extra"><div><div class="h5"><br><div \
class="gmail_quote">On Thu, Sep 28, 2017 at 10:41 PM, Gobinath <span dir="ltr">&lt;<a \
href="mailto:slgobinath@gmail.com" \
target="_blank">slgobinath@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
style="font-family:verdana,sans-serif">Hi,</div><div \
style="font-family:verdana,sans-serif"><br></div><div \
style="font-family:verdana,sans-serif">During my recent testing, Siddhi does not \
allow partition with two attributes of the same stream. For example, the following \
query throws <i>SiddhiAppValidationException</i> with a message partition already \
exists because the streamId is used to uniquely identify the partition \
[1].<br></div><div style="font-family:verdana,sans-serif"><br \
clear="all"></div><div><span style="color:rgb(102,102,102)"><span \
style="font-family:monospace,monospace">define stream PacketStream (srcIp string, \
dstIp string, packets int);<br><br>partition with (srcIp of PacketStream, dstIp of \
PacketStream)<br>begin<br>   from PacketStream<br>   select srcIp, dstIp, \
count(packets) as count<br>   insert into \
OutputStream;<br>end;</span></span><br></div><div><br></div><div>I wonder whether it \
is not supported due to any constraints. If there is nothing like that, I can have a \
look at it.</div><div><br></div><div>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.<br></div><div><br></div><div>[1] <a \
href="https://github.com/slgobinath/siddhi/blob/master/modules/siddhi-query-api/src/main/java/org/wso2/siddhi/query/api/execution/partition/Partition.java#L101" \
target="_blank">https://github.com/slgobinath/<wbr>siddhi/blob/master/modules/sid<wbr> \
dhi-query-api/src/main/java/or<wbr>g/wso2/siddhi/query/api/execut<wbr>ion/partition/Partition.java#<wbr>L101</a><br></div><div><br></div><div>Thanks \
&amp; Regards,</div><div>Gobinath<span \
class="m_209478269076453312gmail-m_-7748276394803492096HOEnZb"><font \
color="#888888"><br></font></span></div><span \
class="m_209478269076453312gmail-m_-7748276394803492096HOEnZb"><font \
color="#888888"><div><br></div>-- <br><div \
class="m_209478269076453312gmail-m_-7748276394803492096m_-2636851058177275035gmail_signature"><div \
dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><font size="1" face="verdana, \
sans-serif"><b><font color="#444444"><u>Gobinath</u></font></b></font><b \
style="font-family:verdana,sans-serif;font-size:x-small"><font color="#444444">  \
Loganathan</font></b></div><div dir="ltr"><div dir="ltr"><font size="1" \
face="verdana, sans-serif" color="#444444">Graduate Student,  </font></div><div \
dir="ltr"><font size="1" face="verdana, sans-serif" color="#444444">Electrical and \
Computer Engineering,</font></div><div dir="ltr"><font size="1" face="verdana, \
sans-serif" color="#444444">Western University.</font></div></div><div \
style="font-size:12.8px"><font size="1" face="verdana, sans-serif" \
color="#666666">Email   :  <a href="mailto:slgobinath@gmail.com" \
target="_blank">slgobinath@gmail.com</a></font></div><div dir="ltr" \
style="font-size:12.8px"><font size="1" face="verdana, sans-serif" \
color="#666666">Blog      :  <a href="http://www.javahelps.com/" \
target="_blank">javahelps.com</a><div \
style="display:inline-block;width:16px;height:16px">  \
</div></font></div></div></div></div></div></div></div></div></div></div> \
</font></span></div> </blockquote></div><br><br \
clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- \
<br><div class="m_209478269076453312gmail-m_-7748276394803492096gmail_signature"><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font color="#888888"><b><font \
size="2" face="trebuchet ms, sans-serif">S. \
Suhothayan</font><br></b></font><div><font size="1" face="trebuchet ms, sans-serif" \
color="#999999">Associate Director / Architect</font></div><font \
style="color:rgb(153,153,153)" size="2"> </font><div \
style="color:rgb(153,153,153)"><font size="1"><b><span \
style="font-weight:normal"><font face="trebuchet ms, sans-serif">WSO2 Inc. \
</font></span></b><span><span><font face="trebuchet ms, \
sans-serif"><span></span></font><a href="http://wso2.com/" target="_blank"><font \
face="trebuchet ms, sans-serif">http://wso2.com</font> \
</a></span></span></font><i><span style="font-size:x-small"><span \
style="font-size:small"><br><a href="http://wso2.com/" target="_blank"><span \
style="font-size:x-small"></span></a></span></span></i></div><font \
style="color:rgb(153,153,153)" size="1">lean . enterprise . middleware</font><font \
color="#888888"><span style="font-size:x-small"><span style="font-size:small"><span \
style="font-size:x-small"></span></span><br><br>

</span></font><font color="#888888"><div><i><font size="1">cell: <a \
href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 \
757</a> | blog: <a href="http://suhothayan.blogspot.com/" \
target="_blank">http://suhothayan.blogspot.com<wbr>/ </a><br>twitter: <a \
href="http://twitter.com/suhothayan" \
target="_blank">http://twitter.com/suhothayan</a> | linked-in: <a \
href="http://lk.linkedin.com/in/suhothayan" \
target="_blank">http://lk.linkedin.com/in/suho<wbr>thayan</a></font></i></div></font></div></div></div></div></div></div>
 </font></span></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
style="font-size:12.8px"><font face="verdana, sans-serif" size="1"><b><font \
color="#444444"><u>Gobinath</u></font></b></font><b \
style="font-family:verdana,sans-serif;font-size:x-small"><font color="#444444">  \
Loganathan</font></b></div><div dir="ltr"><div dir="ltr"><font face="verdana, \
sans-serif" size="1" color="#444444">Graduate Student,  </font></div><div \
dir="ltr"><font face="verdana, sans-serif" size="1" color="#444444">Electrical and \
Computer Engineering,</font></div><div dir="ltr"><font face="verdana, sans-serif" \
size="1" color="#444444">Western University.</font></div></div><div \
style="font-size:12.8px"><font face="verdana, sans-serif" color="#666666" \
size="1">Email   :  <a href="mailto:slgobinath@gmail.com" \
target="_blank">slgobinath@gmail.com</a></font></div><div dir="ltr" \
style="font-size:12.8px"><font face="verdana, sans-serif" color="#666666" \
size="1">Blog      :  <a href="http://www.javahelps.com/" \
target="_blank">javahelps.com</a><div \
style="display:inline-block;width:16px;height:16px">  \
</div></font></div></div></div></div></div></div></div></div></div></div> </div>



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic