+ dev list
Hi Yasara,
Your test table definition defines rank as int. But in your query
'math:ln(2*retweet_count+favorite_count )-(time:dateDiff
(time:currentTimestamp(),created_at))*2 as rank' returns a double. So query
tries to create another 'test' definition which result in this error.
That's why your exception says
Different definition same as output stream definition
:StreamDefinition{id='test', attributeList=[Attribute{id='rank', type=
*DOUBLE*}, Attribute{id='text', type=STRING}], annotations=[]} already
exist as:TableDefinition{id='test', attributeList=[Attribute{id='rank',
type=*INT*}, Attribute{id='text', type=STRING}],
Tishan
On Sat, Nov 7, 2015 at 11:49 PM, Yasara Dissanayake <[email protected]> wrote:
> I'm trying to write following query in CEP:
>
> @Import('tweet:1.0.0')
> define stream TwStream (text string, hashTags string, favorite_count int,
> retweet_count int, id double, created_at string);
>
> @From(eventtable='rdbms', datasource.name='TwDB', table.name='test')
> define table test(rank int, text string);
>
> from TwStream
> select math:ln(2*retweet_count+favorite_count )-(time:dateDiff
> (time:currentTimestamp(),created_at))*2 as rank,text
> insert into test;
>
> But I got this error :
> Different definition same as output stream definition
> :StreamDefinition{id='test', attributeList=[Attribute{id='rank',
> type=DOUBLE}, Attribute{id='text', type=STRING}], annotations=[]} already
> exist as:TableDefinition{id='test', attributeList=[Attribute{id='rank',
> type=INT}, Attribute{id='text', type=STRING}],
> annotations=[Annotation{name='From', elements=[Element{key='eventtable',
> value='rdbms'}, Element{key='datasource.name', value='TwDB'},
> Element{key='table.name', value='test'}]}]} in execution plan
> "ExecutionPlan2"
>
> How can I avoid that ?
>
--
Tishan Dahanayakage
Software Engineer
WSO2, Inc.
Mobile:+94 716481328
Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
re-transmit, disseminate, or otherwise use the information contained in
this communication. Internet communications cannot be guaranteed to be
timely, secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev