blob: e67d702bbe7bc71a2d5a7f96241d211bab100a16 [file] [log] [blame]
Young-Seokbe353dd2014-05-22 20:30:45 -07001/*
2 * Description : Test that left-outer-join may use an available rtree index in index subtree.
3 * Issue : 730
4 * Expected Res : Success
5 * Date : 8th May 2014
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
12create type TwitterUserType as {
13screen_name: string,
14lang: string,
15friends_count: int32,
16statuses_count: int32,
17name: string,
18followers_count: int32
19}
20
21create type TweetMessageType as {
22tweetid: int64,
23user: TwitterUserType,
24sender_location: point?,
25send_time: datetime,
26referred_topics: {{ string }},
27message_text: string
28}
29
30create dataset TweetMessages(TweetMessageType) primary key tweetid;
31
32create index twmSndLocIx on TweetMessages(sender_location) type rtree;
33
34write output to nc1:"rttest/rtree-index-join_issue730.adm";
35
36for $t1 in dataset('TweetMessages')
37where $t1.send_time >= datetime('2011-06-18T14:10:17') and $t1.send_time < datetime('2011-06-18T15:10:17')
38let $n := create-circle($t1.sender_location, 5.0)
39return {
40"message": $t1.tweetid,
41"nearby-message": for $t2 in dataset('TweetMessages')
42 where spatial-intersect($t2.sender_location, $n)
43 return $t2.tweetid
44}