blob: e46286cd6bf9db1424316e211c8f8aa14652313d [file] [log] [blame]
buyingyi71f06c72012-11-29 05:06:16 +00001/*
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
8drop dataverse OpenSocialNetworkData if exists;
9create dataverse OpenSocialNetworkData;
10
11use dataverse OpenSocialNetworkData;
12
13create type TwitterUserType as open {
14screen-name: string,
15lang: string,
16friends_count: int32,
17statuses_count: int32,
18name: string,
19followers_count: int32
20}
21
22create type TweetMessageType as open {
23tweetid: string,
24tweetid-copy: string,
25send-time-copy: datetime
26}
27
28create dataset TweetMessages(TweetMessageType)
29partitioned by key tweetid;
30
31load dataset TweetMessages
32using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
33(("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm"));
34
35write output to nc1:"rttest/open-closed_query-issue208.adm";
36for $t in dataset('TweetMessages')
37where $t.send-time >= datetime('2005-04-13T17:17:22') and
38$t.send-time <= datetime('2011-04-13T17:18:22')
39group by $uid := $t.user.screen-name with $t
40order by $uid
41return {
42 "user": $uid,
43 "count": count($t)
44}
45