blob: a4555f4268524d86675cd1a24359a1a6a3239fb1 [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
25write output to nc1:"rttest/index_rtree-secondary-index-nullable.adm";
26
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}