blob: 682bd6d0454687c00e40eb0c259d68dc5f3e3a82 [file] [log] [blame]
Steven Glenn Jacobs409c3e72016-09-14 11:32:13 -07001/*
2 * Description : Check the Plan for Subscribing to a channel
3 * Expected Res : Success
4 * Date : Mar 2015
5 */
6
7drop dataverse channels if exists;
8create dataverse channels;
9use dataverse channels;
10
11
12create type TweetMessageTypeuuid as closed {
13 tweetid: uuid,
14 sender-location: point,
15 send-time: datetime,
16 referred-topics: {{ string }},
17 message-text: string,
18 countA: int32,
19 countB: int32
20}
21
22
23create dataset TweetMessageuuids(TweetMessageTypeuuid)
24primary key tweetid autogenerated;
25
26create function NearbyTweetsContainingText($location, $text) {
27 for $tweet in dataset TweetMessageuuids
28 let $circle := create-circle($location,30.0)
29 where contains($tweet.message-text,$text)
30 and spatial-intersect($tweet.sender-location, $location)
31 return $tweet.message-text
32};
33
34create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
35
36write output to nc1:"rttest/channel-subscribe.adm";
37
38create broker brokerA at "http://www.hello.com";
39
40subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA;