alexander.behm | 42d11e8 | 2012-05-06 09:25:34 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | create dataverse test; |
| 3 | use dataverse test; |
| 4 | |
| 5 | create 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 | |
| 16 | create dataset MyData(MyRecord) |
| 17 | partitioned by key id; |
| 18 | |
| 19 | load dataset MyData |
| 20 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 21 | (("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")); |
| 22 | |
| 23 | create index rtree_index_point on MyData(point) type rtree; |
| 24 | |
| 25 | write output to nc1:"rttest/index_rtree-secondary-index-nullable.adm"; |
| 26 | |
| 27 | for $o in dataset('MyData') |
| 28 | 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))) |
| 29 | order by $o.id |
| 30 | return {"id":$o.id} |