vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | |
| 3 | create dataverse test; |
| 4 | use dataverse test; |
| 5 | |
| 6 | create type MyRecord as closed { |
| 7 | id: int32, |
| 8 | tweetid: int64, |
| 9 | loc: point, |
| 10 | time: datetime, |
| 11 | text: string |
| 12 | } |
| 13 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 14 | create dataset MyData(MyRecord) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 15 | primary key id; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 16 | |
salsubaiee | 0157ef4 | 2013-02-06 09:02:31 +0000 | [diff] [blame] | 17 | create index rtree_index on MyData(loc) type rtree; |
| 18 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 19 | load dataset MyData |
| 20 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 21 | (("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted; |
| 22 | |
salsubaiee | 0157ef4 | 2013-02-06 09:02:31 +0000 | [diff] [blame] | 23 | delete $l from dataset MyData where spatial-intersect($l.loc, create-rectangle(create-point(0.0,-100.0), create-point(55.5,50.0))) die after 1000; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 24 | |
| 25 | write output to nc1:"rttest/failure_delete-rtree.adm"; |
| 26 | |
| 27 | for $o in dataset('MyData') |
salsubaiee | 0157ef4 | 2013-02-06 09:02:31 +0000 | [diff] [blame] | 28 | where spatial-intersect($o.loc, create-rectangle(create-point(0.0,-100.0), create-point(55.5,50.0))) |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 29 | order by $o.id |
| 30 | return {"id":$o.id} |