blob: ca4e910d613aa05223245e15a42f61db9a73ee86 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
2
3create dataverse test;
4use dataverse test;
5
6create type MyRecord as closed {
7 id: int32,
8 tweetid: int64,
9 loc: point,
10 time: datetime,
11 text: string
12}
13
14create type MyMiniRecord as closed {
15 id: int32,
16 loc: point
17}
18
19create nodegroup group1 if not exists on nc1, nc2;
20
21create dataset MyData(MyRecord)
22 partitioned by key id on group1;
23
24load dataset MyData
25using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
26(("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
27
28
29create dataset MyMiniData(MyMiniRecord)
30 partitioned by key id on group1;
31
32load dataset MyMiniData
33using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
34(("path"="nc1://data/spatial/spatialData0.json"),("format"="adm")) pre-sorted;
35
36
37create index rtree_index_loc_0 on MyData(loc) type rtree;
38create index rtree_index_loc on MyMiniData(loc) type rtree;
39
40insert into dataset MyMiniData
41(
42 for $m in dataset('MyData')
43 where $m.id<1000
44 return {
45 "id": $m.id,
46 "loc": $m.loc
47 }
48);
49
50insert into dataset MyMiniData
51(
52 for $m in dataset('MyData')
53 where $m.id>=1000
54 die after 1000
55 return {
56 "id": $m.id,
57 "loc": $m.loc
58 }
59);
60
61write output to nc1:"rttest/failure_insert-rtree.adm";
62
63for $o in dataset('MyMiniData')
64order by $o.id
65return {"id":$o.id}