I tried creating a plan using the example provided in this link Create execution Plan but I get the following error.
Stream OutStats is already defined as StreamDefinition{streamId='OutStats', attributeList=[Attribute{name='meta_ip', type=STRING}, Attribute{name='userName', type=STRING}, Attribute{name='requestCount', type=LONG}]}, hence cannot define StreamDefinition{streamId='OutStats', attributeList=[Attribute{name='meta_ip', type=STRING}, Attribute{name='userName', type=STRING}, Attribute{name='searchKey', type=STRING}]}
If I change the insert into part of the query to some other name it works fine,but I'm worried it might create problems if the exported stream name and insert into aren't the same. I created both org.foo.data.search.stats and org.foo.data.out.stats before creating the execution plan. Is this a bug or am I doing something wrong? Also their own test case also gives the same error. Link : EventFlowTestCase
In the first stream you have Attribute{name='requestCount', type=LONG} and in the second stream Attribute{name='searchKey', type=STRING}.
This error in your situation means that "The 4-th attribute in defined stream is not the same as 4-th attribute in input/output/other etc. stream".
Remeber, name, type and order does matter.