blob: 1cbdb607001d135a2a17d8c0a201b556e189e536 [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 inverted index in index subtree.
21 * Issue : 741
22 * Expected Res : Success
23 * Date : 16th 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 topicIIx on TweetMessages(referred_topics) type keyword;
51
52write output to nc1:"rttest/inverted-index-join_issue741.adm";
53
54for $t in dataset('TweetMessages')
55where $t.send_time >= datetime('2011-06-18T14:10:17')
56and
57$t.send_time < datetime('2011-06-18T15:10:17')
58return {
59 "tweet": $t.tweetid,
60 "similar-tweets": for $t2 in dataset('TweetMessages')
61 let $sim := similarity-jaccard-check($t.referred_topics, $t2.referred_topics, 0.6f)
62 where $sim[0] and
63 $t2.tweetid != $t.tweetid
64 return $t2.tweetid
Ian Maxon857dc132015-09-25 17:13:19 -070065}