blob: 192b1892acb51877ca2d3e041bdc8ea72793fbe9 [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 closed {
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 nodegroup group1 if not exists on nc1, nc2;
17
18create dataset MyData(MyRecord)
19 partitioned by key id on group1;
20
21load dataset MyData
22using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
23(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
24
25create index rtree_index_point on MyData(point) type rtree;
26
27
28write output to nc1:"rttest/index_rtree-secondary-index-open.adm";
29
30for $o in dataset('MyData')
31where 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)))
32return {"id":$o.id}