blob: c428af2ecdc15f5ec8ffe2ea96a7d082b2c1e6f0 [file] [log] [blame]
alexander.behm96e3f3f2012-05-06 05:58:21 +00001drop dataverse test if exists;
2create dataverse test;
3use dataverse test;
4
5create type MyRecord as open {
6 id: int32,
7 point: point,
8 kwds: string,
9 line1: line,
10 line2: line,
11 poly1: polygon,
12 poly2: polygon,
13 rec: rectangle
14}
15
16create dataset MyData(MyRecord)
17 partitioned by key id;
18
19load dataset MyData
20using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
21(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
22
23create index rtree_index_point on MyData(point) type rtree;
24
25
26write output to nc1:"rttest/index_rtree-secondary-index-open.adm";
27
28for $o in dataset('MyData')
29where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
30order by $o.id
31return {"id":$o.id}