salsubaiee | bb16791 | 2013-12-21 12:55:52 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Description : Notice the query hint to avoid using any secondary index to evaluate the predicate in the where clause |
| 3 | * Expected Res : Success |
| 4 | * Date : 21th December 2013 |
| 5 | */ |
| 6 | |
| 7 | drop dataverse test if exists; |
| 8 | create dataverse test; |
| 9 | use dataverse test; |
| 10 | |
| 11 | create type MyRecord as closed { |
| 12 | id: int32, |
| 13 | point: point, |
| 14 | kwds: string, |
| 15 | line1: line, |
| 16 | line2: line, |
| 17 | poly1: polygon, |
| 18 | poly2: polygon, |
| 19 | rec: rectangle, |
| 20 | circle: circle |
| 21 | } |
| 22 | |
| 23 | create nodegroup group1 if not exists on nc1, nc2; |
| 24 | |
| 25 | create dataset MyData(MyRecord) |
| 26 | primary key id on group1; |
| 27 | |
| 28 | load dataset MyData |
| 29 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 30 | (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted; |
| 31 | |
| 32 | create index rtree_index_point on MyData(point) type rtree; |
| 33 | |
| 34 | |
| 35 | write output to nc1:"rttest/index_rtree-secondary-index.adm"; |
| 36 | |
| 37 | for $o in dataset('MyData') |
| 38 | /*+ skip-index */ |
| 39 | where spatial-intersect($o.point, create-polygon([4.0,1.0,4.0,4.0,12.0,4.0,12.0,1.0])) |
| 40 | return {"id":$o.id} |