blob: 7402ec9bbf9236fb424b9f7ccb5899c57da9eea6 [file] [log] [blame]
Young-Seokbe353dd2014-05-22 20:30:45 -07001/*
2 * Description : Test that left-outer-join may use an available inverted index in index subtree.
3 * Issue : 741
4 * Expected Res : Success
5 * Date : 16th 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 topicIIx on TweetMessages(referred_topics) type keyword;
33
34write output to nc1:"rttest/inverted-index-join_issue741.adm";
35
36for $t in dataset('TweetMessages')
37where $t.send_time >= datetime('2011-06-18T14:10:17')
38and
39$t.send_time < datetime('2011-06-18T15:10:17')
40return {
41 "tweet": $t.tweetid,
42 "similar-tweets": for $t2 in dataset('TweetMessages')
43 let $sim := similarity-jaccard-check($t.referred_topics, $t2.referred_topics, 0.6f)
44 where $sim[0] and
45 $t2.tweetid != $t.tweetid
46 return $t2.tweetid
47}