blob: 41a5a911f52da4452a193411e10e22b7fdcc5fce [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +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,
salsubaiee@gmail.com4037dde2012-11-13 20:19:03 +000013 rec: rectangle,
14 circle: circle
vinayakb38b7ca42012-03-05 05:44:15 +000015}
16
17create nodegroup group1 if not exists on nc1, nc2;
18
19create dataset MyData(MyRecord)
ramangrover29669d8f62013-02-11 06:03:32 +000020 primary key id on group1;
vinayakb38b7ca42012-03-05 05:44:15 +000021
22load dataset MyData
23using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
24(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
25
26create index rtree_index_point on MyData(point) type rtree;
27
28
29write output to nc1:"rttest/index_rtree-secondary-index.adm";
30
31for $o in dataset('MyData')
32where 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)))
33return {"id":$o.id}