Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 1 | /* |
Steven Glenn Jacobs | 3982604 | 2017-03-28 20:28:27 -0700 | [diff] [blame] | 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | /* |
| 20 | * Description : Check the Plan for Subscribing to a channel |
Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 21 | * Expected Res : Success |
| 22 | * Date : Mar 2015 |
| 23 | */ |
| 24 | |
Steven Glenn Jacobs | d0ec837 | 2016-12-07 11:00:08 -0800 | [diff] [blame] | 25 | drop dataverse channels2 if exists; |
| 26 | create dataverse channels2; |
Steven Glenn Jacobs | 5551404 | 2017-04-19 15:54:13 -0700 | [diff] [blame^] | 27 | use channels2; |
Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 28 | |
| 29 | create type TweetMessageTypeuuid as closed { |
| 30 | tweetid: uuid, |
Steven Glenn Jacobs | 5551404 | 2017-04-19 15:54:13 -0700 | [diff] [blame^] | 31 | sender_location: point, |
| 32 | send_time: datetime, |
| 33 | referred_topics: {{ string }}, |
| 34 | message_text: string, |
Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 35 | countA: int32, |
| 36 | countB: int32 |
| 37 | } |
| 38 | |
| 39 | |
| 40 | create dataset TweetMessageuuids(TweetMessageTypeuuid) |
| 41 | primary key tweetid autogenerated; |
| 42 | |
Steven Glenn Jacobs | 5551404 | 2017-04-19 15:54:13 -0700 | [diff] [blame^] | 43 | create function NearbyTweetsContainingText(place, text) { |
| 44 | (select m.message_text |
| 45 | from TweetMessageuuids m |
| 46 | where contains(m.message_text,text) |
| 47 | and spatial_intersect(m.sender_location, place)) |
Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M"); |
| 51 | |
Steven Glenn Jacobs | 5551404 | 2017-04-19 15:54:13 -0700 | [diff] [blame^] | 52 | write output to nc1:"rttest/channel-subscribe.sqlpp"; |
Steven Glenn Jacobs | 409c3e7 | 2016-09-14 11:32:13 -0700 | [diff] [blame] | 53 | |
| 54 | create broker brokerA at "http://www.hello.com"; |
| 55 | |
Steven Glenn Jacobs | 5551404 | 2017-04-19 15:54:13 -0700 | [diff] [blame^] | 56 | subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA; |