alexander.behm | 812d3ae | 2012-05-13 07:07:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Test case Name : scan-delete-rtree-secondary-index-nullable.aql |
| 3 | * Description : This test is intended to test deletion from secondary rtree indexes that are built on nullable fields |
| 4 | * Expected Result : Success |
| 5 | * Date : May 12 2012 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse test if exists; |
| 9 | create dataverse test; |
| 10 | use dataverse test; |
| 11 | |
| 12 | create type MyRecord as closed { |
| 13 | id: int32, |
| 14 | point: point?, |
| 15 | kwds: string, |
| 16 | line1: line, |
| 17 | line2: line, |
| 18 | poly1: polygon, |
| 19 | poly2: polygon, |
| 20 | rec: rectangle |
| 21 | } |
| 22 | |
| 23 | create dataset MyData(MyRecord) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame^] | 24 | primary key id; |
alexander.behm | 812d3ae | 2012-05-13 07:07:02 +0000 | [diff] [blame] | 25 | |
| 26 | load dataset MyData |
| 27 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 28 | (("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")) pre-sorted; |
| 29 | |
| 30 | create index rtree_index_point on MyData(point) type rtree; |
| 31 | |
| 32 | delete $m from dataset MyData where $m.id>10; |
| 33 | |
| 34 | write output to nc1:"rttest/dml_scan-delete-rtree-secondary-index-nullable.adm"; |
| 35 | |
| 36 | for $o in dataset('MyData') |
| 37 | where spatial-intersect($o.point, create-polygon(create-point(0.0,1.0), create-point(0.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0))) |
| 38 | order by $o.id |
| 39 | return {"id":$o.id} |