Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Description : Check the Plan for Subscribing to a channel |
| 3 | * Expected Res : Success |
| 4 | * Date : Mar 2015 |
| 5 | */ |
| 6 | |
| 7 | drop dataverse channels if exists; |
| 8 | create dataverse channels; |
| 9 | use dataverse channels; |
| 10 | |
| 11 | |
| 12 | create 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 | |
| 23 | create dataset TweetMessageuuids(TweetMessageTypeuuid) |
| 24 | primary key tweetid autogenerated; |
| 25 | |
| 26 | create 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 | |
| 34 | create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M"); |
| 35 | |
| 36 | write output to nc1:"rttest/channel-subscribe.adm"; |
| 37 | |
| 38 | create broker brokerA at "http://www.hello.com"; |
| 39 | |
| 40 | subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA; |