| * Description : This test case is to verify the fix for issue838 |
| * https://code.google.com/p/asterixdb/issues/detail?id=838 |
| drop dataverse twitter if exists; |
| create dataverse twitter; |
| create type TweetMessageType as closed { |
| create type TweetHistorySubscription as open{ |
| create dataset TweetHistorySubscriptions(TweetHistorySubscription) |
| primary key subscription-id; |
| create index testa on TweetHistorySubscriptions(location) type rtree; |
| create dataset TweetMessages(TweetMessageType) |
| create index locationIdx on TweetMessages(sender-location) type rtree; |
| write output to nc1:"rttest/query-issue838.adm"; |
| for $sub in dataset TweetHistorySubscriptions |
| let $location := $sub.location |
| for $tweet in dataset TweetMessages |
| let $circle := create-circle($location,30.0) |
| where spatial-intersect($tweet.sender-location, $circle) |
| "subscription-id":$sub.subscription-id, |
| "execution-time":current-datetime(), |