blob: fb2c701f06284eb0301f5b6bf3fbde63d9297f81 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
2
3create dataverse test;
4use dataverse test;
5
6create type MyRecord as closed {
7 id: int32,
8 tweetid: int64,
9 loc: point,
10 time: datetime,
11 text: string
12}
13
vinayakb38b7ca42012-03-05 05:44:15 +000014create dataset MyData(MyRecord)
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000015 partitioned by key id;
vinayakb38b7ca42012-03-05 05:44:15 +000016
salsubaiee0157ef42013-02-06 09:02:31 +000017create index rtree_index on MyData(loc) type rtree;
18
vinayakb38b7ca42012-03-05 05:44:15 +000019load dataset MyData
20using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
21(("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
22
salsubaiee0157ef42013-02-06 09:02:31 +000023delete $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;
vinayakb38b7ca42012-03-05 05:44:15 +000024
25write output to nc1:"rttest/failure_delete-rtree.adm";
26
27for $o in dataset('MyData')
salsubaiee0157ef42013-02-06 09:02:31 +000028where spatial-intersect($o.loc, create-rectangle(create-point(0.0,-100.0), create-point(55.5,50.0)))
vinayakb38b7ca42012-03-05 05:44:15 +000029order by $o.id
30return {"id":$o.id}