blob: 55e78fcb5efaba0e1b682d8e008f951bda120d9e [file] [log] [blame]
salsubaieebb167912013-12-21 12:55:52 -08001/*
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
7drop dataverse test if exists;
8create dataverse test;
9use dataverse test;
10
11create 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
23create nodegroup group1 if not exists on nc1, nc2;
24
25create dataset MyData(MyRecord)
26 primary key id on group1;
27
28load dataset MyData
29using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
30(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
31
32create index rtree_index_point on MyData(point) type rtree;
33
34
35write output to nc1:"rttest/index_rtree-secondary-index.adm";
36
37for $o in dataset('MyData')
38/*+ skip-index */
39where spatial-intersect($o.point, create-polygon([4.0,1.0,4.0,4.0,12.0,4.0,12.0,1.0]))
40return {"id":$o.id}