| /* |
| * Description : Test that left-outer-join may use an available inverted index in index subtree. |
| * Issue : 741 |
| * Expected Res : Success |
| * Date : 16th May 2014 |
| */ |
| |
| drop dataverse test if exists; |
| create dataverse test; |
| use dataverse test; |
| |
| create type TwitterUserType as { |
| screen_name: string, |
| lang: string, |
| friends_count: int32, |
| statuses_count: int32, |
| name: string, |
| followers_count: int32 |
| } |
| |
| create type TweetMessageType as { |
| tweetid: int64, |
| user: TwitterUserType, |
| sender_location: point?, |
| send_time: datetime, |
| referred_topics: {{ string }}, |
| message_text: string |
| } |
| |
| create dataset TweetMessages(TweetMessageType) primary key tweetid; |
| |
| create index topicIIx on TweetMessages(referred_topics) type keyword; |
| |
| write output to nc1:"rttest/inverted-index-join_issue741.adm"; |
| |
| for $t in dataset('TweetMessages') |
| where $t.send_time >= datetime('2011-06-18T14:10:17') |
| and |
| $t.send_time < datetime('2011-06-18T15:10:17') |
| return { |
| "tweet": $t.tweetid, |
| "similar-tweets": for $t2 in dataset('TweetMessages') |
| let $sim := similarity-jaccard-check($t.referred_topics, $t2.referred_topics, 0.6f) |
| where $sim[0] and |
| $t2.tweetid != $t.tweetid |
| return $t2.tweetid |
| } |