blob: 161439a131705877ad62154e5685d9d2237f48ed [file] [log] [blame]
alexander.behm812d3ae2012-05-13 07:07:02 +00001/*
2 * Test case Name : scan-insert-rtree-secondary-index-nullable.aql
3 * Description : This test is intended to test insertion into secondary rtree indexes that are built on nullable fields
4 * Expected Result : Success
5 * Date : May 12 2012
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
12create 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
23create type MyMiniRecord as closed {
24 id: int32,
25 point: point?
26}
27
28create dataset MyData(MyRecord)
29 partitioned by key id;
30
31load dataset MyData
32using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
33(("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")) pre-sorted;
34
35create dataset MyMiniData(MyMiniRecord)
36 partitioned by key id;
37
38create index rtree_index_point on MyMiniData(point) type rtree;
39
40insert into dataset MyMiniData
41(
42 for $m in dataset('MyData')
43 return {
44 "id": $m.id,
45 "point": $m.point
46 }
47);
48
49write output to nc1:"rttest/dml_scan-insert-rtree-secondary-index-nullable.adm";
50
51for $o in dataset('MyMiniData')
52where 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)))
53order by $o.id
54return {"id":$o.id}