asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [16/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:42 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.2.update.aql
new file mode 100644
index 0000000..c63a9a1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.2.update.aql
@@ -0,0 +1,44 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ *                  DBLP has a 3-gram index on title, and 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/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"),("quote"="\u0000")) pre-sorted;
+
+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 $x in dataset DBLPtmp
+		where ($x.id<50)
+		return {
+			"nested" : $x
+		}
+);
+
+insert into dataset DBLP(
+	for $x in dataset DBLPtmp
+		where ($x.id>=50)
+		return {
+					"nested" : {
+						"id": $x.id,
+						"dblpid": $x.dblpid,
+						"authors": $x.title,
+						"misc": $x.misc
+					}
+				}
+);
+
+insert into dataset CSX(
+	for $x in dataset CSXtmp
+	return {
+		"nested": $x
+	}
+);
\ 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-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
new file mode 100644
index 0000000..214abd0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ *                  DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+create index ngram_index on DBLP(nested.title: string) type ngram(3)  enforced;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.4.query.aql
new file mode 100644
index 0000000..2f99661
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.4.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
+ *                  DBLP has a 3-gram index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+set import-private-functions 'true';
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+where similarity-jaccard(gram-tokens($a.nested.title, 3, false), gram-tokens($b.nested.title, 3, false)) >= 0.5f
+      and $a.nested.id < $b.nested.id
+order by $a.nested.id, $b.nested.id
+return { "arec": $a.nested, "brec": $b.nested }
\ 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-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
new file mode 100644
index 0000000..2b745fd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
@@ -0,0 +1,45 @@
+/*
+ * Description    : Joins two datasets on the intersection of their point attributes.
+ *                  The dataset 'MyData1' has an open enforced RTree index, and 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 MyRecordtmp as closed {
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create type MyRecordOpen as open {
+  id: int64,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create type MyRecord as closed {
+nested : MyRecordOpen
+}
+
+create dataset MyData1tmp(MyRecordtmp) primary key id;
+create dataset MyData2tmp(MyRecordtmp) primary key id;
+
+create dataset MyData1(MyRecord) primary key nested.id;
+create dataset MyData2(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-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
new file mode 100644
index 0000000..c256465
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
@@ -0,0 +1,51 @@
+/*
+ * Description    : Joins two datasets on the intersection of their point attributes.
+ *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the 
+ *                  join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+load dataset MyData1tmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+load dataset MyData2tmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
+
+insert into dataset MyData1
+(
+	for $c in dataset('MyData1tmp')
+	where $c.id < 10
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset MyData1
+(
+	for $c in dataset('MyData1tmp')
+	where $c.id >= 10
+	return {
+		"nested" : {
+			"id": $c.id,
+			"kwds": $c.kwds,
+			"line1": $c.line1,
+			"line2": $c.line2,
+			"poly1": $c.poly1,
+			"poly2": $c.poly2,
+			"rec": $c.rec,
+			"circle": $c.circle
+		}
+	}	
+);
+
+insert into dataset MyData2
+(
+	for $c in dataset('MyData2tmp')
+	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-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
new file mode 100644
index 0000000..601a07a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description    : Joins two datasets on the intersection of their point attributes.
+ *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+create index rtree_index on MyData1(nested.point:point) type rtree enforced;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
new file mode 100644
index 0000000..9e08b92
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
@@ -0,0 +1,14 @@
+/*
+ * Description    : Joins two datasets on the intersection of their point attributes.
+ *                  The dataset 'MyData1' has an  open enforced RTree index, and we expect the
+ *                  join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+for $a in dataset('MyData1')
+for $b in dataset('MyData2')
+where spatial-intersect($a.nested.point, $b.nested.point) and $a.nested.id != $b.nested.id
+order by $a.nested.id, $b.nested.id
+return {"aid": $a.nested.id, "bid": $b.nested.id, "apt": $a.nested.point, "bp": $b.nested.point}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
new file mode 100644
index 0000000..4cf3815
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
@@ -0,0 +1,48 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, 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 DBLPTypetmp as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPOpenType as open {
+  id: int64,
+  dblpid: 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 : DBLPOpenType
+}
+
+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-open-index/index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql
new file mode 100644
index 0000000..32aa353
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql
@@ -0,0 +1,45 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, 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 DBLPtmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"),("quote"="\u0000")) pre-sorted;
+
+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 $x in dataset DBLPtmp
+		where ($x.id<50)
+		return {
+			"nested" : $x
+		}
+);
+
+insert into dataset DBLP(
+	for $x in dataset DBLPtmp
+		where ($x.id>=50)
+		return {
+					"nested" : {
+						"id": $x.id,
+						"dblpid": $x.dblpid,
+						"authors": $x.title,
+						"misc": $x.misc
+					}
+				}
+);
+
+insert into dataset CSX(
+	for $x in dataset CSXtmp
+	return {
+		"nested": $x
+	}
+);
\ 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-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..859ed43
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, 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 keyword_index on DBLP(nested.title: string) type keyword enforced;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.4.query.aql
new file mode 100644
index 0000000..c78a0e2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.4.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, 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;
+
+for $a in dataset('DBLP')
+for $b in dataset('CSX')
+let $jacc := similarity-jaccard(word-tokens($a.nested.title), word-tokens($b.nested.title))
+where $jacc >= 0.5f and $a.nested.id < $b.nested.id
+order by $jacc, $a.nested.id, $b.nested.id
+return { "arec": $a.nested, "brec": $b.nested, "jacc": $jacc }
\ 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-open-index/index-join/word-jaccard/word-jaccard.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.1.ddl.aql
new file mode 100644
index 0000000..82691d7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.1.ddl.aql
@@ -0,0 +1,47 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, and 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 DBLPOpenType as open {
+  id: int64,
+  dblpid: 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 : DBLPOpenType
+}
+
+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-open-index/index-join/word-jaccard/word-jaccard.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.2.update.aql
new file mode 100644
index 0000000..b143198
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.2.update.aql
@@ -0,0 +1,44 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, and 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/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"),("quote"="\u0000")) pre-sorted;
+
+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 $x in dataset DBLPtmp
+		where ($x.id<50)
+		return {
+			"nested" : $x
+		}
+);
+
+insert into dataset DBLP(
+	for $x in dataset DBLPtmp
+		where ($x.id>=50)
+		return {
+					"nested" : {
+						"id": $x.id,
+						"dblpid": $x.dblpid,
+						"authors": $x.title,
+						"misc": $x.misc
+					}
+				}
+);
+
+insert into dataset CSX(
+	for $x in dataset CSXtmp
+	return {
+		"nested": $x
+	}
+);
\ 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-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql
new file mode 100644
index 0000000..49985f4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.4.query.aql
new file mode 100644
index 0000000..6613f68
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.4.query.aql
@@ -0,0 +1,14 @@
+/*
+ * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
+ *                  DBLP has a keyword index on title, and 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 similarity-jaccard(word-tokens($a.nested.title), word-tokens($b.nested.title)) >= 0.5f
+      and $a.nested.id < $b.nested.id
+order by $a.nested.id, $b.nested.id
+return { "arec": $a.nested, "brec": $b.nested }
\ 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-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
new file mode 100644
index 0000000..e5ffa0d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.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 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 open {
+	tweetid: int64,
+        user: TwitterUserType,
+        sender-location: point,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	message-text: string,
+	countA: int64
+}
+
+create type TweetMessageType as closed {
+	nested: TweetMessageNestedType
+}
+
+create dataset TweetMessages(TweetMessageType)
+primary key nested.tweetid;
+
+create dataset TweetMessagesTmp(TweetMessageNestedType)
+primary key tweetid;
+
+create index msgCountBIx on TweetMessages(nested.countB: int64) type btree enforced;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.2.update.aql
new file mode 100644
index 0000000..fed3bff
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.2.update.aql
@@ -0,0 +1,38 @@
+/*
+ * 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
+ */
+
+use dataverse test;
+
+load dataset TweetMessagesTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid < int64("125")
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid >= int64("125")
+	return {
+		"nested" : {
+				"tweetid": $c.tweetid,
+				"user": $c.user,
+				"sender-location": $c.sender-location,
+				"send-time": $c.send-time,
+				"referred-topics": $c.referred-topics,
+				"message-text": $c.message-text,
+				"countA": $c.countA
+			}
+	}	
+);
\ 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-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.3.query.aql
new file mode 100644
index 0000000..13c4ca9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.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 btree index in index subtree.
+ * Issue        : 730, 741
+ * Expected Res : Success
+ * Date         : 8th May 2014
+ */
+
+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}
+};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
new file mode 100644
index 0000000..bc3f12a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * 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 open {
+	tweetid: int64,
+        user: TwitterUserType,
+        sender-location: point,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	message-text: string,
+	countA: int64
+}
+
+create type TweetMessageType as closed {
+	nested: TweetMessageNestedType
+}
+
+create dataset TweetMessages(TweetMessageType)
+primary key nested.tweetid;
+
+create dataset TweetMessagesTmp(TweetMessageNestedType)
+primary key tweetid;
+
+create index msgCountBIx on TweetMessages(nested.countB: int64) type btree enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.2.update.aql
new file mode 100644
index 0000000..fed3bff
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.2.update.aql
@@ -0,0 +1,38 @@
+/*
+ * 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
+ */
+
+use dataverse test;
+
+load dataset TweetMessagesTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid < int64("125")
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid >= int64("125")
+	return {
+		"nested" : {
+				"tweetid": $c.tweetid,
+				"user": $c.user,
+				"sender-location": $c.sender-location,
+				"send-time": $c.send-time,
+				"referred-topics": $c.referred-topics,
+				"message-text": $c.message-text,
+				"countA": $c.countA
+			}
+	}	
+);
\ 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-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.3.query.aql
new file mode 100644
index 0000000..85992bb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.3.query.aql
@@ -0,0 +1,22 @@
+/*
+ * 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
+ */
+
+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 and
+                        $t1.nested.tweetid != $t2.nested.tweetid
+                        order by $t2.nested.tweetid
+                        return {"tweetid2": $t2.nested.tweetid,
+                                       "count2":$t2.nested.countB}
+};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
new file mode 100644
index 0000000..30ef9d2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * 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 open {
+	tweetid: int64,
+        user: TwitterUserType,
+        sender-location: point,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	countA: int64,
+	countB: int64
+}
+
+create type TweetMessageType as closed {
+	nested: TweetMessageNestedType
+}
+
+create dataset TweetMessages(TweetMessageType)
+primary key nested.tweetid;
+
+create dataset TweetMessagesTmp(TweetMessageNestedType)
+primary key tweetid;
+
+create index msgNgramIx on TweetMessages(nested.message-text: string) type ngram(3) enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.2.update.aql
new file mode 100644
index 0000000..ad35cf2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.2.update.aql
@@ -0,0 +1,38 @@
+/*
+ * 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
+ */
+
+use dataverse test;
+
+load dataset TweetMessagesTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid < int64("125")
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid >= int64("125")
+	return {
+		"nested" : {
+				"tweetid": $c.tweetid,
+				"user": $c.user,
+				"sender-location": $c.sender-location,
+				"send-time": $c.send-time,
+				"referred-topics": $c.referred-topics,
+				"countA": $c.countA,
+				"countB": $c.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-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.3.query.aql
new file mode 100644
index 0000000..1129424
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.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 keyword inverted index in index subtree.
+ * Issue        : 730, 741
+ * Expected Res : Success
+ * Date         : 16th May 2014
+ */
+
+use dataverse test;
+
+for $t1 in dataset('TweetMessagesTmp')
+where $t1.tweetid > int64("240")
+order by $t1.tweetid
+return {
+    "tweet": {"id": $t1.tweetid, "topics" : $t1.message-text} ,
+    "similar-tweets": for $t2 in dataset('TweetMessages')
+                      let $sim := edit-distance-check($t1.message-text, $t2.nested.message-text, 7)
+		      where $sim[0] and
+                      $t2.nested.tweetid != $t1.tweetid
+                      order by $t2.nested.tweetid
+                      return {"id": $t2.nested.tweetid, "topics" : $t2.nested.message-text}
+};
\ 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-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
new file mode 100644
index 0000000..3096914
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * 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 open {
+	tweetid: int64,
+        user: TwitterUserType,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	message-text: string,
+	countA: int64,
+	countB: int64
+}
+
+create type TweetMessageType as closed {
+	nested: TweetMessageNestedType
+}
+
+create dataset TweetMessages(TweetMessageType)
+primary key nested.tweetid;
+
+create dataset TweetMessagesTmp(TweetMessageNestedType)
+primary key tweetid;
+
+create index twmSndLocIx on TweetMessages(nested.sender-location: point) type rtree enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.2.update.aql
new file mode 100644
index 0000000..4dc5a12
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.2.update.aql
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+load dataset TweetMessagesTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid < int64("125")
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid >= int64("125")
+	return {
+		"nested" : {
+				"tweetid": $c.tweetid,
+				"user": $c.user,
+				"send-time": $c.send-time,
+				"referred-topics": $c.referred-topics,
+				"message-text": $c.message-text,
+				"countA": $c.countA,
+				"countB": $c.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-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.3.query.aql
new file mode 100644
index 0000000..5135a7b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.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-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
new file mode 100644
index 0000000..3096914
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * 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 open {
+	tweetid: int64,
+        user: TwitterUserType,
+	send-time: datetime,
+        referred-topics: {{ string }},
+	message-text: string,
+	countA: int64,
+	countB: int64
+}
+
+create type TweetMessageType as closed {
+	nested: TweetMessageNestedType
+}
+
+create dataset TweetMessages(TweetMessageType)
+primary key nested.tweetid;
+
+create dataset TweetMessagesTmp(TweetMessageNestedType)
+primary key tweetid;
+
+create index twmSndLocIx on TweetMessages(nested.sender-location: point) type rtree enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.2.update.aql
new file mode 100644
index 0000000..4dc5a12
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.2.update.aql
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+load dataset TweetMessagesTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_for_indexleftouterjoin.adm"),("format"="adm"));
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid < int64("125")
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset TweetMessages
+(
+	for $c in dataset('TweetMessagesTmp')
+	where $c.tweetid >= int64("125")
+	return {
+		"nested" : {
+				"tweetid": $c.tweetid,
+				"user": $c.user,
+				"send-time": $c.send-time,
+				"referred-topics": $c.referred-topics,
+				"message-text": $c.message-text,
+				"countA": $c.countA,
+				"countB": $c.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-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.3.query.aql
new file mode 100644
index 0000000..0e30905
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.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) and $t1.nested.tweetid != $t2.nested.tweetid
+                             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-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql
new file mode 100644
index 0000000..583475d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql
@@ -0,0 +1,35 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
+ *					 $l.fname <= "Micco" and $l.lname < "Vangieson"
+ * Expected Result : Success
+ * Issue           : Issue 174
+ * Date            : 5th Feb, 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type EmpTmp as closed {
+id:int64,
+fname:string,
+lname:string,
+age:int64,
+dept:string
+}
+
+create type Nested as open {
+id:int64,
+age:int64,
+dept:string
+}
+
+create type Emp as closed {
+nested : Nested
+}
+
+create dataset employeeTmp(EmpTmp) primary key id;
+
+create dataset employee(Emp) primary key nested.id;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql
new file mode 100644
index 0000000..93a864d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql
@@ -0,0 +1,42 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
+ *					 $l.fname <= "Micco" and $l.lname < "Vangieson"
+ * Expected Result : Success
+ * Issue           : Issue 174
+ * Date            : 5th Feb, 2013
+ */
+
+use dataverse test;
+
+load dataset employeeTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
+
+
+insert into dataset employee
+(
+	for $c in dataset('employeeTmp')
+	where $c.id <= 1000
+	return {
+		"nested" : {
+	  "id": $c.id,
+  	  "fname": $c.fname,
+  	  "lname": $c.lname,
+  	  "age": $c.age,
+  	  "dept": $c.dept }
+	}	
+);
+
+insert into dataset employee
+(
+	for $c in dataset('employeeTmp')
+	where $c.id > 1000
+	return {
+		"nested" : {
+	  "id": $c.id,
+  	  "age": $c.age,
+  	  "dept": $c.dept }
+	}	
+);
\ 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-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
new file mode 100644
index 0000000..b9c6331
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
@@ -0,0 +1,13 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
+ *					 $l.fname <= "Micco" and $l.lname < "Vangieson"
+ * Expected Result : Success
+ * Issue           : Issue 174
+ * Date            : 5th Feb, 2013
+ */
+
+use dataverse test;
+
+create index idx_employee_f_l_name on employee(nested.fname:string,nested.lname:string) enforced;
\ 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-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql
new file mode 100644
index 0000000..af13ac6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql
@@ -0,0 +1,16 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
+ *					 $l.fname <= "Micco" and $l.lname < "Vangieson"
+ * Expected Result : Success
+ * Issue           : Issue 174
+ * Date            : 5th Feb, 2013
+ */
+
+use dataverse test;
+
+for $l in dataset('employee')
+where $l.nested.fname > "Julio" and $l.nested.lname > "Mattocks" and $l.nested.fname <= "Micco" and $l.nested.lname < "Vangieson"
+order by $l.nested.id
+return $l.nested
\ 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-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
new file mode 100644
index 0000000..d17fd41
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
@@ -0,0 +1,34 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
+ * Expected Result : Success
+ * Issue           : Issue 162
+ * Date            : 7th August 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type EmpTmp as closed {
+id:int64,
+fname:string,
+lname:string,
+age:int64,
+dept:string
+}
+
+create type Nested as open {
+id:int64,
+age:int64,
+dept:string
+}
+
+create type Emp as closed {
+nested : Nested
+}
+
+create dataset employeeTmp(EmpTmp) primary key id;
+
+create dataset employee(Emp) primary key nested.id;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
new file mode 100644
index 0000000..cdb8190
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
@@ -0,0 +1,28 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
+ * Expected Result : Success
+ * Issue           : Issue 162
+ * Date            : 7th August 2012
+ */
+
+use dataverse test;
+
+load dataset employeeTmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
+
+
+insert into dataset employee
+(
+	for $c in dataset('employeeTmp')
+	return {
+		"nested" : {
+	  "id": $c.id,
+  	  "fname": $c.fname,
+  	  "lname": $c.lname,
+  	  "age": $c.age,
+  	  "dept": $c.dept }
+	}	
+);
\ 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-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
new file mode 100644
index 0000000..295bd0f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
+ * Expected Result : Success
+ * Issue           : Issue 162
+ * Date            : 7th August 2012
+ */
+
+use dataverse test;
+
+create index idx_employee_f_l_name on employee(nested.fname:string,nested.lname:string) enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
new file mode 100644
index 0000000..23d4fc3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
@@ -0,0 +1,15 @@
+/*
+ * Description     : Test that BTree index is used in query plan
+ *                 : define the BTree index on a composite key (fname,lanme)
+ *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
+ * Expected Result : Success
+ * Issue           : Issue 162
+ * Date            : 7th August 2012
+ */
+
+use dataverse test;
+
+for $l in dataset('employee')
+where $l.nested.fname = "Julio" and $l.nested.lname = "Isa"
+order by $l.nested.id
+return $l.nested

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
new file mode 100644
index 0000000..f9c51f9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
@@ -0,0 +1,42 @@
+/*
+ * Description     : Test that multiple subtrees in the same query
+ *                   can be rewritten with secondary BTree indexes.
+ *                   Guards against regression to issue 204.
+ * Expected Result : Success
+ * Issue           : Issue 204
+ */
+
+drop dataverse tpch if exists;
+create dataverse tpch;
+use dataverse tpch;
+
+create type OrderTypetmp as closed {
+  o_orderkey: int64,
+  o_custkey: int64,
+  o_orderstatus: string,
+  o_totalprice: double,
+  o_orderdate: string,
+  o_orderpriority: string,
+  o_clerk: string,
+  o_shippriority: int64,
+  o_comment: string
+}
+
+create type Nested as open {
+  o_orderkey: int64,
+  o_orderstatus: string,
+  o_totalprice: double,
+  o_orderdate: string,
+  o_orderpriority: string,
+  o_clerk: string,
+  o_shippriority: int64,
+  o_comment: string
+}
+
+create type OrderType as closed {
+nested : Nested
+}
+
+create dataset Orders(OrderType) primary key nested.o_orderkey;
+create dataset Orderstmp(OrderTypetmp) primary key o_orderkey;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql
new file mode 100644
index 0000000..769eea1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql
@@ -0,0 +1,50 @@
+/*
+ * Description     : Test that multiple subtrees in the same query
+ *                   can be rewritten with secondary BTree indexes.
+ *                   Guards against regression to issue 204.
+ * Expected Result : Success
+ * Issue           : Issue 204
+ */
+
+use dataverse tpch;
+
+load dataset Orderstmp
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
+
+insert into dataset Orders
+(
+	for $c in dataset('Orderstmp')
+	where $c.o_orderkey <= 4000
+	return {
+		"nested" : {
+  "o_orderkey": $c.o_orderkey,
+  "o_custkey": $c.o_custkey,
+  "o_orderstatus": $c.o_orderstatus,
+  "o_totalprice": $c.o_totalprice,
+  "o_orderdate": $c.o_orderdate,
+  "o_orderpriority": $c.o_orderpriority,
+  "o_clerk": $c.o_clerk,
+  "o_shippriority": $c.o_shippriority,
+  "o_comment": $c.o_comment
+}
+	}	
+);
+
+insert into dataset Orders
+(
+	for $c in dataset('Orderstmp')
+	where $c.o_orderkey > 4000
+	return {
+		"nested" : {
+  "o_orderkey": $c.o_orderkey,
+  "o_orderstatus": $c.o_orderstatus,
+  "o_totalprice": $c.o_totalprice,
+  "o_orderdate": $c.o_orderdate,
+  "o_orderpriority": $c.o_orderpriority,
+  "o_clerk": $c.o_clerk,
+  "o_shippriority": $c.o_shippriority,
+  "o_comment": $c.o_comment
+}
+	}	
+);
\ 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-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
new file mode 100644
index 0000000..41a951f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
@@ -0,0 +1,6 @@
+
+use dataverse tpch;
+
+// create secondary index on Orders(o_custkey)
+
+create index idx_Orders_Custkey on Orders(nested.o_custkey: int32) enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.4.query.aql
new file mode 100644
index 0000000..3324b2c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.4.query.aql
@@ -0,0 +1,24 @@
+/*
+ * Description     : Test that multiple subtrees in the same query
+ *                   can be rewritten with secondary BTree indexes.
+ *                   Guards against regression to issue 204.
+ * Expected Result : Success
+ * Issue           : Issue 204
+ */
+
+use dataverse tpch;
+
+for $o in dataset('Orders')
+for $o2 in dataset('Orders')
+where $o.nested.o_custkey = 20 and $o2.nested.o_custkey = 10
+and $o.nested.o_orderstatus < $o2.nested.o_orderstatus
+order by $o.nested.o_orderkey, $o2.nested.o_orderkey
+return {
+  "o_orderkey": $o.nested.o_orderkey,
+  "o_custkey": $o.nested.o_custkey,
+  "o_orderstatus": $o.nested.o_orderstatus,
+  "o_orderkey2": $o2.nested.o_orderkey,
+  "o_custkey2": $o2.nested.o_custkey,
+  "o_orderstatus2": $o2.nested.o_orderstatus
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
new file mode 100644
index 0000000..361a31b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
@@ -0,0 +1,30 @@
+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 DBLPOpenType as open {
+  id: int64,
+  dblpid: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPType as closed {
+nested : DBLPOpenType
+}
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLPtmp(DBLPTypetmp)
+  primary key id on group1;
+
+create dataset DBLP(DBLPType)
+  primary key nested.id on group1;
\ 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-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql
new file mode 100644
index 0000000..39a16d3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql
@@ -0,0 +1,28 @@
+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;
+
+insert into dataset DBLP
+(
+	for $c in dataset('DBLPtmp')
+	where $c.id <= 50
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset DBLP
+(
+	for $c in dataset('DBLPtmp')
+	where $c.id > 50
+	return {
+		"nested" : {
+			"id": $c.id,
+			"dblpid": $c.dblpid,
+			"authors": $c.authors,
+			"misc": $c.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-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
new file mode 100644
index 0000000..7baa5fb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
@@ -0,0 +1,6 @@
+
+use dataverse test;
+
+// create secondary index of type ngram on DBLP(title)
+
+create index ngram_index on DBLP(nested.title:string) type ngram(3) enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.4.query.aql
new file mode 100644
index 0000000..a106105
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.4.query.aql
@@ -0,0 +1,6 @@
+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-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.1.ddl.aql
new file mode 100644
index 0000000..9be4ac0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.1.ddl.aql
@@ -0,0 +1,31 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPOpenType as open {
+  id: int64,
+  dblpid: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPClosedType as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create type DBLPType as closed {
+nested : DBLPOpenType
+}
+
+create dataset DBLPtmp(DBLPClosedType)
+  primary key id on group1;
+
+create dataset DBLP(DBLPType)
+  primary key nested.id on group1;
+

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.2.update.aql
new file mode 100644
index 0000000..02c6cf6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.2.update.aql
@@ -0,0 +1,26 @@
+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;
+
+insert into dataset test.DBLP (
+	for $x in dataset test.DBLPtmp
+	where $x.id <= 50
+	return {
+		"nested": $x
+	}
+);
+
+insert into dataset test.DBLP (
+	for $c in dataset test.DBLPtmp
+	where $c.id > 50
+	return {
+		"nested":	{
+			"id": $c.id,
+			"dblpid": $c.dblpid,
+			"authors": $c.authors,
+			"misc": $c.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-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
new file mode 100644
index 0000000..4d5b8d2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.4.query.aql
new file mode 100644
index 0000000..a5242f1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.4.query.aql
@@ -0,0 +1,9 @@
+use dataverse test;
+
+for $paper in dataset('DBLP')
+where edit-distance-contains($paper.nested.title, "Multmedia", 1)[0]
+order by $paper.nested.id
+return {
+  "id" : $paper.nested.id,
+  "title" : $paper.nested.title
+}
\ 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-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
new file mode 100644
index 0000000..d45d39a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
@@ -0,0 +1,30 @@
+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 DBLPOpenType as open {
+  id: int64,
+  dblpid: string,
+  title: string,
+  misc: string
+}
+
+create type DBLPType as closed {
+nested : DBLPOpenType
+}
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLPtmp(DBLPTypetmp)
+  primary key id on group1;
+
+create dataset DBLP(DBLPType)
+  primary key nested.id on group1;
\ 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-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.2.update.aql
new file mode 100644
index 0000000..853e02d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.2.update.aql
@@ -0,0 +1,28 @@
+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;
+
+insert into dataset DBLP
+(
+	for $c in dataset('DBLPtmp')
+	where $c.id <= 50
+	return {
+		"nested" : $c
+	}	
+);
+
+insert into dataset DBLP
+(
+	for $c in dataset('DBLPtmp')
+	where $c.id > 50
+	return {
+		"nested" : {
+			"id": $c.id,
+			"dblpid": $c.dblpid,
+			"title": $c.title,
+			"misc": $c.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-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
new file mode 100644
index 0000000..8e7c66e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
@@ -0,0 +1,4 @@
+
+use dataverse test;
+
+create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.4.query.aql
new file mode 100644
index 0000000..3b6f6c1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.4.query.aql
@@ -0,0 +1,6 @@
+use dataverse test;
+
+for $o in dataset('DBLP')
+let $ed := edit-distance-check($o.nested.authors, "Amihay Motro", 5)
+where $ed[0]
+return $o.nested

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/04b2b77a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.1.ddl.aql
new file mode 100644
index 0000000..f83e132
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.1.ddl.aql
@@ -0,0 +1,32 @@
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type DBLPOpenType as open {
+  id: int64,
+  dblpid: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPClosedType as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create type DBLPType as closed {
+nested : DBLPOpenType
+}
+
+create dataset DBLPtmp(DBLPClosedType)
+  primary key id on group1;
+
+create dataset DBLP(DBLPType)
+  primary key nested.id on group1;
+


Mime
View raw message