Checkpoint #5 - A major checkpoint to fix runtimets.
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_result_distribution@1355 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
index a199655..9839997 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
@@ -29,5 +29,3 @@
create dataset Customers2(CustomerType) primary key cid;
-create index ngram_index on Customers(name) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
new file mode 100644
index 0000000..067e129
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * 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.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index ngram_index on Customers(name) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
index e7a958e..331eac8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
@@ -8,3 +8,4 @@
use dataverse test;
create index ngram_index on Customers(name) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql
index 1989a63..3e8cbdf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql
@@ -30,5 +30,3 @@
create dataset CSX(CSXType) primary key id;
-create index ngram_index on DBLP(title) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..55cfe1f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * 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.
+ * We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.1.ddl.aql
index 958185c..2f83f29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.1.ddl.aql
@@ -29,5 +29,3 @@
create dataset CSX(CSXType) primary key id;
-create index ngram_index on DBLP(title) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.3.ddl.aql
new file mode 100644
index 0000000..987a971
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * 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.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql
index ec9e8dd..85540fd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql
@@ -29,5 +29,3 @@
create dataset Customers2(CustomerType) primary key cid;
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.3.ddl.aql
new file mode 100644
index 0000000..4a1206f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, 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.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.1.ddl.aql
index e5848d9..f7184e3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.1.ddl.aql
@@ -28,5 +28,3 @@
create dataset Customers2(CustomerType) primary key cid;
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.3.ddl.aql
new file mode 100644
index 0000000..8aa959a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql
index 532477f..48d67bd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql
@@ -29,5 +29,3 @@
create dataset Customers2(CustomerType) primary key cid;
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..7e1363e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, 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.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.1.ddl.aql
index 44b619c..fd62a68 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.1.ddl.aql
@@ -28,5 +28,3 @@
create dataset Customers2(CustomerType) primary key cid;
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.3.ddl.aql
new file mode 100644
index 0000000..1aab524
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql
index 575f77a..2136ee7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql
@@ -16,5 +16,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..536a1c7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, 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.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.1.ddl.aql
index eafa308..621a16f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.1.ddl.aql
@@ -28,5 +28,3 @@
create dataset Customers2(CustomerType) primary key cid;
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.3.ddl.aql
new file mode 100644
index 0000000..08dd82d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
index 7635405..4b89bd3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
@@ -30,5 +30,3 @@
create dataset CSX(CSXType) primary key id;
-create index keyword_index on DBLP(title) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.2.update.aql
index 38d3d8f..0a2a629 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.2.update.aql
@@ -8,7 +8,6 @@
use dataverse test;
-
load dataset DBLP
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..b403681
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
@@ -0,0 +1,12 @@
+/*
+ * 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.
+ * We expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.1.ddl.aql
index a8c105d..4ede1c3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.1.ddl.aql
@@ -29,5 +29,3 @@
create dataset CSX(CSXType) primary key id;
-create index keyword_index on DBLP(title) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.3.ddl.aql
new file mode 100644
index 0000000..8539f7c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.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 expect the top-level equi join introduced because of surrogate optimization to be removed, since it is not necessary.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
index f68bc90..8937d31 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.1.ddl.aql
@@ -7,7 +7,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as open {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
index 635a02e..7943637 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
@@ -5,7 +5,6 @@
* Success : Yes
*/
-
use dataverse test;
load dataset Customers
@@ -16,5 +15,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-create index ngram_index on Customers(name) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
new file mode 100644
index 0000000..6e89a58
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-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(name) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
index 0fe2b47..85ffd04 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
@@ -6,7 +6,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as open {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.2.update.aql
index 30cfdec..2b2b0a7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.2.update.aql
@@ -14,4 +14,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
index e4c62b1..e1a575c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
@@ -1,3 +1,10 @@
+/*
+ * 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.
+ * Success : Yes
+ */
+
use dataverse test;
create index ngram_index on Customers(name) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql
index 8b56f37..3a23b8b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.1.ddl.aql
@@ -7,7 +7,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type DBLPType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql
index 2cb5ea3..8fbfdb9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql
@@ -15,5 +15,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-create index ngram_index on DBLP(title) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..f033aac
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-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' 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.
+ * 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 DBLP(title) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.1.ddl.aql
index 5a1b6c7..ca6ba44 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.1.ddl.aql
@@ -6,7 +6,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type DBLPType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.2.update.aql
index e441143..93233c1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.2.update.aql
@@ -14,5 +14,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-create index ngram_index on DBLP(title) type ngram(3);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
new file mode 100644
index 0000000..7ca5559
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-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(title) type ngram(3);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql
index 0682edf..4888062 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.1.ddl.aql
@@ -7,7 +7,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as open {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql
index 8e868df..c3af774 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql
@@ -15,5 +15,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.3.ddl.aql
new file mode 100644
index 0000000..93801ae
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-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 interest lists.
+ * Customers has a keyword index on interests, 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 interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.1.ddl.aql
index 9bee585..ee77aef 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.1.ddl.aql
@@ -6,7 +6,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as open {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.2.update.aql
index 6f94bef..e846058 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.2.update.aql
@@ -14,5 +14,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.3.ddl.aql
new file mode 100644
index 0000000..23753d7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.3.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the edit-distance function of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance/olist-edit-distance.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql
index c1703df..d920ee7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.1.ddl.aql
@@ -7,7 +7,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.2.update.aql
index c6bb575..575be21 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.2.update.aql
@@ -15,5 +15,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..85e97a1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, 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 interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.1.ddl.aql
index 671b651..a40bfc8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.1.ddl.aql
@@ -6,7 +6,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.2.update.aql
index b9b8a43..e86922d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.2.update.aql
@@ -14,5 +14,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.3.ddl.aql
new file mode 100644
index 0000000..fa43878
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.3.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest lists.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard/olist-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql
index 1b24b5b..97c776b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql
@@ -7,7 +7,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as closed {
@@ -28,3 +27,4 @@
create dataset Customers(CustomerType) primary key cid;
create dataset Customers2(CustomerType) primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql
index 37fecd9..3c344a0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.2.update.aql
@@ -15,5 +15,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..206215a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, 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 interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.1.ddl.aql
index 9c8c3a2..dc3c320 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.1.ddl.aql
@@ -6,7 +6,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type AddressType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.2.update.aql
index adaa5e8..7a61d5cf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.2.update.aql
@@ -14,5 +14,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-create index interests_index on Customers(interests) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.3.ddl.aql
new file mode 100644
index 0000000..de55309
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.3.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : Fuzzy joins two datasets, Customers and Customers2, based on the Jaccard similarity of their interest sets.
+ * Customers has a keyword index on interests, and we expect the join to be transformed into an indexed nested-loop join.
+ * Success : Yes
+ */
+
+use dataverse test;
+
+create index interests_index on Customers(interests) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
index 561303f..719949b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.1.ddl.aql
@@ -7,7 +7,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type DBLPType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql
index 8062fe6..3064796 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.2.update.aql
@@ -15,5 +15,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-create index keyword_index on DBLP(title) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
new file mode 100644
index 0000000..b8fbe01
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-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(title) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline/word-jaccard-inline.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.1.ddl.aql
index eee20ab..c134018 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.1.ddl.aql
@@ -6,7 +6,6 @@
drop dataverse test if exists;
create dataverse test;
-
use dataverse test;
create type DBLPType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.2.update.aql
index 02bcaa22..5a307f6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.2.update.aql
@@ -14,5 +14,3 @@
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-create index keyword_index on DBLP(title) type keyword;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.3.ddl.aql
new file mode 100644
index 0000000..092ca3e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-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(title) type keyword;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard/word-jaccard.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccar/olist-jaccar.1.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccar/olist-jaccar.1.adm
rename to asterix-app/src/test/resources/runtimets/results/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccar/ngram-jaccar.1.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard/ngram-jaccard.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccar/ngram-jaccar.1.adm
rename to asterix-app/src/test/resources/runtimets/results/inverted-index-join/ngram-jaccard/ngram-jaccard.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccar/olist-jaccar.1.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard/olist-jaccard.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccar/olist-jaccar.1.adm
rename to asterix-app/src/test/resources/runtimets/results/inverted-index-join/olist-jaccard/olist-jaccard.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccar/ulist-jaccar.1.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard/ulist-jaccard.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccar/ulist-jaccar.1.adm
rename to asterix-app/src/test/resources/runtimets/results/inverted-index-join/ulist-jaccard/ulist-jaccard.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccar/word-jaccar.1.adm b/asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard/word-jaccard.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccar/word-jaccar.1.adm
rename to asterix-app/src/test/resources/runtimets/results/inverted-index-join/word-jaccard/word-jaccard.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index d8f9bbb..cd86986 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -3515,7 +3515,7 @@
</test-case>
<test-case FilePath="tpch">
<compilation-unit name="q10_returned_item_int64">
- <output-dir compare="Text">q10_returned_item_int64</output-dir>
+ <output-dir compare="Text">q10_returned_item_int64</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="tpch">