buyingyi | 71f06c7 | 2012-11-29 05:06:16 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Description : This test case is to verify the fix for issue208 |
| 3 | : https://code.google.com/p/asterixdb/issues/detail?id=208 |
| 4 | * Expected Res : Success |
| 5 | * Date : 26th November 2012 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse OpenSocialNetworkData if exists; |
| 9 | create dataverse OpenSocialNetworkData; |
| 10 | |
| 11 | use dataverse OpenSocialNetworkData; |
| 12 | |
| 13 | create type TwitterUserType as open { |
| 14 | screen-name: string, |
| 15 | lang: string, |
| 16 | friends_count: int32, |
| 17 | statuses_count: int32, |
| 18 | name: string, |
| 19 | followers_count: int32 |
| 20 | } |
| 21 | |
| 22 | create type TweetMessageType as open { |
| 23 | tweetid: string, |
| 24 | tweetid-copy: string, |
| 25 | send-time-copy: datetime |
| 26 | } |
| 27 | |
| 28 | create dataset TweetMessages(TweetMessageType) |
| 29 | partitioned by key tweetid; |
| 30 | |
| 31 | load dataset TweetMessages |
| 32 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 33 | (("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm")); |
| 34 | |
| 35 | write output to nc1:"rttest/open-closed_query-issue208.adm"; |
| 36 | for $t in dataset('TweetMessages') |
| 37 | where $t.send-time >= datetime('2005-04-13T17:17:22') and |
| 38 | $t.send-time <= datetime('2011-04-13T17:18:22') |
| 39 | group by $uid := $t.user.screen-name with $t |
| 40 | order by $uid |
| 41 | return { |
| 42 | "user": $uid, |
| 43 | "count": count($t) |
| 44 | } |
| 45 | |