blob: 6ca6d28a9e3fdeb5188374a603fd606fe606552e [file] [log] [blame]
alexander.behm42d11e82012-05-06 09:25:34 +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 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/spatialDataNulls.json"),("format"="adm"));
22
23create index rtree_index_point on MyData(point) type rtree;
24
alexander.behmc576c602012-07-06 02:41:15 +000025write output to nc1:"rttest/index-selection_rtree-secondary-index-nullable.adm";
alexander.behm42d11e82012-05-06 09:25:34 +000026
27for $o in dataset('MyData')
28where 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)))
29order by $o.id
30return {"id":$o.id}