Fixed issue 214 (allowing r-trees to be created for rectangle data type). Added test cases for all other spatial data types.
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@873 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
index 6201ca2..4e2ca6c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create dataset MyData(MyRecord)
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
index 236b4a9..f1bc29d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create type MyMiniRecord as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
index efee6cf..ab79189 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
@@ -17,7 +17,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create dataset MyData1(MyRecord) partitioned by key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
index 7ff775c..c1e1890 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
@@ -10,7 +10,8 @@
line2: line,
poly1: polygon,
poly2: polygon,
- rec: rectangle
+ rec: rectangle,
+ circle: circle
}
create dataset MyData(MyRecord)
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
new file mode 100644
index 0000000..e755aa9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
@@ -0,0 +1,34 @@
+/*
+ * Description : Create r-tree indexes for all spatial data types.
+ * Success : Yes
+ */
+
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type SpatialType as open {
+ id: int32,
+ point: point,
+ line1: line,
+ poly1: polygon,
+ rec: rectangle,
+ circle: circle
+}
+
+create dataset MyData(SpatialType) partitioned by key id;
+create index rtree_index1 on MyData(point) type rtree;
+create index rtree_index2 on MyData(line1) type rtree;
+create index rtree_index3 on MyData(poly1) type rtree;
+create index rtree_index5 on MyData(rec) type rtree;
+create index rtree_index4 on MyData(circle) type rtree;
+
+write output to nc1:"rttest/spatial_create-rtree-index.adm";
+
+load dataset MyData
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
+
+for $a in dataset('MyData')
+return $a.id
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/create-rtree-index.adm b/asterix-app/src/test/resources/runtimets/results/spatial/create-rtree-index.adm
new file mode 100644
index 0000000..1778736
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/create-rtree-index.adm
@@ -0,0 +1,19 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 6bed5b3..b665a76 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -2714,6 +2714,11 @@
</compilation-unit>
</test-case>
<test-case FilePath="spatial">
+ <compilation-unit name="create-rtree-index">
+ <output-file compare="Text">create-rtree-index.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="spatial">
<compilation-unit name="distance-between-points">
<output-file compare="Text">distance-between-points.adm</output-file>
</compilation-unit>