blob: 2ec32f48f2ff1e7213b28d9a778e86c5c0bf8219 [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
vinayakb38b7ca42012-03-05 05:44:15 +000019create dataset MyData(MyRecord)
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000020 partitioned by key id;
vinayakb38b7ca42012-03-05 05:44:15 +000021
22load dataset MyData
23using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
24(("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
25
26
27create dataset MyMiniData(MyMiniRecord)
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000028 partitioned by key id;
vinayakb38b7ca42012-03-05 05:44:15 +000029
30load dataset MyMiniData
31using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
32(("path"="nc1://data/spatial/spatialData0.json"),("format"="adm")) pre-sorted;
33
34
35create index rtree_index_loc_0 on MyData(loc) type rtree;
36create index rtree_index_loc on MyMiniData(loc) type rtree;
37
38insert into dataset MyMiniData
39(
40 for $m in dataset('MyData')
41 where $m.id<1000
42 return {
43 "id": $m.id,
44 "loc": $m.loc
45 }
46);
47
48insert into dataset MyMiniData
49(
50 for $m in dataset('MyData')
51 where $m.id>=1000
52 die after 1000
53 return {
54 "id": $m.id,
55 "loc": $m.loc
56 }
57);
58
59write output to nc1:"rttest/failure_insert-rtree.adm";
60
61for $o in dataset('MyMiniData')
62order by $o.id
63return {"id":$o.id}