blob: 8bf6dbb8cee3448a7c7f28fa3128277ae92e9724 [file] [log] [blame]
Young-Seokbe353dd2014-05-22 20:30:45 -07001/*
Ian Maxon857dc132015-09-25 17:13:19 -07002 * 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/*
Young-Seokbe353dd2014-05-22 20:30:45 -070020 * Description : Test that left-outer-join may use an available rtree index in index subtree.
21 * Issue : 730
22 * Expected Res : Success
23 * Date : 8th May 2014
24 */
25
26drop dataverse test if exists;
27create dataverse test;
28use dataverse test;
29
30create type TwitterUserType as {
31screen_name: string,
32lang: string,
33friends_count: int32,
34statuses_count: int32,
35name: string,
36followers_count: int32
37}
38
39create type TweetMessageType as {
40tweetid: int64,
41user: TwitterUserType,
42sender_location: point?,
43send_time: datetime,
44referred_topics: {{ string }},
45message_text: string
46}
47
48create dataset TweetMessages(TweetMessageType) primary key tweetid;
49
50create index twmSndLocIx on TweetMessages(sender_location) type rtree;
51
52write output to nc1:"rttest/rtree-index-join_issue730.adm";
53
54for $t1 in dataset('TweetMessages')
55where $t1.send_time >= datetime('2011-06-18T14:10:17') and $t1.send_time < datetime('2011-06-18T15:10:17')
56let $n := create-circle($t1.sender_location, 5.0)
57return {
58"message": $t1.tweetid,
59"nearby-message": for $t2 in dataset('TweetMessages')
60 where spatial-intersect($t2.sender_location, $n)
61 return $t2.tweetid
Ian Maxon857dc132015-09-25 17:13:19 -070062}