alexander.behm | 96e3f3f | 2012-05-06 05:58:21 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | create dataverse test; |
| 3 | use dataverse test; |
| 4 | |
| 5 | create 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 | |
| 16 | create dataset MyData(MyRecord) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 17 | primary key id; |
alexander.behm | 96e3f3f | 2012-05-06 05:58:21 +0000 | [diff] [blame] | 18 | |
| 19 | load dataset MyData |
| 20 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 21 | (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")); |
| 22 | |
| 23 | create index rtree_index_point on MyData(point) type rtree; |
| 24 | |
| 25 | |
alexander.behm | c576c60 | 2012-07-06 02:41:15 +0000 | [diff] [blame] | 26 | write output to nc1:"rttest/index-selection_rtree-secondary-index-open.adm"; |
alexander.behm | 96e3f3f | 2012-05-06 05:58:21 +0000 | [diff] [blame] | 27 | |
| 28 | for $o in dataset('MyData') |
| 29 | where 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))) |
| 30 | order by $o.id |
| 31 | return {"id":$o.id} |