asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [20/58] [abbrv] [partial] incubator-asterixdb git commit: Added support of typed indexes over open fields & indexes over nested fields
Date Fri, 24 Apr 2015 18:42:46 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..f3ca720
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,6 @@
+use dataverse test;
+
+
+delete $m from dataset MyData where $m.nested.id>10;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..e68037a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.5.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Test case Name  : scan-delete-rtree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary rtree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+use dataverse test;
+
+for $o in dataset('MyData')
+
+where spatial-intersect($o.nested.point, create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.nested.id
+return {"id":$o.nested.id}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..fba8875
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql
@@ -0,0 +1,30 @@
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+
+create type MyRecordtmp as closed {
+
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+
+create type MyRecord as closed {
+  nested : MyRecordtmp
+}
+
+create dataset MyDatatmp(MyRecordtmp)
+  primary key id;
+
+create dataset MyData(MyRecord)
+  primary key nested.id;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql
new file mode 100644
index 0000000..42de84b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql
@@ -0,0 +1,15 @@
+use dataverse test;
+
+
+load dataset MyDatatmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+insert into dataset MyData
+(
+	for $c in dataset('MyDatatmp')
+	return {
+		"nested" : $c
+	}	
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..0bcf41c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql
@@ -0,0 +1,6 @@
+use dataverse test;
+
+
+create index rtree_index_point on MyData(nested.point) type rtree;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql
new file mode 100644
index 0000000..f3ca720
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql
@@ -0,0 +1,6 @@
+use dataverse test;
+
+
+delete $m from dataset MyData where $m.nested.id>10;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.5.query.aql
new file mode 100644
index 0000000..f1fedf5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.5.query.aql
@@ -0,0 +1,8 @@
+use dataverse test;
+
+for $o in dataset('MyData')
+
+where spatial-intersect($o.nested.point, create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.nested.id
+return {"id":$o.nested.id}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..92b5564
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,38 @@
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion into secondary btree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int64,
+  street: string,
+  city: string
+}
+
+
+create type CustomerTypetmp as closed {
+
+  cid: int64,
+  name: string,
+  age: int64?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+
+create type CustomerType as closed {
+  nested : CustomerTypetmp
+}
+
+create dataset Customerstmp(CustomerTypetmp) primary key cid;
+create dataset CustomersMinitmp(CustomerTypetmp) primary key cid;
+create dataset CustomersMini(CustomerType) primary key nested.cid;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..27e722e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql
@@ -0,0 +1,15 @@
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion into secondary btree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+use dataverse test;
+
+
+load dataset Customerstmp
+
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..62c4698
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+
+create index age_index on CustomersMini(nested.age);
+
+create index age_index on CustomersMinitmp(age);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..7646112
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,28 @@
+use dataverse test;
+
+
+insert into dataset CustomersMinitmp
+(
+	for $c in dataset('Customerstmp')
+
+	where $c.cid < 200	
+	return {
+	  "cid": $c.cid,
+  	  "name": $c.name,
+  	  "age": $c.age,
+  	  "address": $c.address,
+  	  "interests": $c.interests,
+  	  "children": $c.children
+	}	
+);
+
+
+insert into dataset CustomersMini
+(
+	for $c in dataset('CustomersMinitmp')
+	return {
+		"nested" : $c
+	}	
+);
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..ff6e172
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.5.query.aql
@@ -0,0 +1,16 @@
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion into secondary btree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+
+use dataverse test;
+
+for $c in dataset('CustomersMini')
+
+where $c.nested.age < 20
+order by $c.nested.cid
+return $c.nested
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..b50143f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,33 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+
+create type DBLPTypetmp as closed {
+
+  id: int64,
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+
+create type DBLPType as closed {
+  nested : DBLPTypetmp
+}
+
+create dataset DBLPtmp(DBLPTypetmp) primary key id;
+create dataset DBLP(DBLPType) primary key nested.id;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..70d33b4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql
@@ -0,0 +1,14 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+load dataset DBLPtmp using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..b08cafc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,13 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+create index ngram_index on DBLPtmp(title) type ngram(3);
+create index ngram_index1 on DBLP(nested.title) type ngram(3);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..4138940
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql
@@ -0,0 +1,25 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+insert into dataset DBLP (
+for $o in dataset('DBLPtmp')
+where contains($o.title, "Multimedia")
+order by $o.id
+return { "nested" : {
+
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+
+		"misc": $o.misc }
+
+	}
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..3486f13
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+for $o in dataset('DBLP')
+where contains($o.nested.title, "Multimedia")
+order by $o.nested.id
+return $o.nested
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..d4229ed
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql
@@ -0,0 +1,33 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+
+create type DBLPTypetmp as closed {
+
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+
+create type DBLPType as closed {
+  nested : DBLPTypetmp
+}
+
+create dataset DBLPtmp(DBLPTypetmp) primary key id;
+create dataset DBLP(DBLPType) primary key nested.id;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql
new file mode 100644
index 0000000..02c7f2b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql
@@ -0,0 +1,14 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+load dataset DBLPtmp using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..27ca15e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql
@@ -0,0 +1,13 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+create index ngram_index on DBLPtmp(title) type ngram(3);
+create index ngram_index1 on DBLP(nested.title) type ngram(3);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql
new file mode 100644
index 0000000..52c6527
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql
@@ -0,0 +1,25 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+insert into dataset DBLP (
+for $o in dataset('DBLPtmp')
+where contains($o.title, "Multimedia")
+order by $o.id
+return { "nested" : {
+
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+
+		"misc": $o.misc }
+
+	}
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql
new file mode 100644
index 0000000..21d3f15
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+for $o in dataset('DBLP')
+where contains($o.nested.title, "Multimedia")
+order by $o.nested.id
+return $o.nested
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..3df81dd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,32 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+
+create type DBLPTypetmp as closed {
+
+  id: int64,
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create type DBLPType as closed {
+  nested : DBLPTypetmp
+}
+
+create dataset DBLPtmp(DBLPTypetmp) primary key id;
+create dataset DBLP(DBLPType) primary key nested.id;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..68abadc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql
@@ -0,0 +1,14 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+load dataset DBLPtmp using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..4242dd7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,13 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+create index keyword_index on DBLPtmp(title) type keyword;
+create index keyword_index1 on DBLP(nested.title) type keyword;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..65555de
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql
@@ -0,0 +1,24 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+insert into dataset DBLP (
+for $o in dataset('DBLPtmp')
+order by $o.id
+return { "nested" : {
+
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+
+		"misc": $o.misc }
+
+	}
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..d97005f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql
@@ -0,0 +1,16 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.nested.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o.nested
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..3fe3d22
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql
@@ -0,0 +1,33 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+
+create type DBLPTypetmp as closed {
+
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+
+create type DBLPType as closed {
+  nested : DBLPTypetmp
+}
+
+create dataset DBLPtmp(DBLPTypetmp) primary key id;
+create dataset DBLP(DBLPType) primary key nested.id;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql
new file mode 100644
index 0000000..1290ea6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql
@@ -0,0 +1,14 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+load dataset DBLPtmp using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..5caf67d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql
@@ -0,0 +1,13 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+create index keyword_index on DBLPtmp(title) type keyword;
+create index keyword_index1 on DBLP(nested.title) type keyword;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql
new file mode 100644
index 0000000..8d17b96
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql
@@ -0,0 +1,24 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+insert into dataset DBLP (
+for $o in dataset('DBLPtmp')
+order by $o.id
+return { "nested" : {
+
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+
+		"misc": $o.misc }
+
+	}
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql
new file mode 100644
index 0000000..95d0e6e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql
@@ -0,0 +1,17 @@
+/*
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.nested.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o.nested
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..c139b5b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,43 @@
+/*
+ * Test case Name  : scan-insert-rtree-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion into secondary rtree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+
+create type MyRecordtmp as closed {
+
+  id: int64,
+  point: point?,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle
+}
+
+
+create type MyMiniRecordtmp as closed {
+
+  id: int64,
+  point: point?
+}
+
+
+create type MyMiniRecord as closed {
+  nested : MyMiniRecordtmp
+}
+
+create dataset MyDatatmp(MyRecordtmp)
+  primary key id;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..8b0317e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql
@@ -0,0 +1,17 @@
+/*
+ * Test case Name  : scan-insert-rtree-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion into secondary rtree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+use dataverse test;
+
+
+load dataset MyDatatmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")) pre-sorted;
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..69d0acf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,8 @@
+use dataverse test;
+
+create dataset MyMiniData(MyMiniRecord)
+  primary key nested.id;
+
+create index rtree_index_point on MyMiniData(nested.point) type rtree;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..1c8bdc9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,13 @@
+use dataverse test;
+
+insert into dataset MyMiniData
+(
+
+	for $m in dataset('MyDatatmp')
+	return { "nested" : {
+		"id": $m.id,
+		"point": $m.point }
+
+	}
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..6298b3e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.5.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Test case Name  : scan-insert-rtree-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion into secondary rtree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+use dataverse test;
+
+for $o in dataset('MyMiniData')
+
+where spatial-intersect($o.nested.point, create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.nested.id
+return {"id":$o.nested.id}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..2773f5e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql
@@ -0,0 +1,47 @@
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type MyRecordtmp as closed {
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+
+create type MyMiniRecordtmp as closed {
+
+  id: int64,
+  point: point
+}
+
+
+create type MyRecord as closed {
+  nested : MyRecordtmp
+}
+
+create type MyMiniRecord as closed {
+  nested : MyMiniRecordtmp
+}
+
+
+create dataset MyDatatmp(MyRecordtmp)
+  primary key id;
+
+create dataset MyMiniDatatmp(MyMiniRecordtmp)
+  primary key id;
+
+  create dataset MyData(MyRecord)
+  primary key nested.id;
+
+create dataset MyMiniData(MyMiniRecord)
+  primary key nested.id;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql
new file mode 100644
index 0000000..e351dc2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql
@@ -0,0 +1,27 @@
+use dataverse test;
+
+
+load dataset MyDatatmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+load dataset MyMiniDatatmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData0.json"),("format"="adm")) pre-sorted;
+
+insert into dataset MyData
+(
+	for $c in dataset('MyDatatmp')
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset MyMiniData
+(
+	for $c in dataset('MyMiniDatatmp')
+	return {
+		"nested" : $c
+	}	
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..39b4e08
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+
+create index rtree_index_point_0 on MyData(nested.point) type rtree;
+create index rtree_index_point on MyMiniData(nested.point) type rtree;
+
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql
new file mode 100644
index 0000000..1409d64
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql
@@ -0,0 +1,13 @@
+use dataverse test;
+
+insert into dataset MyMiniData
+(
+	for $m in dataset('MyData')
+
+	return { "nested" : {
+		"id": $m.nested.id,
+		"point": $m.nested.point }
+
+	}
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.5.query.aql
new file mode 100644
index 0000000..e988509
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index-dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.5.query.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+for $o in dataset('MyMiniData')
+where spatial-intersect($o.nested.point, create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.nested.id
+return {"id":$o.nested.id}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.1.ddl.aql
new file mode 100644
index 0000000..0143e9f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.1.ddl.aql
@@ -0,0 +1,33 @@
+/*
+* Description  : Create an external dataset that contains records stored with text hdfs file format.
+                 Build an index over the external dataset age attribute
+                 Perform a query over the dataset using the index.
+* Expected Res : Success
+* Date         : 3rd Jan 2014
+*/
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type MyRecordNested as closed {
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create type MyRecord as closed {
+  nested: MyRecordNested
+}
+
+create external dataset MyData(MyRecord)
+using hdfs
+(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/spatialDataNested.json"),("input-format"="text-input-format"),("input-format"="text-input-format"),("format"="adm"));
+
+create index idx on MyData(nested.id);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.2.update.aql
new file mode 100644
index 0000000..4fb3db0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.2.update.aql
@@ -0,0 +1,7 @@
+/*
+* Description  : Create an external dataset that contains records stored with text hdfs file format.
+                 Build an index over the external dataset age attribute
+                 Perform a query over the dataset using the index.
+* Expected Res : Success
+* Date         : 3rd Jan 2014
+*/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.3.query.aql
new file mode 100644
index 0000000..7402859
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/adm-format/adm-format.3.query.aql
@@ -0,0 +1,22 @@
+/*
+* Description  : Create an external dataset that contains records stored with text hdfs file format.
+                 Build an index over the external dataset age attribute
+                 Perform a query over the dataset using the index.
+* Expected Res : Success
+* Date         : 3rd Jan 2014
+*/
+use dataverse test;
+
+for $d in dataset MyData
+where $d.nested.id = 10
+return {
+  "id": $d.nested.id,
+  "point": $d.nested.point,
+  "kwds": $d.nested.kwds,
+  "line1": $d.nested.line1,
+  "line2": $d.nested.line2,
+  "poly1": $d.nested.poly1,
+  "poly2": $d.nested.poly2,
+  "rec": $d.nested.rec,
+  "circle": $d.nested.circle
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
new file mode 100644
index 0000000..e3b1de3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
@@ -0,0 +1,42 @@
+/*
+ * Description  : Test that left-outer-join may use two available indexes, one for primary index in prob subtree and another for secondary rtree index in index subtree.
+ * Issue        : 730, 741                 
+ * Expected Res : Success
+ * Date         : 8th May 2014
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TwitterUserType as closed {
+	screen-name: string,
+	lang: string,
+	friends-count: int64,
+	statuses-count: int64,
+	name: string,
+	followers-count: int64
+} 
+
+create type TweetMessageNestedType as closed {
+	tweetid: int64,
+        user: TwitterUserType,
+        sender-location: point,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	message-text: string,
+	countA: int64,
+	countB: int64
+}
+
+create type TweetMessageType as closed {
+  nested: TweetMessageNestedType
+}
+
+create external dataset TweetMessages(TweetMessageType) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/tw_for_indexleftouterjoin_nested.adm"),("input-format"="text-input-format"),("format"="adm"));
+
+create index IdIx on TweetMessages(nested.tweetid) type btree;
+create index msgCountAIx on TweetMessages(nested.countA) type btree;
+create index msgCountBIx on TweetMessages(nested.countB) type btree;
+create index twmSndLocIx on TweetMessages(nested.sender-location) type rtree;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.2.update.aql
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.3.query.aql
new file mode 100644
index 0000000..58d0268
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.3.query.aql
@@ -0,0 +1,21 @@
+/*
+ * Description  : Test that left-outer-join may use two available indexes, one for primary index in prob subtree and another for secondary rtree index in index subtree.
+ * Issue        : 730, 741                 
+ * Expected Res : Success
+ * Date         : 8th May 2014
+ */
+
+use dataverse test;
+
+for $t1 in dataset('TweetMessages')
+let $n :=  create-circle($t1.nested.sender-location, 0.5)
+where $t1.nested.tweetid < int64("10")
+order by $t1.nested.tweetid
+return {
+"tweetid1": $t1.nested.tweetid,
+"loc1":$t1.nested.sender-location,
+"nearby-message": for $t2 in dataset('TweetMessages')
+                             where spatial-intersect($t2.nested.sender-location, $n)
+                             order by $t2.nested.tweetid
+                             return {"tweetid2":$t2.nested.tweetid, "loc2":$t2.nested.sender-location}
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
new file mode 100644
index 0000000..b667367
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
@@ -0,0 +1,40 @@
+/*
+ * Description  : Test that left-outer-join may use two available indexes, one for primary index in prob subtree and another for secondary btree index in index subtree.
+ * Issue        : 730, 741                 
+ * Expected Res : Success
+ * Date         : 8th May 2014
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type TwitterUserType as closed {
+	screen-name: string,
+	lang: string,
+	friends-count: int64,
+	statuses-count: int64,
+	name: string,
+	followers-count: int64
+} 
+
+create type TweetMessageNestedType as closed {
+	tweetid: int64,
+        user: TwitterUserType,
+        sender-location: point,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	message-text: string,
+	countA: int64,
+	countB: int64
+}
+
+create type TweetMessageType as closed {
+  nested: TweetMessageNestedType
+}
+
+create external dataset TweetMessages(TweetMessageType) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/tw_for_indexleftouterjoin_nested.adm"),("input-format"="text-input-format"),("format"="adm"));
+
+create index IdIx on TweetMessages(nested.tweetid) type btree;
+create index msgCountAIx on TweetMessages(nested.countA) type btree;
+create index msgCountBIx on TweetMessages(nested.countB) type btree;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.2.update.aql
new file mode 100644
index 0000000..16cbac3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : Test that left-outer-join may use two available indexes, one for primary index in prob subtree and another for secondary btree index in index subtree.
+ * Issue        : 730, 741                 
+ * Expected Res : Success
+ * Date         : 8th May 2014
+ */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.3.query.aql
new file mode 100644
index 0000000..6fabcbd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/leftouterjoin/leftouterjoin.3.query.aql
@@ -0,0 +1,14 @@
+use dataverse test;
+
+for $t1 in dataset('TweetMessages')
+where $t1.nested.tweetid < int64("10")
+order by $t1.nested.tweetid
+return {
+"tweetid1": $t1.nested.tweetid,
+"count1":$t1.nested.countA,
+"t2info": for $t2 in dataset('TweetMessages') 
+          where $t1.nested.countA /* +indexnl */= $t2.nested.countB
+          order by $t2.nested.tweetid
+          return {"tweetid2": $t2.nested.tweetid,
+                  "count2":$t2.nested.countB}
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.1.ddl.aql
new file mode 100644
index 0000000..ec17af7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.1.ddl.aql
@@ -0,0 +1,23 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type MyRecordNested as closed {
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create type MyRecord as closed {
+  nested: MyRecordNested
+}
+
+create external dataset MyData(MyRecord) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/spatialDataNested.json"),("input-format"="text-input-format"),("format"="adm"));
+
+create index rtree_index_point on MyData(nested.point) type rtree;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.2.update.aql
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.3.query.aql
new file mode 100644
index 0000000..991c04c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/external-indexing/rtree-index/rtree-index.3.query.aql
@@ -0,0 +1,6 @@
+use dataverse test;
+
+for $o in dataset('MyData')
+where spatial-intersect($o.nested.point, create-polygon([4.0,1.0,4.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.nested.id
+return {"id":$o.nested.id}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql
new file mode 100644
index 0000000..9438673
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql
@@ -0,0 +1,54 @@
+/*
+ * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
+ *                  Given the 'indexnl' hint we expect the join to be transformed
+ *                  into an indexed nested-loop join using Customers' primary index.
+ * Success        : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as open {
+  number: int64, 
+  street: string,
+  city: string
+}
+
+create type CustomerTypetmp as closed {
+  cid: int64, 
+  name: string,
+  cashBack: int64,
+  age: int64?,
+  address: AddressType?,
+  lastorder: {
+    oid: int64,
+    total: float
+  }
+}
+
+create type OrderTypetmp as open {
+  oid: int64,
+  cid: int64,
+  orderstatus: string,
+  orderpriority: string,
+  clerk: string,
+  total: float,
+  items: [int64]
+}
+
+create type CustomerType as closed {
+nested : CustomerTypetmp
+}
+
+create type OrderType as open {
+nested : OrderTypetmp
+}
+
+create dataset Customerstmp(CustomerTypetmp) primary key cid;
+create dataset Orderstmp(OrderTypetmp) primary key oid;
+
+create dataset Customers(CustomerType) primary key nested.cid;
+create dataset Orders(OrderType) primary key nested.oid;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql
new file mode 100644
index 0000000..39e230d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql
@@ -0,0 +1,32 @@
+/*
+ * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
+ *                  Given the 'indexnl' hint we expect the join to be transformed
+ *                  into an indexed nested-loop join using Customers' primary index.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+load dataset Customerstmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/customerData.json"),("format"="adm"));
+
+load dataset Orderstmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/nontagged/orderData.json"),("format"="adm"));
+
+insert into dataset Orders
+(
+	for $c in dataset('Orderstmp')
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset Customers
+(
+	for $c in dataset('Customerstmp')
+	return {
+		"nested" : $c
+	}	
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.3.query.aql
new file mode 100644
index 0000000..6b738b5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-primary-equi-join/btree-primary-equi-join.3.query.aql
@@ -0,0 +1,14 @@
+/*
+ * Description    : Equi joins two datasets, Customers and Orders, based on the customer id.
+ *                  Given the 'indexnl' hint we expect the join to be transformed
+ *                  into an indexed nested-loop join using Customers' primary index.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.nested.cid /*+ indexnl */ = $o.nested.cid
+order by $c.nested.cid, $o.nested.oid
+return {"cid":$c.nested.cid, "oid": $o.nested.oid}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
new file mode 100644
index 0000000..97dc409
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
+ *                  DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ *                  we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPTypetmp as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create type CSXTypetmp as closed {
+  id: int64,
+  csxid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPType as closed {
+nested : DBLPTypetmp
+}
+
+create type CSXType as closed {
+nested : CSXTypetmp
+}
+
+create dataset DBLPtmp(DBLPTypetmp) primary key id;
+create dataset CSXtmp(CSXTypetmp) primary key id;
+
+create dataset DBLP(DBLPType) primary key nested.id;
+create dataset CSX(CSXType) primary key nested.id;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
new file mode 100644
index 0000000..adef0d6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
@@ -0,0 +1,33 @@
+/*
+ * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
+ *                  DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ *                  we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+load dataset DBLPtmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"),("quote"="\u0000"));
+
+load dataset CSXtmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"),("quote"="\u0000"));
+
+
+insert into dataset DBLP
+(
+	for $c in dataset('DBLPtmp')
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset CSX
+(
+	for $c in dataset('CSXtmp')
+	return {
+		"nested" : $c
+	}	
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
new file mode 100644
index 0000000..ccc4613
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
+ *                  DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ *                  we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+create index title_index on DBLP(nested.authors);
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
new file mode 100644
index 0000000..a57a39d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
@@ -0,0 +1,14 @@
+/*
+ * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
+ *                  DBLP has a secondary btree index on title, and given the 'indexnl' hint
+ *                  we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where $a.nested.authors /*+ indexnl */ = $b.nested.authors
+order by $a.nested.id, $b.nested.id
+return {"aid": $a.nested.id, "bid": $b.nested.id, "authors": $a.nested.authors}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
new file mode 100644
index 0000000..b828e76
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
@@ -0,0 +1,36 @@
+/*
+ * Description    : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ *                  Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success        : Yes
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type AddressType as open {
+  number: int64,
+  street: string,
+  city: string
+}
+
+create type CustomerNestedType as closed {
+  cid: int64,
+  name: string,
+  age: int64?,
+  address: AddressType?,
+  interests: [string],
+  children: [ { name: string, age: int64? } ]
+}
+
+create type CustomerType as closed {
+  nested: CustomerNestedType
+}
+
+create dataset Customerstmp(CustomerNestedType) primary key cid;
+create dataset Customers2tmp(CustomerNestedType) primary key cid;
+
+create dataset Customers(CustomerType) primary key nested.cid;
+create dataset Customers2(CustomerType) primary key nested.cid;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
new file mode 100644
index 0000000..1a621f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
@@ -0,0 +1,32 @@
+/*
+ * Description    : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ *                  Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+load dataset Customerstmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+load dataset Customers2tmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
+
+insert into dataset Customers
+(
+	for $c in dataset('Customerstmp')
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset Customers2
+(
+	for $c in dataset('Customers2tmp')
+	return {
+		"nested" : $c
+	}	
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
new file mode 100644
index 0000000..6a3dbc4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description    : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their names.
+ *                  Customers has a 3-gram index on name, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+create index ngram_index on Customers(nested.name) type ngram(3);
+


Mime
View raw message