Young-Seok | be353dd | 2014-05-22 20:30:45 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 8 | drop dataverse test if exists; |
| 9 | create dataverse test; |
| 10 | use dataverse test; |
| 11 | |
| 12 | create type TwitterUserType as { |
| 13 | screen_name: string, |
| 14 | lang: string, |
| 15 | friends_count: int32, |
| 16 | statuses_count: int32, |
| 17 | name: string, |
| 18 | followers_count: int32 |
| 19 | } |
| 20 | |
| 21 | create type TweetMessageType as { |
| 22 | tweetid: int64, |
| 23 | user: TwitterUserType, |
| 24 | sender_location: point?, |
| 25 | send_time: datetime, |
| 26 | referred_topics: {{ string }}, |
| 27 | message_text: string |
| 28 | } |
| 29 | |
| 30 | create dataset TweetMessages(TweetMessageType) primary key tweetid; |
| 31 | |
| 32 | create index topicIIx on TweetMessages(referred_topics) type keyword; |
| 33 | |
| 34 | write output to nc1:"rttest/inverted-index-join_issue741.adm"; |
| 35 | |
| 36 | for $t in dataset('TweetMessages') |
| 37 | where $t.send_time >= datetime('2011-06-18T14:10:17') |
| 38 | and |
| 39 | $t.send_time < datetime('2011-06-18T15:10:17') |
| 40 | return { |
| 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 | } |