Checkpoint #1 to fix runtimets.

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_result_distribution@1349 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java
index 1ae3054..6e75a82 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java
@@ -30,7 +30,7 @@
     }
 
     protected List<Statement.Kind> getAllowedStatements() {
-        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.DATAVERSE_DROP, Kind.FUNCTION_DECL, Kind.NODEGROUP_DECL,
+        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.DATAVERSE_DROP, Kind.DATASET_DECL, Kind.NODEGROUP_DECL,
                 Kind.NODEGROUP_DROP, Kind.TYPE_DECL, Kind.TYPE_DROP, Kind.CREATE_INDEX, Kind.INDEX_DECL,
                 Kind.CREATE_DATAVERSE, Kind.INDEX_DROP, Kind.CREATE_FUNCTION, Kind.FUNCTION_DROP };
         return Arrays.asList(statementsArray);
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java
index a893bd6..32d388b 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java
@@ -30,8 +30,8 @@
     }
 
     protected List<Statement.Kind> getAllowedStatements() {
-        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.QUERY, Kind.SET, Kind.WRITE, Kind.BEGIN_FEED,
-                Kind.CONTROL_FEED };
+        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.FUNCTION_DECL, Kind.QUERY, Kind.SET, Kind.WRITE,
+                Kind.BEGIN_FEED, Kind.CONTROL_FEED };
         return Arrays.asList(statementsArray);
     }
 
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java
index 7336876..f448c22 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java
@@ -30,8 +30,8 @@
     }
 
     protected List<Statement.Kind> getAllowedStatements() {
-        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.DATASET_DECL, Kind.DATASET_DROP, Kind.DELETE, Kind.INSERT,
-                Kind.UPDATE, Kind.DML_CMD_LIST, Kind.LOAD_FROM_FILE, Kind.WRITE_FROM_QUERY_RESULT };
+        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.DATASET_DROP, Kind.DELETE, Kind.INSERT, Kind.UPDATE,
+                Kind.DML_CMD_LIST, Kind.LOAD_FROM_FILE, Kind.WRITE_FROM_QUERY_RESULT };
         return Arrays.asList(statementsArray);
     }
 
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
index 6e70845..c1d7666 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -134,7 +134,7 @@
     // create index statement
     // create dataverse statement
     // create function statement
-    public void executeDDLUpdate(String str) throws Exception {
+    public void executeDDL(String str) throws Exception {
         final String url = "http://localhost:19101/ddl";
 
         // Create an instance of HttpClient.
@@ -151,6 +151,11 @@
         // Execute the method.
         int statusCode = client.executeMethod(method);
 
+        // Read the response body as String.
+        String responseBody = method.getResponseBodyAsString();
+
+        System.out.println(responseBody);
+
         // Check if the method was executed successfully.
         if (statusCode != HttpStatus.SC_OK) {
             System.err.println("Method failed: " + method.getStatusLine());
@@ -176,6 +181,11 @@
         // Execute the method.
         int statusCode = client.executeMethod(method);
 
+        // Read the response body as String.
+        String responseBody = method.getResponseBodyAsString();
+
+        System.out.println(responseBody);
+
         // Check if the method was executed successfully.
         if (statusCode != HttpStatus.SC_OK) {
             System.err.println("Method failed: " + method.getStatusLine());
@@ -212,6 +222,8 @@
             // Read the response body as String.
             String responseBody = method.getResponseBodyAsString();
 
+            System.out.println(responseBody);
+
             JSONObject jsonObj = new JSONObject(responseBody);
 
             jArray = jsonObj.getJSONArray("results");
@@ -245,13 +257,12 @@
                 try {
                     switch (ctx.getType()) {
                         case "ddl":
-                            executeDDLUpdate(statement);
+                            executeDDL(statement);
                             break;
                         case "update":
                             executeUpdate(statement);
                             break;
                         case "query":
-                            System.out.println("Executing this part");
                             resultsArray = executeQuery(statement);
                             expectedResultFile = expectedResultFileCtxs.get(queryCount).getFile();
                             queryCount++;
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_double_null/avg_double_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_double_null/avg_double_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_double_null/avg_double_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_double_null/avg_double_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02/avg_empty_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02/avg_empty_02.1.ddl.aql
index 7ace66f..62c5ca6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02/avg_empty_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02/avg_empty_02.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as closed {
   id: int32,
   val: double
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_float_null/avg_float_nu.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_float_null/avg_float_nu.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_float_null/avg_float_nu.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_float_null/avg_float_nu.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int16_null/avg_int16_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int16_null/avg_int16_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int16_null/avg_int16_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int16_null/avg_int16_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int32_null/avg_int32_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int32_null/avg_int32_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int32_null/avg_int32_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int32_null/avg_int32_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int64_null/avg_int64_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int64_null/avg_int64_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int64_null/avg_int64_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int64_null/avg_int64_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int8_null/avg_int8_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int8_null/avg_int8_null.1.ddl.aql
index ba1bb8f..5cf8ddf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int8_null/avg_int8_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_int8_null/avg_int8_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_double_null/local-avg_double_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_double_null/local-avg_double_null.1.ddl.aql
index 1590bae..087f8d6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_double_null/local-avg_double_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_double_null/local-avg_double_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_float_null/local-avg_float_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_float_null/local-avg_float_null.1.ddl.aql
index fcf1327..9048124a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_float_null/local-avg_float_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_float_null/local-avg_float_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16/local-avg_int16.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16/local-avg_int16.1.ddl.aql
index c01b9e9..56e96a6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16/local-avg_int16.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16/local-avg_int16.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 local-avg( 
  for $x in [int16("1"), int16("2"), int16("3")] 
  return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16_null/local-avg_int16_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16_null/local-avg_int16_null.1.ddl.aql
index 6bf1a63..685febc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16_null/local-avg_int16_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int16_null/local-avg_int16_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.1.ddl.aql
index 7aae44e..53a7daa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
@@ -14,5 +16,4 @@
 
 create external dataset Numeric(NumericType)
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/nontagged/numericData.json"),("format"="adm"));
-
+(("path"="nc1://data/nontagged/numericData.json"),("format"="adm"));
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.2.update.aql
index f0c597a..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int32_null/local-avg_int32_null.2.update.aql
@@ -1 +0,0 @@
-// no inserts deletes here
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int64_null/local-avg_int64_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int64_null/local-avg_int64_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int64_null/local-avg_int64_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int64_null/local-avg_int64_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int8_null/local-avg_int8_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int8_null/local-avg_int8_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int8_null/local-avg_int8_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/local-avg_int8_null/local-avg_int8_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02/max_empty_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02/max_empty_02.1.ddl.aql
index 64fed95..94fd061 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02/max_empty_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02/max_empty_02.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as closed {
   id: int32,
   val: double
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02/min_empty_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02/min_empty_02.1.ddl.aql
index 2efa226..6f88fe5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02/min_empty_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02/min_empty_02.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as closed {
   id: int32,
   val: double
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty/scalar_min_empty.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty/scalar_min_empty.1.ddl.aql
index f00d4fb..d4de7aa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty/scalar_min_empty.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_min_empty/scalar_min_empty.1.ddl.aql
@@ -6,4 +6,6 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 min([ ])
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty/scalar_sum_empty.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty/scalar_sum_empty.1.ddl.aql
index 99f95c0..3d954c1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty/scalar_sum_empty.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/scalar_sum_empty/scalar_sum_empty.1.ddl.aql
@@ -6,4 +6,6 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 sum([ ])
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02/sum_empty_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02/sum_empty_02.1.ddl.aql
index 492e826..6679a19 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02/sum_empty_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02/sum_empty_02.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as closed {
   id: int32,
   val: double
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_float_null/sum_float_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_float_null/sum_float_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_float_null/sum_float_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_float_null/sum_float_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int16_null/sum_int16_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int16_null/sum_int16_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int16_null/sum_int16_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int16_null/sum_int16_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int32_null/sum_int32_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int32_null/sum_int32_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int32_null/sum_int32_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int32_null/sum_int32_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64/sum_int64.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64/sum_int64.1.ddl.aql
index a42e545..247c983 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64/sum_int64.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64/sum_int64.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 sum( 
  for $x in [int64("1"), int64("2"), int64("3")] 
  return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64_null/sum_int64_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64_null/sum_int64_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64_null/sum_int64_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int64_null/sum_int64_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8/sum_int8.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8/sum_int8.1.ddl.aql
index 0f15519..4c7f01d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8/sum_int8.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8/sum_int8.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 sum( 
  for $x in [int8("1"), int8("2"), int8("3")] 
  return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8_null/sum_int8_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8_null/sum_int8_null.1.ddl.aql
index 7aae44e..7cdcbea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8_null/sum_int8_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_int8_null/sum_int8_null.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred/sum_null-with-pred.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred/sum_null-with-pred.1.ddl.aql
index b0f2ca5..63a57f0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred/sum_null-with-pred.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred/sum_null-with-pred.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 id:int32,
 sal:int32?
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null/sum_numeric_null.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null/sum_numeric_null.1.ddl.aql
index 6be5fe1..d61f490 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null/sum_numeric_null.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null/sum_numeric_null.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 id:int32,
 sal:int32?
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range/datetime_range.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range/datetime_range.1.ddl.aql
index cd003fb..9d55e6a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range/datetime_range.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range/datetime_range.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type Tweet as closed {
         id: int32,
         tweetid: int64,
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01/cross-dv01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01/cross-dv01.1.ddl.aql
index 746f986..df976b2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01/cross-dv01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01/cross-dv01.1.ddl.aql
@@ -12,6 +12,9 @@
 create dataverse student;
 create dataverse teacher;
 
+use dataverse student;
+use dataverse teacher;
+
 create type student.stdType as open {
 id : int32,
 name : string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03/cross-dv03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03/cross-dv03.1.ddl.aql
index f9fd731..a601ac5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03/cross-dv03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03/cross-dv03.1.ddl.aql
@@ -14,6 +14,9 @@
 create dataverse student;
 create dataverse teacher;
 
+use dataverse student;
+use dataverse teacher;
+
 create type student.stdType as open {
 id : int32,
 name : string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04/cross-dv04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04/cross-dv04.1.ddl.aql
index b2937c6..fb5214a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04/cross-dv04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04/cross-dv04.1.ddl.aql
@@ -15,6 +15,9 @@
 create dataverse student;
 create dataverse teacher;
 
+use dataverse student;
+use dataverse teacher;
+
 create type student.stdType as open {
 id : int32,
 name : string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset/drop_dataset.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset/drop_dataset.1.ddl.aql
index 359588a..716f6a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset/drop_dataset.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset/drop_dataset.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type test.AddressType as open {
   number: int32,
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset/insert_from_source_dataset.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset/insert_from_source_dataset.1.ddl.aql
index 23e88eb..9cdce99 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset/insert_from_source_dataset.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset/insert_from_source_dataset.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type test.testtype as open {
 id : int32,
 name : string
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/co/co.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/co/co.1.ddl.aql
index d0de6ff..f4ab3a7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/co/co.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/co/co.1.ddl.aql
@@ -36,3 +36,10 @@
   orders: [OrderType]
 }
 
+create dataset Customers3(CustomerType) 
+  primary key cid;
+create dataset Orders3(OrderType)
+  primary key oid;
+create dataset CustomerOrders3(CustomerOrdersType)
+  primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/co/co.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/co/co.2.update.aql
index f3209c6..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/co/co.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/co/co.2.update.aql
@@ -1,9 +0,0 @@
-use dataverse custord;
-
-create dataset Customers3(CustomerType) 
-  primary key cid;
-create dataset Orders3(OrderType)
-  primary key oid;
-create dataset CustomerOrders3(CustomerOrdersType)
-  primary key cid;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_01/customer_q_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_01/customer_q_01.1.ddl.aql
index 3b6d38c..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_01/customer_q_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_01/customer_q_01.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_02/customer_q_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_02/customer_q_02.1.ddl.aql
index 3b6d38c..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_02/customer_q_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_02/customer_q_02.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_03/customer_q_03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_03/customer_q_03.1.ddl.aql
index 3b6d38c..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_03/customer_q_03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_03/customer_q_03.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_04/customer_q_04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_04/customer_q_04.1.ddl.aql
index 3b6d38c..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_04/customer_q_04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_04/customer_q_04.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_05/customer_q_05.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_05/customer_q_05.1.ddl.aql
index 3b6d38c..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_05/customer_q_05.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_05/customer_q_05.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_06/customer_q_06.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_06/customer_q_06.1.ddl.aql
index 6a0edf7..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_06/customer_q_06.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_06/customer_q_06.1.ddl.aql
@@ -2,6 +2,7 @@
 
 create dataverse test;
 
+use dataverse test;
 
 create type AddressType as open {
   number: int32, 
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_07/customer_q_07.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_07/customer_q_07.1.ddl.aql
index 256f1f3..c937318 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_07/customer_q_07.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_07/customer_q_07.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_08/customer_q_08.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_08/customer_q_08.1.ddl.aql
index 3b6d38c..b0f4e93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_08/customer_q_08.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/customer_q_08/customer_q_08.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.1.ddl.aql
index 4a5a78d..197b7f1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -34,3 +36,10 @@
   orders: [OrderType]
 }
 
+create dataset Customers1(CustomerType) 
+  primary key cid;
+create dataset Orders1(OrderType)
+  primary key oid;
+create dataset CustomerOrders1(CustomerOrdersType)
+  primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.2.update.aql
index 41ae6d4..5ebc4ea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01/denorm-cust-order_01.2.update.aql
@@ -1,12 +1,5 @@
 use dataverse test;
 
-create dataset Customers1(CustomerType) 
-  primary key cid;
-create dataset Orders1(OrderType)
-  primary key oid;
-create dataset CustomerOrders1(CustomerOrdersType)
-  primary key cid;
-
 load dataset Customers1 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/custord-tiny/customer-tiny.adm"),("format"="adm")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.1.ddl.aql
index 05ca61b..eae0d26 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -33,3 +35,11 @@
   cust: CustomerType,
   orders: [OrderType]
 }
+
+create dataset Customers2(CustomerType) 
+  primary key cid;
+create dataset Orders2(OrderType)
+  primary key oid;
+create dataset CustomerOrders2(CustomerOrdersType)
+  primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.2.update.aql
index 850499c..fdbfa62 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.2.update.aql
@@ -1,12 +1,5 @@
 use dataverse test;
 
-create dataset Customers2(CustomerType) 
-  primary key cid;
-create dataset Orders2(OrderType)
-  primary key oid;
-create dataset CustomerOrders2(CustomerOrdersType)
-  primary key cid;
-
 load dataset Customers2 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/custord-tiny/customer-tiny.adm"),("format"="adm")) pre-sorted;
@@ -15,3 +8,14 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/custord-tiny/order-tiny.adm"),("format"="adm")) pre-sorted;
 
+write into dataset CustomerOrders2 (
+
+for $c in dataset('Customers2')
+let $orders := 
+  for $o in dataset('Orders2')
+  where $o.cid = $c.cid
+  order by $o.oid asc
+  return $o
+return { "cid": $c.cid, "cust": $c, "orders": $orders }
+
+);
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.3.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.4.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.3.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.3.update.aql
deleted file mode 100644
index 98d9158..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02/denorm-cust-order_02.3.update.aql
+++ /dev/null
@@ -1,17 +0,0 @@
-use dataverse test;
-
-write into dataset CustomerOrders2 (
-
-for $c in dataset('Customers2')
-let $orders := 
-  for $o in dataset('Orders2')
-  where $o.cid = $c.cid
-  order by $o.oid asc
-  return $o
-return { "cid": $c.cid, "cust": $c, "orders": $orders }
-
-);
-
-for $co in dataset('CustomerOrders2')
-order by $co.cid
-return $co
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.1.ddl.aql
index 4a5a78d..4530250 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -34,3 +36,10 @@
   orders: [OrderType]
 }
 
+create dataset Customers3(CustomerType) 
+  primary key cid;
+create dataset Orders3(OrderType)
+  primary key oid;
+create dataset CustomerOrders3(CustomerOrdersType)
+  primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.2.update.aql
index 6715c7f..f19ba50 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03/denorm-cust-order_03.2.update.aql
@@ -1,12 +1,5 @@
 use dataverse test;
 
-create dataset Customers3(CustomerType) 
-  primary key cid;
-create dataset Orders3(OrderType)
-  primary key oid;
-create dataset CustomerOrders3(CustomerOrdersType)
-  primary key cid;
-
 load dataset Customers3 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/custord-tiny/customer-tiny.adm"),("format"="adm")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.1.ddl.aql
index 3eec488..07ce2ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -25,3 +27,6 @@
   total: float
 }
 
+create dataset CustomerOrders(CustomerOrderType) 
+  primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.2.update.aql
index e26170e..073bca9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk/freq-clerk.2.update.aql
@@ -1,9 +1,5 @@
 use dataverse test;
 
-create dataset CustomerOrders(CustomerOrderType) 
-  primary key cid;
-
-
 load dataset CustomerOrders
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/custord-tiny/custorder-tiny.adm"),("format"="adm")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/join_q_02/join_q_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/join_q_02/join_q_02.1.ddl.aql
index 5ac99bf..0421884 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/join_q_02/join_q_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/join_q_02/join_q_02.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/join_q_03/join_q_03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/join_q_03/join_q_03.1.ddl.aql
index 9ee8c32..787d3c5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/join_q_03/join_q_03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/join_q_03/join_q_03.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/join_q_04/join_q_04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/join_q_04/join_q_04.1.ddl.aql
index 6689bb4..1baeefc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/join_q_04/join_q_04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/join_q_04/join_q_04.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.1.ddl.aql
index 6a28f0d..c0f97c9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.1.ddl.aql
@@ -2,6 +2,8 @@
   
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -19,3 +21,8 @@
   }
 }
 
+create dataset c1(CustomerType) 
+  primary key cid;
+create dataset c2(CustomerType) 
+  primary key cid;  
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.2.update.aql
index 7c32303..a395f03 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/oad-test/oad-test.2.update.aql
@@ -1,10 +1,4 @@
 use dataverse test;
-
-
-create dataset c1(CustomerType) 
-  primary key cid;
-create dataset c2(CustomerType) 
-  primary key cid;  
   
 load dataset c1 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_01/order_q_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_01/order_q_01.1.ddl.aql
index f0b6c27..9aa3759 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_01/order_q_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_01/order_q_01.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type OrderType as open {
   oid: int32,
   cid: int32,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_02/order_q_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_02/order_q_02.1.ddl.aql
index f0b6c27..9aa3759 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_02/order_q_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_02/order_q_02.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type OrderType as open {
   oid: int32,
   cid: int32,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_03/order_q_03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_03/order_q_03.1.ddl.aql
index f0b6c27..9aa3759 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_03/order_q_03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_03/order_q_03.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type OrderType as open {
   oid: int32,
   cid: int32,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_04/order_q_04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_04/order_q_04.1.ddl.aql
index f0b6c27..9aa3759 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_04/order_q_04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_04/order_q_04.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type OrderType as open {
   oid: int32,
   cid: int32,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_05/order_q_05.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_05/order_q_05.1.ddl.aql
index f0b6c27..9aa3759 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_05/order_q_05.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_05/order_q_05.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type OrderType as open {
   oid: int32,
   cid: int32,
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_06/order_q_06.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_06/order_q_06.1.ddl.aql
index f0b6c27..9aa3759 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/order_q_06/order_q_06.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/order_q_06/order_q_06.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type OrderType as open {
   oid: int32,
   cid: int32,
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-cltype/create-drop-cltype.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-cltype/create-drop-cltype.1.ddl.aql
index 19e9268..0889497 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-cltype/create-drop-cltype.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-cltype/create-drop-cltype.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as closed {
 id : int32,
 salary : double ?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-opntype/create-drop-opntype.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-opntype/create-drop-opntype.1.ddl.aql
index 1eb5b41..e2a2218 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-opntype/create-drop-opntype.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/create-drop-opntype/create-drop-opntype.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 id : int32,
 salary : double ?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.1.ddl.aql
index 38a20e6..dcf3081 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -20,3 +22,6 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.2.update.aql
index bffc484..169c6dc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.2.update.aql
@@ -1,13 +1,6 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
-delete $l from dataset LineItem where $l.l_suppkey>=2 or $l.l_linenumber>1;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.3.ddl.aql
new file mode 100644
index 0000000..a3572c4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.3.ddl.aql
@@ -0,0 +1,5 @@
+use dataverse test;
+
+create index idx_LineItem_partkey on LineItem(l_linenumber);
+create index idx_LineItem_suppkey on LineItem(l_suppkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.4.update.aql
new file mode 100644
index 0000000..57d42c7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.4.update.aql
@@ -0,0 +1,3 @@
+use dataverse test;
+
+delete $l from dataset LineItem where $l.l_suppkey>=2 or $l.l_linenumber>1;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index/delete-from-loaded-dataset-with-index.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.1.ddl.aql
index 38a20e6..dcf3081 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -20,3 +22,6 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.2.update.aql
index 39886c5..06c0e6e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset/delete-from-loaded-dataset.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
index ae1d53f..af8f573 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 id : int32,
 name : string,
@@ -15,3 +17,17 @@
 zip : string
 }
 
+create dataset t1(TestType) primary key id;
+
+create index rtree_index_point on t1(locn) type rtree;
+
+create index keyWD_indx on t1(name) type keyword;
+
+create index secndIndx on t1(zip);
+
+drop index t1.rtree_index_point;
+
+drop index t1.keyWD_indx;
+
+drop index t1.secndIndx;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.2.update.aql
index dfd013c..19dfe4a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.2.update.aql
@@ -5,19 +5,3 @@
  *
  */
 
-use dataverse test;
-
-create dataset t1(TestType) primary key id;
-
-create index rtree_index_point on t1(locn) type rtree;
-
-create index keyWD_indx on t1(name) type keyword;
-
-create index secndIndx on t1(zip);
-
-drop index t1.rtree_index_point;
-
-drop index t1.keyWD_indx;
-
-drop index t1.secndIndx;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.1.ddl.aql
index 57a09a2..dfbc033 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type Schema as closed {
 unique1:  int32,
 unique2:  int32,
@@ -27,3 +29,5 @@
 string4:  string
 }
 
+create dataset t1(Schema) primary key unique2;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.2.update.aql
index a7162a2..ae67969 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.2.update.aql
@@ -7,18 +7,8 @@
 
 use dataverse test;
 
-create dataset t1(Schema) primary key unique2;
-
 // Load data
 load dataset t1
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/wisc/onektup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-// create secondary indexes
-create index idx_t1_str1 on t1(stringu1);
-create index idx_t1_unique1 on t1(unique1);
-
-// drop secondary indexes
-drop index t1.idx_t1_str1;
-drop index t1.idx_t1_unique1;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.3.ddl.aql
new file mode 100644
index 0000000..7442100
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.3.ddl.aql
@@ -0,0 +1,10 @@
+use dataverse test;
+
+// create secondary indexes
+create index idx_t1_str1 on t1(stringu1);
+create index idx_t1_unique1 on t1(unique1);
+
+// drop secondary indexes
+drop index t1.idx_t1_str1;
+drop index t1.idx_t1_unique1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/drop-index/drop-index.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.1.ddl.aql
index 0d83da3..356aafb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -27,3 +29,8 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create index part_index on LineItem(l_partkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.2.update.aql
index f570282..821c6a3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index/empty-load-with-index.2.update.aql
@@ -7,12 +7,6 @@
 
 use dataverse test;
 
-
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create index part_index on LineItem(l_partkey);
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/empty.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.1.ddl.aql
index 6d5b0aa..54da1a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -27,3 +29,8 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create index part_index on LineItem(l_partkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.2.update.aql
index 65ebe26..e9072d1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load/empty-load.2.update.aql
@@ -7,12 +7,6 @@
 
 use dataverse test;
 
-
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create index part_index on LineItem(l_partkey);
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/empty.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.1.ddl.aql
index 250bd43..0042cdf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.1.ddl.aql
@@ -8,9 +8,17 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineIDType as closed {
   l_orderkey: int32, 
   l_linenumber: int32, 
   l_suppkey: int32
 }
 
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+
+create index idx_LineID_partkey on LineID(l_linenumber);
+create index idx_LineID_suppkey on LineID(l_suppkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.2.update.aql
index bf160bb..52752bf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index/insert-into-empty-dataset-with-index.2.update.aql
@@ -7,12 +7,6 @@
 
 use dataverse test;
 
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
-create index idx_LineID_partkey on LineID(l_linenumber);
-create index idx_LineID_suppkey on LineID(l_suppkey);
-
 insert into dataset LineID (
 let $x:=1
 let $y:=2
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.1.ddl.aql
index f6f7435..3241b68 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.1.ddl.aql
@@ -8,9 +8,14 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineIDType as closed {
   l_orderkey: int32, 
   l_linenumber: int32, 
   l_suppkey: int32
 }
 
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.2.update.aql
index 376f1d8..08e99af 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset/insert-into-empty-dataset.2.update.aql
@@ -7,9 +7,6 @@
 
 use dataverse test;
 
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 insert into dataset LineID (
 let $x:=1
 let $y:=2
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql
index e58236a..c8d1ee5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.1.ddl.aql
@@ -1,10 +1,14 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineIDType as closed {
   l_orderkey: int32, 
   l_linenumber: int32, 
   l_suppkey: int32
 }
 
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql
index 4ce7bc8..a0cdc06 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.2.update.aql
@@ -1,34 +1,6 @@
 use dataverse test;
 
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineID 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_LineID_partkey on LineID(l_linenumber);
-create index idx_LineID_suppkey on LineID(l_suppkey);
-
-insert into dataset LineID (
-let $x:=1
-let $y:=2
-let $z:=3
-return {
-	"l_orderkey": $x,
-	"l_linenumber": $y,
-	"l_suppkey": $z
-}
-);
-
-insert into dataset LineID (
-let $x:=2
-let $y:=3
-let $z:=4
-return {
-	"l_orderkey": $x,
-	"l_linenumber": $y,
-	"l_suppkey": $z
-}
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql
new file mode 100644
index 0000000..1eb348a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.ddl.aql
@@ -0,0 +1,5 @@
+use dataverse test;
+
+create index idx_LineID_partkey on LineID(l_linenumber);
+create index idx_LineID_suppkey on LineID(l_suppkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql
new file mode 100644
index 0000000..f138dbb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.4.update.aql
@@ -0,0 +1,24 @@
+use dataverse test;
+
+insert into dataset LineID (
+let $x:=1
+let $y:=2
+let $z:=3
+return {
+	"l_orderkey": $x,
+	"l_linenumber": $y,
+	"l_suppkey": $z
+}
+);
+
+insert into dataset LineID (
+let $x:=2
+let $y:=3
+let $z:=4
+return {
+	"l_orderkey": $x,
+	"l_linenumber": $y,
+	"l_suppkey": $z
+}
+);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01/insert-into-loaded-dataset-with-index_01.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql
index a2c0c83..5f645cc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -26,3 +28,9 @@
   l_suppkey: int32
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql
index 110fc09..aa945de 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.2.update.aql
@@ -1,11 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
@@ -14,16 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_LineID_partkey on LineID(l_linenumber);
-create index idx_LineID_suppkey on LineID(l_suppkey);
-
-insert into dataset LineID (
-for $l in dataset('LineItem')
-	where $l.l_orderkey<10
-	return {
-		"l_orderkey": $l.l_orderkey,
-		"l_linenumber": $l.l_linenumber,
-		"l_suppkey": $l.l_partkey
-	}
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql
new file mode 100644
index 0000000..1eb348a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.ddl.aql
@@ -0,0 +1,5 @@
+use dataverse test;
+
+create index idx_LineID_partkey on LineID(l_linenumber);
+create index idx_LineID_suppkey on LineID(l_suppkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql
new file mode 100644
index 0000000..a27b4e7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.4.update.aql
@@ -0,0 +1,12 @@
+use dataverse test;
+
+insert into dataset LineID (
+for $l in dataset('LineItem')
+	where $l.l_orderkey<10
+	return {
+		"l_orderkey": $l.l_orderkey,
+		"l_linenumber": $l.l_linenumber,
+		"l_suppkey": $l.l_partkey
+	}
+);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02/insert-into-loaded-dataset-with-index_02.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql
index f13e658..c8d1ee5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.1.ddl.aql
@@ -1,9 +1,14 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineIDType as closed {
   l_orderkey: int32, 
   l_linenumber: int32, 
   l_suppkey: int32
 }
 
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql
index d9169d2..d3b6d75 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01/insert-into-loaded-dataset_01.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineID 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql
index 955414a..5bc8cf2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type Schema as closed {
 unique1:  int32,
 unique2:  int32,
@@ -20,3 +22,9 @@
 string4:  string
 }
 
+create dataset onektup(Schema) primary key unique2;
+
+create dataset tenktup1(Schema) primary key unique2;
+
+create dataset tmp(Schema) primary key unique2;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql
index 9892df6..7054d2a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02/insert-into-loaded-dataset_02.2.update.aql
@@ -1,9 +1,5 @@
 use dataverse test;
 
-create dataset onektup(Schema) primary key unique2;
-
-create dataset tenktup1(Schema) primary key unique2;
-
 load dataset onektup 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/wisc/onektup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
@@ -12,8 +8,6 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/wisc/tenktup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create dataset tmp(Schema) primary key unique2;
-
 load dataset tmp 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/wisc/empty.adm"),("format"="adm")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql
index a116b68..9956d01 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse test;
+
 create type testtype01 as closed {
   id: string,
   name: string?
@@ -17,3 +19,6 @@
   id: string
 }
 
+create dataset testds01(testtype01) primary key id;
+create dataset testds02(testtype02) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql
index e719626..9a18810 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01/insert-src-dst-01.2.update.aql
@@ -7,9 +7,6 @@
 
 use dataverse testdv2;
 
-create dataset testds01(testtype01) primary key id;
-create dataset testds02(testtype02) primary key id;
-
 insert into dataset testds01 ({ "id": "001" });
 insert into dataset testds01 ({ "id": "002", "name": "John Doe" });
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
index 4441459..5f645cc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -26,4 +28,9 @@
   l_suppkey: int32
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
index 5e3988f..a2702a6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
@@ -1,11 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
index a2c0c83..5f645cc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -26,3 +28,9 @@
   l_suppkey: int32
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql
index 1aa8827..3cdf230 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql
@@ -1,11 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.1.ddl.aql
index 908f515..d2dd520 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.1.ddl.aql
@@ -24,13 +24,3 @@
 create dataset LineItem(LineItemType)
   primary key l_orderkey, l_linenumber;
 
-load dataset LineItem 
-using "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter"
-(("hdfs"="hdfs://localhost:10009"),("path"="/tpch/lineitem.tbl"),
-("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="|"));
-
-write output to nc1:"rttest/dml_load-from-hdfs.adm";      
-for $c in dataset('LineItem')
-order by $c.l_orderkey, $c.l_linenumber
-return $c 
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.2.update.aql
index e5cf936..82c420d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/oad-from-hdfs/oad-from-hdfs.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter"
 (("hdfs"="hdfs://localhost:10009"),("path"="/tpch/lineitem.tbl"),
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.1.ddl.aql
index 1e8d083..e2cd108 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -20,3 +22,8 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create index idx_partkey on LineItem(l_partkey);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.2.update.aql
index 4854e23..169c6dc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/oad-with-index/oad-with-index.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create index idx_partkey on LineItem(l_partkey);
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.1.ddl.aql
index d4430d6..2abca81 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse testdv2;
+
 create type AddressType as open{
   street: string,
   city: string
@@ -28,3 +30,7 @@
   id: string
 }
 
+create dataset testds(testtype) primary key id;
+
+create dataset testds2(testtype2) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.2.update.aql
index 46bd7d0..0fcffa7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive/opentype-c2o-recursive.2.update.aql
@@ -6,10 +6,6 @@
 
 use dataverse testdv2;
 
-create dataset testds(testtype) primary key id;
-
-create dataset testds2(testtype2) primary key id;
-
 insert into dataset testds (
 { "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697}, "department": {{ {"name":"CS", "id":299, "review":5}, {"name":"EE", "id":399} }} }
 );
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.1.ddl.aql
index 4936a81..29fd36e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse test;
+
 create type testtype as closed {
   id: string,
   name: string,
@@ -22,3 +24,7 @@
   id: string
 }
 
+create dataset testds(testtype) primary key id;
+
+create dataset testds2(testtype2) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.2.update.aql
index 6959361..7ef3e8e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o/opentype-c2o.2.update.aql
@@ -6,10 +6,6 @@
  */
 
 use dataverse testdv2;
-
-create dataset testds(testtype) primary key id;
-
-create dataset testds2(testtype2) primary key id;
  
 insert into dataset testds (
 { "hobby": {{"music", "coding"}}, "id": "001", "name": "Person Three"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.1.ddl.aql
index 7ecf27a..b4c56da 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.1.ddl.aql
@@ -7,8 +7,11 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse test;
+
 create type testtype as closed {
   name: string?,
   id: string
 }
 
+create dataset testds(testtype) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.2.update.aql
index 612571f..83c5d1a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-option/opentype-closed-option.2.update.aql
@@ -6,8 +6,6 @@
 
 use dataverse testdv2;
 
-create dataset testds(testtype) primary key id;
-
 insert into dataset testds (
 { "id": "001", "name": "Person One"}
 );
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.1.ddl.aql
index 405078c..dca5d7e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.1.ddl.aql
@@ -6,8 +6,12 @@
 
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
+
+use dataverse testdv2;
+
 create type testtype as open {
   id: string,
   name: string
 }
 
+create dataset testds(testtype) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.2.update.aql
index 34afcfd..2ac8eed 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert/opentype-insert.2.update.aql
@@ -5,8 +5,6 @@
  */
 
 use dataverse testdv2;
-
-create dataset testds(testtype) primary key id;
  
  insert into dataset testds (
  { "id": "001", "name": "Person Three", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.1.ddl.aql
index 34232fc..aa70a99 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.1.ddl.aql
@@ -8,7 +8,11 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 	id:int32
 }
 
+create dataset testds(TestType) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.2.update.aql
index a13fc81..ec357bf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2/opentype-insert2.2.update.aql
@@ -7,8 +7,5 @@
 
 use dataverse test;
 
-
-create dataset testds(TestType) primary key id;
-
 insert into dataset testds( for $i in range(1,10) return { "id":$i,"name":"John Doe" });
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.1.ddl.aql
index 4101d55..55f2cf7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.1.ddl.aql
@@ -8,8 +8,11 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse testdv2;
+
 create type testtype as open {
   name: string?,
   id: string
 }
 
+create dataset testds(testtype) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.2.update.aql
index 835833f..748ab7c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand/opentype-noexpand.2.update.aql
@@ -7,8 +7,6 @@
 
 use dataverse testdv2;
 
-create dataset testds(testtype) primary key id;
-
 insert into dataset testds (
 { "id": "001", "name": "Person One"}
 );
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.1.ddl.aql
index b8a628c..0ca863f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse testdv2;
+
 create type AddressType as open{
   street: string,
   city: string
@@ -29,3 +31,7 @@
   department: {{Dept}}?
 }
 
+create dataset testds(testtype) primary key id;
+
+create dataset testds2(testtype2) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.2.update.aql
index 47663be..62895ee 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive/opentype-o2c-recursive.2.update.aql
@@ -6,10 +6,6 @@
 
 use dataverse testdv2;
 
-create dataset testds(testtype) primary key id;
-
-create dataset testds2(testtype2) primary key id;
-
 insert into dataset testds (
 { "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697}, "department": {{ {"name":"CS", "id":299}, {"name":"EE", "id":399} }} }
 );
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.1.ddl.aql
index 3e25ba4..d1dfd51 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.1.ddl.aql
@@ -9,6 +9,8 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse testdv2;
+
 create type testtype as open {
   id: string,
   name: string
@@ -20,3 +22,7 @@
   name: string
 }
 
+create dataset testds(testtype) primary key id;
+
+create dataset testds2(testtype2) primary key id; 
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.2.update.aql
index 6a75091..ea05185 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c/opentype-o2c.2.update.aql
@@ -6,10 +6,6 @@
  */
 
 use dataverse testdv2;
-
-create dataset testds(testtype) primary key id;
-
-create dataset testds2(testtype2) primary key id; 
  
 insert into dataset testds (
 { "id": "001",  "hobby": {{"music"}}, "name": "Person Three"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.1.ddl.aql
index 2729e5b..3ef03f9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.1.ddl.aql
@@ -9,6 +9,8 @@
 drop dataverse testdv2 if exists;
 create dataverse testdv2;
 
+use dataverse test;
+
 create type testtype as open {
   name: string,
   id: string
@@ -20,3 +22,7 @@
   hobby: string
 }
 
+create dataset testds(testtype) primary key id;
+
+create dataset testds2(testtype2) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.2.update.aql
index 3b47d15..33290c6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o/opentype-o2o.2.update.aql
@@ -7,10 +7,6 @@
 
 
 use dataverse testdv2;
-
-create dataset testds(testtype) primary key id;
-
-create dataset testds2(testtype2) primary key id;
  
 insert into dataset testds (
 { "name": "Person One",  "id": "001", "hobby": "music"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.1.ddl.aql
index 8c8e0a7..dfb68c4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type EmployeeStat as open {
   age: int32,
   salary:int32
@@ -19,3 +21,6 @@
   deptCode:int32
 }
 
+create dataset Employees(EmployeeType)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.2.update.aql
index 3b3c0fb..43ef565 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205/uery-issue205.2.update.aql
@@ -7,9 +7,6 @@
 
 use dataverse test;
 
-create dataset Employees(EmployeeType)
-  primary key id;
-
 insert into dataset Employees({"id":"1234", "stat":{ "age":50, "salary":120000}, "deptCode":32 });
 insert into dataset Employees({"id":"5678", "stat":{ "age":40, "salary":100000}, "deptCode":16 });
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql
index 1366ec9..cc50d0d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as closed {
   number: int32, 
   street: string,
@@ -23,3 +25,5 @@
   children: [ { name: string, age: int32? } ]
 }
 
+create dataset Customers(CustomerType) primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql
index 8dd9dc8..83d6233 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql
@@ -7,13 +7,7 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
 
-create index age_index on Customers(age);
-
-delete $c from dataset Customers where $c.cid>=200;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..5e2f2e3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+create index age_index on Customers(age);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..6c6f4a9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+delete $c from dataset Customers where $c.cid>=200;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.1.ddl.aql
index 4b30c80..b3124f7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
   id: int32,
   point: point?,
@@ -19,3 +21,6 @@
   rec: rectangle
 }
 
+create dataset MyData(MyRecord)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.2.update.aql
index 6ba1111..8676d7e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.2.update.aql
@@ -7,14 +7,7 @@
 
 use dataverse test;
 
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")) pre-sorted;
 
-create index rtree_index_point on MyData(point) type rtree;
-
-delete $m from dataset MyData where $m.id>10;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..1fc9251
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+create index rtree_index_point on MyData(point) type rtree;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..8e4de85
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+delete $m from dataset MyData where $m.id>10;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable/scan-delete-rtree-secondary-index-nullable.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql
index 5925115..4cd746b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
   id: int32,
   point: point,
@@ -13,3 +15,6 @@
   circle: circle
 }
 
+create dataset MyData(MyRecord)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql
index 1ee3016..2c4c9ed 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.2.update.aql
@@ -1,13 +1,6 @@
 use dataverse test;
 
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
 
-create index rtree_index_point on MyData(point) type rtree;
-
-delete $m from dataset MyData where $m.id>10;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..1fc9251
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.ddl.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+create index rtree_index_point on MyData(point) type rtree;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql
new file mode 100644
index 0000000..8e4de85
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.4.update.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+delete $m from dataset MyData where $m.id>10;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index/scan-delete-rtree-secondary-index.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql
index be3bcb5..0114f45 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as closed {
   number: int32, 
   street: string,
@@ -23,3 +25,6 @@
   children: [ { name: string, age: int32? } ]
 }
 
+create dataset Customers(CustomerType) primary key cid;
+create dataset CustomersMini(CustomerType) primary key cid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql
index 8f4656b..ff4c09b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.2.update.aql
@@ -7,26 +7,7 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-create dataset CustomersMini(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
 
-create index age_index on CustomersMini(age);
-
-insert into dataset CustomersMini
-(
-	for $c in dataset('Customers')
-	where $c.cid < 200	
-	return {
-	  "cid": $c.cid,
-  	  "name": $c.name,
-  	  "age": $c.age,
-  	  "address": $c.address,
-  	  "interests": $c.interests,
-  	  "children": $c.children
-	}	
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..84ad3b9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,4 @@
+use dataverse test;
+
+create index age_index on CustomersMini(age);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..e518fca
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,16 @@
+use dataverse test;
+
+insert into dataset CustomersMini
+(
+	for $c in dataset('Customers')
+	where $c.cid < 200	
+	return {
+	  "cid": $c.cid,
+  	  "name": $c.name,
+  	  "age": $c.age,
+  	  "address": $c.address,
+  	  "interests": $c.interests,
+  	  "children": $c.children
+	}	
+);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable/scan-insert-btree-secondary-index-nullable.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql
index 74336e4..6057269 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
   id: int32,
   point: point?,
@@ -24,3 +26,6 @@
   point: point?
 }
 
+create dataset MyData(MyRecord)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql
index 0548b93..1607359 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.2.update.aql
@@ -7,24 +7,7 @@
 
 use dataverse test;
 
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")) pre-sorted;
 
-create dataset MyMiniData(MyMiniRecord)
-  primary key id;
-
-create index rtree_index_point on MyMiniData(point) type rtree;
-
-insert into dataset MyMiniData
-(
-	for $m in dataset('MyData')
-	return {
-		"id": $m.id,
-		"point": $m.point
-	}
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..90716cf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,7 @@
+use dataverse test;
+
+create dataset MyMiniData(MyMiniRecord)
+  primary key id;
+
+create index rtree_index_point on MyMiniData(point) type rtree;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..524df93
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,11 @@
+use dataverse test;
+
+insert into dataset MyMiniData
+(
+	for $m in dataset('MyData')
+	return {
+		"id": $m.id,
+		"point": $m.point
+	}
+);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable/scan-insert-rtree-secondary-index-nullable.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql
index a8c81e9..58765cd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
   id: int32,
   point: point,
@@ -18,3 +20,9 @@
   point: point
 }
 
+create dataset MyData(MyRecord)
+  primary key id;
+
+create dataset MyMiniData(MyMiniRecord)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql
index 6a55a9a..1102fbd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.2.update.aql
@@ -1,28 +1,10 @@
 use dataverse test;
 
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
 
-create dataset MyMiniData(MyMiniRecord)
-  primary key id;
-
 load dataset MyMiniData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData0.json"),("format"="adm")) pre-sorted;
 
-create index rtree_index_point_0 on MyData(point) type rtree;
-create index rtree_index_point on MyMiniData(point) type rtree;
-
-insert into dataset MyMiniData
-(
-	for $m in dataset('MyData')
-	return {
-		"id": $m.id,
-		"point": $m.point
-	}
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..ab9a3f4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.ddl.aql
@@ -0,0 +1,5 @@
+use dataverse test;
+
+create index rtree_index_point_0 on MyData(point) type rtree;
+create index rtree_index_point on MyMiniData(point) type rtree;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql
new file mode 100644
index 0000000..524df93
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.4.update.aql
@@ -0,0 +1,11 @@
+use dataverse test;
+
+insert into dataset MyMiniData
+(
+	for $m in dataset('MyData')
+	return {
+		"id": $m.id,
+		"point": $m.point
+	}
+);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index/scan-insert-rtree-secondary-index.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
index 3d3989c..d8ab247 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
@@ -2,6 +2,8 @@
   
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
 	id: int32,
 	tweetid: int64,
@@ -10,3 +12,6 @@
 	text: string
 }
 
+create dataset MyData(MyRecord)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql
index 3196268..3556905 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql
index 23e9a0d..ea29045 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.1.ddl.aql
@@ -2,6 +2,7 @@
   
 create dataverse test;
 
+use dataverse test;
 
 create type LineItemType as closed {
   l_orderkey: int32, 
@@ -22,3 +23,6 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql
index 80373df..ac2bd60 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete/delete.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql
index 550384c..0cb052d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.1.ddl.aql
@@ -2,6 +2,8 @@
 
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
 	id: int32,
 	tweetid: int64,
@@ -15,3 +17,9 @@
   loc: point
 }
 
+create dataset MyData(MyRecord)
+  primary key id;
+
+create dataset MyMiniData(MyMiniRecord)
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql
index 738b81b..bffd599 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.2.update.aql
@@ -1,42 +1,11 @@
 use dataverse test;
 
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/twitter/smalltweets.txt"),("format"="adm")) pre-sorted;
 
 
-create dataset MyMiniData(MyMiniRecord)
-  primary key id;
-
 load dataset MyMiniData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData0.json"),("format"="adm")) pre-sorted;
 
-
-create index rtree_index_loc_0 on MyData(loc) type rtree;
-create index rtree_index_loc on MyMiniData(loc) type rtree;
-
-insert into dataset MyMiniData
-(
-	for $m in dataset('MyData')
-	where $m.id<1000
-	return {
-		"id": $m.id,
-		"loc": $m.loc
-	}
-);
-
-insert into dataset MyMiniData
-(
-	for $m in dataset('MyData')
-	where $m.id>=1000
-	die after 1000
-	return {
-		"id": $m.id,
-		"loc": $m.loc
-	}
-);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.ddl.aql
new file mode 100644
index 0000000..3626933
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.ddl.aql
@@ -0,0 +1,5 @@
+use dataverse test;
+
+create index rtree_index_loc_0 on MyData(loc) type rtree;
+create index rtree_index_loc on MyMiniData(loc) type rtree;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.4.update.aql
new file mode 100644
index 0000000..5874119
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.4.update.aql
@@ -0,0 +1,23 @@
+use dataverse test;
+
+insert into dataset MyMiniData
+(
+	for $m in dataset('MyData')
+	where $m.id<1000
+	return {
+		"id": $m.id,
+		"loc": $m.loc
+	}
+);
+
+insert into dataset MyMiniData
+(
+	for $m in dataset('MyData')
+	where $m.id>=1000
+	die after 1000
+	return {
+		"id": $m.id,
+		"loc": $m.loc
+	}
+);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.5.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree/insert-rtree.5.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql
index 12f98fd..7f5844e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.1.ddl.aql
@@ -2,6 +2,8 @@
   
 create dataverse test;
 
+use dataverse test;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -27,4 +29,9 @@
   l_suppkey: int32
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql
index 37a57b4..a1bfc0d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert/insert.2.update.aql
@@ -1,11 +1,5 @@
 use dataverse test;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-create dataset LineID(LineIDType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.1.ddl.aql
index c50d674..2ff7f3e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.1.ddl.aql
@@ -1,6 +1,7 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse test;
 
 create type LineItemType as closed {
   l_orderkey: int32, 
@@ -21,3 +22,6 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.2.update.aql
index cf309aa..f781e6e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure/q1_pricing_summary_report_failure.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.1.ddl.aql
index ffabe64..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.1.ddl.aql
@@ -14,17 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_1.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.2.update.aql
index ffabe64..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.2.update.aql
@@ -1,30 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-1_1.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql
index ffabe64..bc6490d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_1.adm';
-
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.1.ddl.aql
index a74bc3e..ee455cb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.1.ddl.aql
@@ -14,19 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.1.1.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.2.update.aql
index a74bc3e..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.2.update.aql
@@ -1,32 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.1.1.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql
index a74bc3e..e6a2e36 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.1.1.adm';
-
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.1.ddl.aql
index 53771c1..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.1.ddl.aql
@@ -14,19 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.1.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.2.update.aql
index 53771c1..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.2.update.aql
@@ -1,32 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.1.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql
index 53771c1..e6a2e36 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.1.adm';
-
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.1.ddl.aql
index 923959b..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.1.ddl.aql
@@ -14,18 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $paperid := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paperid
-            order by count($paperid), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.2.update.aql
index 923959b..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.2.update.aql
@@ -1,31 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.adm';
-
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $paperid := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paperid
-            order by count($paperid), $tokenGroupped
-            return $tokenGroupped
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql
index 923959b..aa6a746 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-1_2.adm';
-
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.1.ddl.aql
index 3c7bb5b..ee455cb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.1.ddl.aql
@@ -14,39 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2.1_5.3.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP, 
-                                0,
-                                prefix-len-jaccard($lenDBLP, .5f))
-    order by $idDBLP
-    return {'id': $idDBLP, 'prefixToken': $prefixTokenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.2.update.aql
index 3c7bb5b..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.2.update.aql
@@ -1,52 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2.1_5.3.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP, 
-                                0,
-                                prefix-len-jaccard($lenDBLP, .5f))
-    order by $idDBLP
-    return {'id': $idDBLP, 'prefixToken': $prefixTokenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
index 3c7bb5b..70de806 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2.1_5.3.1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.1.ddl.aql
index d0eebcb..3d9b507 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.1.ddl.aql
@@ -20,32 +20,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) primary key rank;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset TOKENSRANKEDADM 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/tokensranked.adm"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2.2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked in dataset('TOKENSRANKEDADM')
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked.token
-        order by $tokenRanked.rank
-        return $tokenRanked.rank
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP, 
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-    order by $idDBLP, $prefixTokenDBLP
-    return {'id': $idDBLP, 'prefixToken': $prefixTokenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.2.update.aql
index d0eebcb..2c90d77 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.2.update.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type TOKENSRANKEDADMType as closed {
-  token: int32,
-  rank: int32
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) primary key rank;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
@@ -28,24 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/tokensranked.adm"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2.2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked in dataset('TOKENSRANKEDADM')
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked.token
-        order by $tokenRanked.rank
-        return $tokenRanked.rank
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP, 
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-    order by $idDBLP, $prefixTokenDBLP
-    return {'id': $idDBLP, 'prefixToken': $prefixTokenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
index d0eebcb..03add70 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
@@ -1,35 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type TOKENSRANKEDADMType as closed {
-  token: int32,
-  rank: int32
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) primary key rank;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-load dataset TOKENSRANKEDADM 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/tokensranked.adm"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2.2.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.1.ddl.aql
index b5ae4c6..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.1.ddl.aql
@@ -14,29 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $paperDBLP.id
-    return {'id': $paperDBLP.id, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.2.update.aql
index b5ae4c6..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.2.update.aql
@@ -1,42 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $paperDBLP.id
-    return {'id': $paperDBLP.id, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql
index b5ae4c6..977a2a9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.1.ddl.aql
index d50b67c..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.1.ddl.aql
@@ -14,30 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $paperDBLP.id
-    return {'id': $paperDBLP.id, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.2.update.aql
index d50b67c..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.2.update.aql
@@ -1,43 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $paperDBLP.id
-    return {'id': $paperDBLP.id, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql
index d50b67c..275a4cf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_2.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.1.ddl.aql
index 2e57a79..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.1.ddl.aql
@@ -14,31 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.2.update.aql
index 2e57a79..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.2.update.aql
@@ -1,44 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql
index 2e57a79..8f75103 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_3.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.1.ddl.aql
index 7f59c30..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.1.ddl.aql
@@ -14,32 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_4.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.2.update.aql
index 7f59c30..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.2.update.aql
@@ -1,45 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_4.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql
index 7f59c30..abb7736 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_4.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.1.ddl.aql
index 4f53db6..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.1.ddl.aql
@@ -14,34 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.2.update.aql
index 4f53db6..dc55d95 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.2.update.aql
@@ -1,47 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql
index 4f53db6..1950989 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.1.ddl.aql
index 67bd952..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.1.ddl.aql
@@ -14,34 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.2.update.aql
index 67bd952..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.2.update.aql
@@ -1,47 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
index 67bd952..f6b4832 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.2.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.1.ddl.aql
index 9944c93..ee455cb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.1.ddl.aql
@@ -14,35 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.3.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.2.update.aql
index 9944c93..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.2.update.aql
@@ -1,48 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.3.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
index 9944c93..6ea3207 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.3.1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.1.ddl.aql
index 0319117..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.1.ddl.aql
@@ -14,35 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.2.update.aql
index 0319117..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.2.update.aql
@@ -1,48 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */ 
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast*/ $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
index 0319117..6ea3207 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.3.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.1.ddl.aql
index 9a10925..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.1.ddl.aql
@@ -14,33 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.2.update.aql
index 9a10925..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.2.update.aql
@@ -1,46 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    order by $idDBLP
-    return {'id': $idDBLP, 'len': $lenDBLP, 'tokens': $tokensDBLP}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql
index 9a10925..81013bb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-2_5.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.1.ddl.aql
index 2de6807..d68b466e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.1.ddl.aql
@@ -18,75 +18,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard($lenLeft, .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard($lenRight, .5f))
-
-    where $prefixTokenLeft = $prefixTokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefixTokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    /*+ hash */
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.2.update.aql
index 2de6807..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.2.update.aql
@@ -1,92 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard($lenLeft, .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard($lenRight, .5f))
-
-    where $prefixTokenLeft = $prefixTokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefixTokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    /*+ hash */
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql
index 2de6807..039ed1b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.1.ddl.aql
index a3b5bc5..fc70544 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.1.ddl.aql
@@ -13,80 +13,3 @@
 }
 
 create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.2.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard($lenLeft, .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard($lenRight, .5f))
-
-    where $prefixTokenLeft = $prefixTokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefixTokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    /*+ hash */
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.2.update.aql
index a3b5bc5..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.2.update.aql
@@ -1,92 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.2.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard($lenLeft, .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard($lenRight, .5f))
-
-    where $prefixTokenLeft = $prefixTokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefixTokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    /*+ hash */
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
index a3b5bc5..2c2d349 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.2.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.1.ddl.aql
index 26f5e46..c0c9897 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.1.ddl.aql
@@ -14,76 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard($lenLeft, .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard($lenRight, .5f))
-
-    where $prefixTokenLeft = $prefixTokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefixTokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.2.update.aql
index 26f5e46..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.2.update.aql
@@ -1,89 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard($lenLeft, .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard($lenRight, .5f))
-
-    where $prefixTokenLeft = $prefixTokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefixTokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql
index 26f5e46..0d1976b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-3_1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.1.ddl.aql
index dd88883..ee455cb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.1.ddl.aql
@@ -14,16 +14,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $dblp2 in dataset('DBLP')
-where $dblp.title ~= $dblp2.title and $dblp.id < $dblp2.id
-order by $dblp.id, $dblp2.id
-return {'dblp': $dblp, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.2.update.aql
index dd88883..533e8a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.2.update.aql
@@ -1,29 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $dblp2 in dataset('DBLP')
-where $dblp.title ~= $dblp2.title and $dblp.id < $dblp2.id
-order by $dblp.id, $dblp2.id
-return {'dblp': $dblp, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.query.aql
index dd88883..6735a8f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1/dblp-aqlplus_1.3.query.aql
@@ -1,25 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $dblp in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.1.ddl.aql
index abd3425..a62b5a3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.1.ddl.aql
@@ -17,16 +17,3 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small.adm"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $dblp2 in dataset('DBLP')
-where $dblp.title ~= $dblp2.title and $dblp.id < $dblp2.id
-order by $dblp.id, $dblp2.id
-return {'dblp': $dblp, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.2.update.aql
index abd3425..a760070 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.2.update.aql
@@ -7,26 +7,9 @@
  * Success        : Yes
  */
 
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/dblp-small/dblp-small.adm"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $dblp2 in dataset('DBLP')
-where $dblp.title ~= $dblp2.title and $dblp.id < $dblp2.id
-order by $dblp.id, $dblp2.id
-return {'dblp': $dblp, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.query.aql
index abd3425..19a0294 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2/dblp-aqlplus_2.3.query.aql
@@ -7,22 +7,8 @@
  * Success        : Yes
  */
 
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/dblp-small/dblp-small.adm"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-aqlplus_2.adm';
-
 set simthreshold '.5f';
 
 for $dblp in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.1.ddl.aql
index 288194c..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.1.ddl.aql
@@ -23,69 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.2.update.aql
index 288194c..47d8420 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,61 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql
index 288194c..2d3a1f2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.1.ddl.aql
index 0010b8b..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.1.ddl.aql
@@ -23,71 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.2.update.aql
index 0010b8b..47d8420 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,63 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql
index 0010b8b..8847306 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_2.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.1.ddl.aql
index aa3c661..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.1.ddl.aql
@@ -23,74 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.2.update.aql
index aa3c661..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,66 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql
index aa3c661..4438e50 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql
@@ -1,39 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_3.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.1.ddl.aql
index 2aa331c..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.1.ddl.aql
@@ -23,75 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_4.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len($tokensUnrankedDBLP),
-                    $tokensDBLP,
-                    len($tokensUnrankedCSX),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.2.update.aql
index 2aa331c..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,67 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_4.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len($tokensUnrankedDBLP),
-                    $tokensDBLP,
-                    len($tokensUnrankedCSX),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql
index 2aa331c..e2fc8d1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_4.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.1.ddl.aql
index a8f5eec..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.1.ddl.aql
@@ -23,79 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.2.update.aql
index a8f5eec..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,71 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql
index a8f5eec..d6e7183 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.1.ddl.aql
index d724b57..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.1.ddl.aql
@@ -23,80 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.2.update.aql
index d724b57..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,72 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.2.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql
index d724b57..f379cf4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.2.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.1.ddl.aql
index 57dbb53..7dc7297 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.1.ddl.aql
@@ -23,83 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.3.1.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.2.update.aql
index 57dbb53..de3c8e8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.2.update.aql
@@ -1,39 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.3.1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
index 57dbb53..de3c8e8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
@@ -1,39 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.3.1.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.1.ddl.aql
index fa9f11c..a96dd30 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.1.ddl.aql
@@ -23,82 +23,4 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.2.update.aql
index fa9f11c..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,74 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.3.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
index fa9f11c..803db8f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.3.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.1.ddl.aql
index 40fd306..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.1.ddl.aql
@@ -23,77 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.2.update.aql
index 40fd306..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,69 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.adm';
-
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    order by $idDBLP, $idCSX
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql
index 40fd306..60ea2ee 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-2_5.adm';
-
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.1.ddl.aql
index 59a881b..a96dd30 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.1.ddl.aql
@@ -23,79 +23,4 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.2.update.aql
index 59a881b..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,71 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql
index 59a881b..8757f02 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql
@@ -1,39 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.1.ddl.aql
index 9352c3b..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.1.ddl.aql
@@ -23,80 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_2.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.2.update.aql
index 9352c3b..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,72 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_2.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $paperDBLP.id, $idCSX := $paperCSX.id, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql
index 9352c3b..7d40888 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_2.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.1.ddl.aql
index c1c6322..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.1.ddl.aql
@@ -23,82 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_3.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.2.update.aql
index c1c6322..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,74 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_3.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensDBLP :=
-        for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensCSX :=
-        for $tokenUnranked in counthashed-word-tokens($paperCSX.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len(counthashed-word-tokens($paperDBLP.title)),
-                    $tokensDBLP,
-                    len(counthashed-word-tokens($paperCSX.title)),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql
index c1c6322..85ace1c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_3.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.1.ddl.aql
index 75fe12b..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.1.ddl.aql
@@ -23,84 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_4.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len($tokensUnrankedDBLP),
-                    $tokensDBLP,
-                    len($tokensUnrankedCSX),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.2.update.aql
index 75fe12b..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,76 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_4.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    len($tokensUnrankedDBLP),
-                    $tokensDBLP,
-                    len($tokensUnrankedCSX),
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql
index 75fe12b..3574534 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_4.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.1.ddl.aql
index bfed5c6..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.1.ddl.aql
@@ -23,88 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.2.update.aql
index bfed5c6..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,80 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql
index bfed5c6..6a6dc0c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.1.ddl.aql
index b683acb..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.1.ddl.aql
@@ -23,89 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.2.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.2.update.aql
index b683acb..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,81 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.2.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
index b683acb..5359b9f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.2.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.1.ddl.aql
index 3134c41..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.1.ddl.aql
@@ -23,91 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.3.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.2.update.aql
index 3134c41..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,83 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.3.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
index 3134c41..f0dbf23 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.3.1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.1.ddl.aql
index 97e16c9..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.1.ddl.aql
@@ -23,91 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.3.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.2.update.aql
index 97e16c9..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,83 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.3.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGroupped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
index 97e16c9..40aba87 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.3.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.1.ddl.aql
index 175e4b1..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.1.ddl.aql
@@ -23,95 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.4.1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $paperCSX in dataset('CSX')
-for $paperDBLPridpair in
-for $paperDBLP in dataset('DBLP')
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-where $ridpair.idDBLP = $paperDBLP.id
-return {'idDBLP': $paperDBLP.id, 'idCSX': $ridpair.idCSX, 'paperDBLP': $paperDBLP, 'sim': $ridpair.sim}
-
-where $paperDBLPridpair.idCSX = $paperCSX.id
-order by $paperDBLPridpair.idDBLP, $paperDBLPridpair.idCSX
-return {'dblp': $paperDBLPridpair.paperDBLP, 'csx': $paperCSX, 'sim': $paperDBLPridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.2.update.aql
index 175e4b1..50972b4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,87 +8,4 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.4.1.adm';
 
-//
-// -- - Stage 3 - --
-//
-for $paperCSX in dataset('CSX')
-for $paperDBLPridpair in
-for $paperDBLP in dataset('DBLP')
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-where $ridpair.idDBLP = $paperDBLP.id
-return {'idDBLP': $paperDBLP.id, 'idCSX': $ridpair.idCSX, 'paperDBLP': $paperDBLP, 'sim': $ridpair.sim}
-
-where $paperDBLPridpair.idCSX = $paperCSX.id
-order by $paperDBLPridpair.idDBLP, $paperDBLPridpair.idCSX
-return {'dblp': $paperDBLPridpair.paperDBLP, 'csx': $paperCSX, 'sim': $paperDBLPridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
index 175e4b1..103af68 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.4.1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.1.ddl.aql
index e471d69..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.1.ddl.aql
@@ -23,96 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.4.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $paperCSX in dataset('CSX')
-for $paperDBLPridpair in
-for $paperDBLP in dataset('DBLP')
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-where $ridpair.idDBLP = $paperDBLP.id
-return {'idDBLP': $paperDBLP.id, 'paperDBLP': $paperDBLP, 'idCSX': $ridpair.idCSX, 'sim': $ridpair.sim}
-
-where $paperDBLPridpair.idCSX = $paperCSX.id
-// order by $paperDBLPridpair.idDBLP, $paperDBLPridpair.idCSX
-order by $paperDBLPridpair.paperDBLP.id, $paperDBLPridpair.idCSX
-return {'dblp': $paperDBLPridpair.paperDBLP, 'csx': $paperCSX, 'sim': $paperDBLPridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.2.update.aql
index e471d69..50972b4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,88 +8,4 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.4.adm';
 
-//
-// -- - Stage 3 - --
-//
-for $paperCSX in dataset('CSX')
-for $paperDBLPridpair in
-for $paperDBLP in dataset('DBLP')
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            /*+ hash */
-            group by $tokenGrouped := $token with $id
-            /*+ inmem 1 302 */
-            order by count($id), $tokenGrouped
-            return $tokenGrouped
-        where $tokenUnranked = /*+ bcast */ $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    /*+ hash*/ 
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-where $ridpair.idDBLP = $paperDBLP.id
-return {'idDBLP': $paperDBLP.id, 'paperDBLP': $paperDBLP, 'idCSX': $ridpair.idCSX, 'sim': $ridpair.sim}
-
-where $paperDBLPridpair.idCSX = $paperCSX.id
-// order by $paperDBLPridpair.idDBLP, $paperDBLPridpair.idCSX
-order by $paperDBLPridpair.paperDBLP.id, $paperDBLPridpair.idCSX
-return {'dblp': $paperDBLPridpair.paperDBLP, 'csx': $paperCSX, 'sim': $paperDBLPridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
index e471d69..2199203 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.4.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.1.ddl.aql
index 588591d..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.1.ddl.aql
@@ -23,87 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.2.update.aql
index 588591d..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,79 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperDBLP in dataset('DBLP')
-    let $idDBLP := $paperDBLP.id
-    let $tokensUnrankedDBLP := counthashed-word-tokens($paperDBLP.title)
-    let $lenDBLP := len($tokensUnrankedDBLP)
-    let $tokensDBLP :=
-        for $tokenUnranked in $tokensUnrankedDBLP
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenDBLP in subset-collection(
-                                $tokensDBLP,
-                                0,
-                                prefix-len-jaccard(len($tokensDBLP), .5f))
-
-    for $paperCSX in dataset('CSX')
-    let $idCSX := $paperCSX.id
-    let $tokensUnrankedCSX := counthashed-word-tokens($paperCSX.title)
-    let $lenCSX := len($tokensUnrankedCSX)
-    let $tokensCSX :=
-        for $tokenUnranked in $tokensUnrankedCSX
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            let $id := $paper.id
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $id
-            order by count($id), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenCSX in subset-collection(
-                                $tokensCSX,
-                                0,
-                                prefix-len-jaccard(len($tokensCSX), .5f))
-
-    where $prefixTokenDBLP = $prefixTokenCSX
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenDBLP,
-                    $tokensDBLP,
-                    $lenCSX,
-                    $tokensCSX,
-                    $prefixTokenDBLP,
-                    .5f)
-    where $sim >= .5f
-    group by $idDBLP := $idDBLP, $idCSX := $idCSX, $sim := $sim with $sim
-    return {'idDBLP': $idDBLP, 'idCSX': $idCSX, 'sim': $sim[0]}
-
-for $paperDBLP in dataset('DBLP')
-for $paperCSX in dataset('CSX')
-where $ridpair.idDBLP = $paperDBLP.id and $ridpair.idCSX = $paperCSX.id
-order by $paperDBLP.id, $paperCSX.id
-return {'dblp': $paperDBLP, 'csx': $paperCSX, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql
index 588591d..44807b2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql
@@ -1,39 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-3_5.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.1.ddl.aql
index 0195185..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.1.ddl.aql
@@ -23,20 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $i in dataset('DBLP')
-for $j in dataset('CSX')
-where $i.title ~= $j.title
-order by $i.id, $j.id
-return {'dblp': $i, 'csx': $j}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.2.update.aql
index 0195185..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $i in dataset('DBLP')
-for $j in dataset('CSX')
-where $i.title ~= $j.title
-order by $i.id, $j.id
-return {'dblp': $i, 'csx': $j}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.3.query.aql
index 0195185..b3ec559 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1/dblp-csx-aqlplus_1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $i in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.1.ddl.aql
index 085d139..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.1.ddl.aql
@@ -23,20 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $csx in dataset('CSX')
-for $dblp in dataset('DBLP')
-where $dblp.title ~= $csx.title
-order by $dblp.id, $csx.id
-return {'dblp': $dblp, 'csx': $csx}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.2.update.aql
index 085d139..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $csx in dataset('CSX')
-for $dblp in dataset('DBLP')
-where $dblp.title ~= $csx.title
-order by $dblp.id, $csx.id
-return {'dblp': $dblp, 'csx': $csx}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.3.query.aql
index 085d139..406438b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2/dblp-csx-aqlplus_2.3.query.aql
@@ -1,37 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_2.adm';
 
 set simthreshold '.5f';
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.1.ddl.aql
index d379cc4..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.1.ddl.aql
@@ -23,20 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $csx in dataset('CSX')
-where $csx.title ~= $dblp.title
-order by $dblp.id, $csx.id
-return {'dblp': $dblp, 'csx': $csx}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.2.update.aql
index d379cc4..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $csx in dataset('CSX')
-where $csx.title ~= $dblp.title
-order by $dblp.id, $csx.id
-return {'dblp': $dblp, 'csx': $csx}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.3.query.aql
index d379cc4..b359eec 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3/dblp-csx-aqlplus_3.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-aqlplus_3.adm';
-
 set simthreshold '.5f';
 
 for $dblp in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.1.ddl.aql
index cb774be..e690c64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.1.ddl.aql
@@ -23,21 +23,3 @@
 create dataset DBLP(DBLPType) primary key id;
 create dataset CSX(CSXType) primary key id;
 
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-dblp-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $csx in dataset('CSX')
-for $dblp2 in dataset('DBLP')
-where $dblp.title ~= $csx.title and $csx.authors ~= $dblp2.authors
-order by $dblp.id, $csx.id, $dblp2.id
-return {'dblp': $dblp, 'csx': $csx, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.2.update.aql
index cb774be..916bd56 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.2.update.aql
@@ -1,28 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -31,13 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-dblp-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $dblp in dataset('DBLP')
-for $csx in dataset('CSX')
-for $dblp2 in dataset('DBLP')
-where $dblp.title ~= $csx.title and $csx.authors ~= $dblp2.authors
-order by $dblp.id, $csx.id, $dblp2.id
-return {'dblp': $dblp, 'csx': $csx, 'dblp2': $dblp2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.3.query.aql
index cb774be..f6e9083 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1/dblp-csx-dblp-aqlplus_1.3.query.aql
@@ -1,38 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as open {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
-load dataset DBLP
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-load dataset CSX
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/csx-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-write output to nc1:'rttest/fuzzyjoin_dblp-csx-dblp-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $dblp in dataset('DBLP')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.1.ddl.aql
index edec926..020f37c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.1.ddl.aql
@@ -18,9 +18,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-lookup_1.adm';
-
-for $paper in dataset('DBLP')
-where $paper.id = 1
-return $paper
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.2.update.aql
index edec926..308608e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.2.update.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-lookup_1.adm';
-
-for $paper in dataset('DBLP')
-where $paper.id = 1
-return $paper
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.3.query.aql
index edec926..308608e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1/dblp-lookup_1.3.query.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-write output to nc1:'rttest/fuzzyjoin_dblp-lookup_1.adm';
-
-for $paper in dataset('DBLP')
-where $paper.id = 1
-return $paper
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.1.ddl.aql
index f0f4a6e..d925752 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.1.ddl.aql
@@ -16,149 +16,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-
-write output to nc1:'rttest/fuzzyjoin_dblp-splits-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefix_tokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard(len($tokensLeft), .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefix_tokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard(len($tokensRight), .5f))
-
-    where $prefix_tokenLeft = $prefix_tokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefix_tokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
-
-/*
-edu.uci.ics.aqua.common.exceptions.AquaException: Attempting to construct a nested plan with 3 operator descriptors. Currently, nested plans can only consist in linear pipelines of Asterix micro operators.
-	at edu.uci.ics.aqua.algebra.operators.physical.AbstractGroupByPhysicalOperator.buildPipelineWithProjection(AbstractGroupByPhysicalOperator.java:47)
-	at edu.uci.ics.aqua.algebra.operators.physical.AbstractGroupByPhysicalOperator.compileSubplans(AbstractGroupByPhysicalOperator.java:29)
-	at edu.uci.ics.aqua.algebra.operators.physical.PreSortedGroupByPOperator.contributeRuntimeOperator(PreSortedGroupByPOperator.java:133)
-	at edu.uci.ics.aqua.algebra.operators.logical.AbstractLogicalOperator.contributeRuntimeOperator(AbstractLogicalOperator.java:208)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:52)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compilePlan(PlanCompiler.java:30)
-	at edu.uci.ics.aqua.api.HeuristicCompilerFactoryBuilder$1$1.createJob(HeuristicCompilerFactoryBuilder.java:64)
-	at edu.uci.ics.asterix.api.common.APIFramework.compileQuery(APIFramework.java:323)
-	at edu.uci.ics.asterix.api.java.AsterixJavaClient.compile(AsterixJavaClient.java:71)
-	at edu.uci.ics.asterix.test.runtime.functions.RuntimeFunctionsTest.test(RuntimeFunctionsTest.java:150)
-	at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
-	at java.lang.reflect.Method.invoke(Method.java:597)
-	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
-	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
-	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
-	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
-	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
-	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
-	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
-	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
-	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
-	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
-	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
-	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
-	at org.junit.runners.Suite.runChild(Suite.java:128)
-	at org.junit.runners.Suite.runChild(Suite.java:24)
-	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
-	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
-	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
-	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
-	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
-	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
-	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
-	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
-	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
-	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
-
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.2.update.aql
index f0f4a6e..a3395b1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.2.update.aql
@@ -1,164 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
 create external dataset DBLP(DBLPType) 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
 
-
-write output to nc1:'rttest/fuzzyjoin_dblp-splits-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $paperLeft in dataset('DBLP')
-    let $lenLeft := len(counthashed-word-tokens($paperLeft.title))
-    let $tokensLeft :=
-        for $tokenUnranked in counthashed-word-tokens($paperLeft.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefix_tokenLeft in subset-collection(
-                                $tokensLeft, 
-                                0,
-                                prefix-len-jaccard(len($tokensLeft), .5f))
-
-    for $paperRight in dataset('DBLP')
-    let $lenRight := len(counthashed-word-tokens($paperRight.title))
-    let $tokensRight :=
-        for $tokenUnranked in counthashed-word-tokens($paperRight.title)
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $paper in dataset('DBLP')
-            for $token in counthashed-word-tokens($paper.title)
-            group by $tokenGroupped := $token with $paper
-            order by count($paper), $tokenGroupped
-            return $tokenGroupped
-        where $tokenUnranked = $tokenRanked
-        order by $i
-        return $i
-    for $prefix_tokenRight in subset-collection(
-                                $tokensRight, 
-                                0,
-                                prefix-len-jaccard(len($tokensRight), .5f))
-
-    where $prefix_tokenLeft = $prefix_tokenRight
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenLeft,
-                    $tokensLeft,
-                    $lenRight,
-                    $tokensRight,
-                    $prefix_tokenLeft,
-                    .5f)
-    where $sim >= .5f and $paperLeft.id < $paperRight.id
-    group by $idLeft := $paperLeft.id, $idRight := $paperRight.id with $sim
-    return {'idLeft': $idLeft, 'idRight': $idRight, 'sim': $sim[0]}
-
-for $paperLeft in dataset('DBLP')
-for $paperRight in dataset('DBLP')
-where $ridpair.idLeft = $paperLeft.id and $ridpair.idRight = $paperRight.id
-order by $paperLeft.id, $paperRight.id
-return {'left': $paperLeft, 'right': $paperRight, 'sim': $ridpair.sim}
-
-/*
-edu.uci.ics.aqua.common.exceptions.AquaException: Attempting to construct a nested plan with 3 operator descriptors. Currently, nested plans can only consist in linear pipelines of Asterix micro operators.
-	at edu.uci.ics.aqua.algebra.operators.physical.AbstractGroupByPhysicalOperator.buildPipelineWithProjection(AbstractGroupByPhysicalOperator.java:47)
-	at edu.uci.ics.aqua.algebra.operators.physical.AbstractGroupByPhysicalOperator.compileSubplans(AbstractGroupByPhysicalOperator.java:29)
-	at edu.uci.ics.aqua.algebra.operators.physical.PreSortedGroupByPOperator.contributeRuntimeOperator(PreSortedGroupByPOperator.java:133)
-	at edu.uci.ics.aqua.algebra.operators.logical.AbstractLogicalOperator.contributeRuntimeOperator(AbstractLogicalOperator.java:208)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:52)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:44)
-	at edu.uci.ics.aqua.jobgen.impl.PlanCompiler.compilePlan(PlanCompiler.java:30)
-	at edu.uci.ics.aqua.api.HeuristicCompilerFactoryBuilder$1$1.createJob(HeuristicCompilerFactoryBuilder.java:64)
-	at edu.uci.ics.asterix.api.common.APIFramework.compileQuery(APIFramework.java:323)
-	at edu.uci.ics.asterix.api.java.AsterixJavaClient.compile(AsterixJavaClient.java:71)
-	at edu.uci.ics.asterix.test.runtime.functions.RuntimeFunctionsTest.test(RuntimeFunctionsTest.java:150)
-	at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
-	at java.lang.reflect.Method.invoke(Method.java:597)
-	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
-	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
-	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
-	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
-	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
-	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
-	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
-	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
-	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
-	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
-	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
-	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
-	at org.junit.runners.Suite.runChild(Suite.java:128)
-	at org.junit.runners.Suite.runChild(Suite.java:24)
-	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
-	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
-	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
-	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
-	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
-	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
-	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
-	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
-	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
-	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
-	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
-
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.3.query.aql
index f0f4a6e..5a9bac4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-splits-3_1/dblp-splits-3_1.3.query.aql
@@ -1,24 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type DBLPType as open {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create external dataset DBLP(DBLPType) 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
-
-
-write output to nc1:'rttest/fuzzyjoin_dblp-splits-3_1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.1.ddl.aql
index b31ba58..89d2e94 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.1.ddl.aql
@@ -24,19 +24,3 @@
 
 create dataset User(UserType) primary key name;
 
-load dataset User
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/events/tiny/user.adm"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_events-users-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('User')
-let $similar_users :=
- for $similar_user in dataset('User')
- where $user.interests ~= $similar_user.interests
- order by $similar_user.name 
- return { "user_name": $similar_user.name }
-order by $user.name 
-return { "user_name": $user.name, "similar_users": $similar_users }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.2.update.aql
index b31ba58..b87e8a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.2.update.aql
@@ -1,42 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type AddressType as closed {
- street: string,
- city: string,
- zip: string,
- latlong: point
-}
-
-create type UserType as open{
- name: string,
- interests: {{string}},
- address: AddressType,
- member_of: {{
-  {
-    sig_id: int32,
-    chapter_name: string,
-    member_since: date
-  }
-}}
-}
-
-create dataset User(UserType) primary key name;
-
 load dataset User
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/events/tiny/user.adm"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_events-users-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('User')
-let $similar_users :=
- for $similar_user in dataset('User')
- where $user.interests ~= $similar_user.interests
- order by $similar_user.name 
- return { "user_name": $similar_user.name }
-order by $user.name 
-return { "user_name": $user.name, "similar_users": $similar_users }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.3.query.aql
index b31ba58..43b0659 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1/events-users-aqlplus_1.3.query.aql
@@ -1,35 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type AddressType as closed {
- street: string,
- city: string,
- zip: string,
- latlong: point
-}
-
-create type UserType as open{
- name: string,
- interests: {{string}},
- address: AddressType,
- member_of: {{
-  {
-    sig_id: int32,
-    chapter_name: string,
-    member_since: date
-  }
-}}
-}
-
-create dataset User(UserType) primary key name;
-
-load dataset User
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/events/tiny/user.adm"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_events-users-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('User')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.1.ddl.aql
index af327b4..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.1.ddl.aql
@@ -11,16 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user.interests ~= $user2.interests and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.2.update.aql
index af327b4..fb9f127 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.2.update.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user.interests ~= $user2.interests and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.3.query.aql
index af327b4..b0bd349 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1/user-int-aqlplus_1.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.1.ddl.aql
index 2d81ddd..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.1.ddl.aql
@@ -11,16 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $user2 in dataset('Users')
-for $user in dataset('Users')
-where $user.interests ~= $user2.interests and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.2.update.aql
index 2d81ddd..fb9f127 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.2.update.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $user2 in dataset('Users')
-for $user in dataset('Users')
-where $user.interests ~= $user2.interests and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.3.query.aql
index 2d81ddd..54e49ac 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2/user-int-aqlplus_2.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_2.adm';
-
 set simthreshold '.5f';
 
 for $user2 in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.1.ddl.aql
index 9785f52..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.1.ddl.aql
@@ -11,16 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user2.interests ~= $user.interests and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.2.update.aql
index 9785f52..88a8e4e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.2.update.aql
@@ -2,25 +2,7 @@
 create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user2.interests ~= $user.interests and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.3.query.aql
index 9785f52..2017f1b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3/user-int-aqlplus_3.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-int-aqlplus_3.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.1.ddl.aql
index bdcaa36..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.1.ddl.aql
@@ -11,17 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_1.1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user.lottery_numbers ~= $user2.lottery_numbers and $user.uid < $user2.uid
-let $sim := similarity-jaccard($user.lottery_numbers, $user2.lottery_numbers)
-order by $sim desc, $user.uid, $user2.uid limit 3
-return { 'user': $user, 'user2': $user2, 'sim': $sim }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.2.update.aql
index bdcaa36..fb9f127 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.2.update.aql
@@ -1,27 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_1.1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user.lottery_numbers ~= $user2.lottery_numbers and $user.uid < $user2.uid
-let $sim := similarity-jaccard($user.lottery_numbers, $user2.lottery_numbers)
-order by $sim desc, $user.uid, $user2.uid limit 3
-return { 'user': $user, 'user2': $user2, 'sim': $sim }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.3.query.aql
index bdcaa36..6bf25bd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1/user-lot-aqlplus_1.1.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_1.1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.1.ddl.aql
index db833d0..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.1.ddl.aql
@@ -11,16 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user.lottery_numbers ~= $user2.lottery_numbers and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.2.update.aql
index db833d0..fb9f127 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.2.update.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user.lottery_numbers ~= $user2.lottery_numbers and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.3.query.aql
index db833d0..789f19c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1/user-lot-aqlplus_1.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.1.ddl.aql
index 9f6e758..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.1.ddl.aql
@@ -11,16 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $user2 in dataset('Users')
-for $user in dataset('Users')
-where $user.lottery_numbers ~= $user2.lottery_numbers and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.2.update.aql
index 9f6e758..fb9f127 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.2.update.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $user2 in dataset('Users')
-for $user in dataset('Users')
-where $user.lottery_numbers ~= $user2.lottery_numbers and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.3.query.aql
index 9f6e758..13bcac3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2/user-lot-aqlplus_2.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_2.adm';
-
 set simthreshold '.5f';
 
 for $user2 in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.1.ddl.aql
index e438ec8..3930bdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.1.ddl.aql
@@ -11,16 +11,3 @@
 
 create dataset Users(UserType) primary key uid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user2.lottery_numbers ~= $user.lottery_numbers and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.2.update.aql
index e438ec8..fb9f127 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.2.update.aql
@@ -1,26 +1,6 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $user2 in dataset('Users')
-where $user2.lottery_numbers ~= $user.lottery_numbers and $user.uid < $user2.uid
-order by $user.uid, $user2.uid
-return { 'user': $user, 'user2': $user2 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.3.query.aql
index e438ec8..2453ed2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3/user-lot-aqlplus_3.3.query.aql
@@ -1,22 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-create dataverse fuzzyjoin;
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-lot-aqlplus_3.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.1.ddl.aql
index 6dd9cbc..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.1.ddl.aql
@@ -21,80 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $user in dataset('Users')
-    let $lenUser := len($user.interests)
-    let $tokensUser :=
-        for $token in $user.interests
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.interests 
-            group by $tokenGroupped := $token with $user
-            order by count($user), $tokenGroupped
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenUser in subset-collection(
-                                $tokensUser, 
-                                0,
-                                prefix-len-jaccard($lenUser, .5f))
-
-    for $visitor in dataset('Visitors')
-    let $lenVisitor := len($visitor.interests)
-    let $tokensVisitor :=
-        for $token in $visitor.interests
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.interests 
-            group by $tokenGroupped := $token with $user 
-            order by count($user), $tokenGroupped
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenVisitor in subset-collection(
-                                    $tokensVisitor, 
-                                    0, 
-                                    prefix-len-jaccard($lenVisitor, .5f))
-
-    where $prefixTokenUser = $prefixTokenVisitor
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenUser,
-                    $tokensUser,
-                    $lenVisitor,
-                    $tokensVisitor,
-                    $prefixTokenUser,
-                    .5f)
-    where $sim >= .5f
-    group by $uid := $user.uid, $vid := $visitor.vid with $sim
-    return {'uid': $uid, 'vid': $vid, 'sim': $sim[0]}
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $ridpair.uid = $user.uid and $ridpair.vid = $visitor.vid
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.2.update.aql
index 6dd9cbc..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,72 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $user in dataset('Users')
-    let $lenUser := len($user.interests)
-    let $tokensUser :=
-        for $token in $user.interests
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.interests 
-            group by $tokenGroupped := $token with $user
-            order by count($user), $tokenGroupped
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenUser in subset-collection(
-                                $tokensUser, 
-                                0,
-                                prefix-len-jaccard($lenUser, .5f))
-
-    for $visitor in dataset('Visitors')
-    let $lenVisitor := len($visitor.interests)
-    let $tokensVisitor :=
-        for $token in $visitor.interests
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.interests 
-            group by $tokenGroupped := $token with $user 
-            order by count($user), $tokenGroupped
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenVisitor in subset-collection(
-                                    $tokensVisitor, 
-                                    0, 
-                                    prefix-len-jaccard($lenVisitor, .5f))
-
-    where $prefixTokenUser = $prefixTokenVisitor
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenUser,
-                    $tokensUser,
-                    $lenVisitor,
-                    $tokensVisitor,
-                    $prefixTokenUser,
-                    .5f)
-    where $sim >= .5f
-    group by $uid := $user.uid, $vid := $visitor.vid with $sim
-    return {'uid': $uid, 'vid': $vid, 'sim': $sim[0]}
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $ridpair.uid = $user.uid and $ridpair.vid = $visitor.vid
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.3.query.aql
index 6dd9cbc..89dd3a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1/user-vis-int-3_1.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-3_1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.1.ddl.aql
index 40fa07b..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.1.ddl.aql
@@ -21,20 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.interests ~= $visitor.interests
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.2.update.aql
index 40fa07b..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.interests ~= $visitor.interests
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.3.query.aql
index 40fa07b..863a339 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1/user-vis-int-aqlplus_1.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.1.ddl.aql
index e56c48c..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.1.ddl.aql
@@ -21,20 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $visitor in dataset('Visitors')
-for $user in dataset('Users')
-where $user.interests ~= $visitor.interests
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.2.update.aql
index e56c48c..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $visitor in dataset('Visitors')
-for $user in dataset('Users')
-where $user.interests ~= $visitor.interests
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.3.query.aql
index e56c48c..0b6c54d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2/user-vis-int-aqlplus_2.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_2.adm';
-
 set simthreshold '.5f';
 
 for $visitor in dataset('Visitors')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.1.ddl.aql
index 01c172e..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.1.ddl.aql
@@ -21,20 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $visitor.interests ~= $user.interests
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.2.update.aql
index 01c172e..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $visitor.interests ~= $user.interests
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.3.query.aql
index 01c172e..519c6c6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3/user-vis-int-aqlplus_3.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-aqlplus_3.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.1.ddl.aql
index 0746be5..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.1.ddl.aql
@@ -21,21 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-vis-user-lot-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-for $user2 in dataset('Users')
-where $user.interests ~= $visitor.interests and $visitor.lottery_numbers ~= $user2.lottery_numbers
-order by $user.uid, $visitor.vid, $user2.uid
-return {'user': $user, 'visitor': $visitor, 'user2': $user2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.2.update.aql
index 0746be5..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,13 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-vis-user-lot-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-for $user2 in dataset('Users')
-where $user.interests ~= $visitor.interests and $visitor.lottery_numbers ~= $user2.lottery_numbers
-order by $user.uid, $visitor.vid, $user2.uid
-return {'user': $user, 'visitor': $visitor, 'user2': $user2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.3.query.aql
index 0746be5..4dd6e92 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1/user-vis-int-vis-user-lot-aqlplus_1.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-int-vis-user-lot-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.1.ddl.aql
index 6654d07..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.1.ddl.aql
@@ -21,80 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $user in dataset('Users')
-    let $lenUser := len($user.lottery_numbers)
-    let $tokensUser :=
-        for $token in $user.lottery_numbers
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.lottery_numbers 
-            group by $tokenGroupped := $token with $user
-            order by count($user)
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenUser in subset-collection(
-                                $tokensUser, 
-                                0,
-                                prefix-len-jaccard($lenUser, .5f))
-
-    for $visitor in dataset('Visitors')
-    let $lenVisitor := len($visitor.lottery_numbers)
-    let $tokensVisitor :=
-        for $token in $visitor.lottery_numbers
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.lottery_numbers 
-            group by $tokenGroupped := $token with $user 
-            order by count($user)
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenVisitor in subset-collection(
-                                    $tokensVisitor, 
-                                    0, 
-                                    prefix-len-jaccard($lenVisitor, .5f))
-
-    where $prefixTokenUser = $prefixTokenVisitor
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenUser,
-                    $tokensUser,
-                    $lenVisitor,
-                    $tokensVisitor,
-                    $prefixTokenUser,
-                    .5f)
-    where $sim >= .5f
-    group by $uid := $user.uid, $vid := $visitor.vid with $sim
-    return {'uid': $uid, 'vid': $vid, 'sim': $sim[0]}
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $ridpair.uid = $user.uid and $ridpair.vid = $visitor.vid
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.2.update.aql
index 6654d07..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,72 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-3_1.adm';
-
-//
-// -- - Stage 3 - --
-//
-for $ridpair in 
-    //
-    // -- - Stage 2 - --
-    //
-    for $user in dataset('Users')
-    let $lenUser := len($user.lottery_numbers)
-    let $tokensUser :=
-        for $token in $user.lottery_numbers
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.lottery_numbers 
-            group by $tokenGroupped := $token with $user
-            order by count($user)
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenUser in subset-collection(
-                                $tokensUser, 
-                                0,
-                                prefix-len-jaccard($lenUser, .5f))
-
-    for $visitor in dataset('Visitors')
-    let $lenVisitor := len($visitor.lottery_numbers)
-    let $tokensVisitor :=
-        for $token in $visitor.lottery_numbers
-        for $tokenRanked at $i in
-            //
-            // -- - Stage 1 - --
-            //
-            for $user in dataset('Users')
-            for $token in $user.lottery_numbers 
-            group by $tokenGroupped := $token with $user 
-            order by count($user)
-            return $tokenGroupped
-        where $token = $tokenRanked
-        order by $i
-        return $i
-    for $prefixTokenVisitor in subset-collection(
-                                    $tokensVisitor, 
-                                    0, 
-                                    prefix-len-jaccard($lenVisitor, .5f))
-
-    where $prefixTokenUser = $prefixTokenVisitor
-
-    let $sim := similarity-jaccard-prefix(
-                    $lenUser,
-                    $tokensUser,
-                    $lenVisitor,
-                    $tokensVisitor,
-                    $prefixTokenUser,
-                    .5f)
-    where $sim >= .5f
-    group by $uid := $user.uid, $vid := $visitor.vid with $sim
-    return {'uid': $uid, 'vid': $vid, 'sim': $sim[0]}
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $ridpair.uid = $user.uid and $ridpair.vid = $visitor.vid
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor, 'sim': $ridpair.sim}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.3.query.aql
index 6654d07..5d489ab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1/user-vis-lot-3_1.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-3_1.adm';
-
 //
 // -- - Stage 3 - --
 //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.1.ddl.aql
index a289015..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.1.ddl.aql
@@ -21,20 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.2.update.aql
index a289015..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.3.query.aql
index a289015..474752c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1/user-vis-lot-aqlplus_1.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.1.ddl.aql
index 59b7c9a..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.1.ddl.aql
@@ -21,20 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $visitor in dataset('Visitors')
-for $user in dataset('Users')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.2.update.aql
index 59b7c9a..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $visitor in dataset('Visitors')
-for $user in dataset('Users')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.3.query.aql
index 59b7c9a..17d7bf0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2/user-vis-lot-aqlplus_2.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_2.adm';
-
 set simthreshold '.5f';
 
 for $visitor in dataset('Visitors')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.1.ddl.aql
index 861db2f..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.1.ddl.aql
@@ -21,20 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $visitor.lottery_numbers ~= $user.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.2.update.aql
index 861db2f..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,12 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_3.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $visitor.lottery_numbers ~= $user.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.3.query.aql
index 861db2f..afd4313 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3/user-vis-lot-aqlplus_3.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_3.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.1.ddl.aql
index 49ac082..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.1.ddl.aql
@@ -21,21 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_4.adm';
-
-set simfunction 'Jaccard';
-set simthreshold '.6f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.2.update.aql
index 49ac082..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,13 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_4.adm';
-
-set simfunction 'Jaccard';
-set simthreshold '.6f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.3.query.aql
index 49ac082..3f84e64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4/user-vis-lot-aqlplus_4.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_4.adm';
-
 set simfunction 'Jaccard';
 set simthreshold '.6f';
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.1.ddl.aql
index 08e8bf8..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.1.ddl.aql
@@ -21,18 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_5.adm';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.2.update.aql
index 08e8bf8..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,10 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_5.adm';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers
-order by $user.uid, $visitor.vid
-return {'user': $user, 'visitor': $visitor}
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.3.query.aql
index 08e8bf8..4070956 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5/user-vis-lot-aqlplus_5.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-aqlplus_5.adm';
-
 for $user in dataset('Users')
 for $visitor in dataset('Visitors')
 where $user.lottery_numbers ~= $visitor.lottery_numbers
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.1.ddl.aql
index 4679eca..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.1.ddl.aql
@@ -21,21 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers 
-and $user.interests ~= $visitor.interests 
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.2.update.aql
index 4679eca..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,13 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_1.adm';
-
-set simthreshold '.5f';
-
-for $user in dataset('Users')
-for $visitor in dataset('Visitors')
-where $user.lottery_numbers ~= $visitor.lottery_numbers 
-and $user.interests ~= $visitor.interests 
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.3.query.aql
index 4679eca..ce272ee 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1/user-vis-lot-int-aqlplus_1.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_1.adm';
-
 set simthreshold '.5f';
 
 for $user in dataset('Users')
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.1.ddl.aql
index 669284c..beb47a2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.1.ddl.aql
@@ -21,21 +21,3 @@
 create dataset Users(UserType) primary key uid;
 create dataset Visitors(VisitorType) primary key vid;
 
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $visitor in dataset('Visitors')
-for $user in dataset('Users')
-where $user.lottery_numbers ~= $visitor.lottery_numbers 
-and $user.interests ~= $visitor.interests 
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.2.update.aql
index 669284c..8b3b85b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.2.update.aql
@@ -1,26 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
@@ -29,13 +8,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
 
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_2.adm';
-
-set simthreshold '.5f';
-
-for $visitor in dataset('Visitors')
-for $user in dataset('Users')
-where $user.lottery_numbers ~= $visitor.lottery_numbers 
-and $user.interests ~= $visitor.interests 
-order by $user.uid, $visitor.vid
-return { 'user': $user, 'visitor': $visitor }
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.3.query.aql
index 669284c..2f7d1d8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2/user-vis-lot-int-aqlplus_2.3.query.aql
@@ -1,36 +1,5 @@
-drop dataverse fuzzyjoin if exists;
-
-create dataverse fuzzyjoin;
-
 use dataverse fuzzyjoin;
 
-create type UserType as open {
-  uid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create type VisitorType as open {
-  vid: int32, 
-  name: string,
-  lottery_numbers: [int32],
-  interests: {{string}}
-}
-
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-load dataset Users 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
-
-load dataset Visitors 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/users-visitors-small/visitors.json"),("format"="adm"));
-
-write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_2.adm';
-
 set simthreshold '.5f';
 
 for $visitor in dataset('Visitors')
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02/hdfs_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02/hdfs_02.1.ddl.aql
index fa129c3..ea07600 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02/hdfs_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02/hdfs_02.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineType as closed {
  content: string
 };
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03/hdfs_03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03/hdfs_03.1.ddl.aql
index cd47745..5aff169 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03/hdfs_03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03/hdfs_03.1.ddl.aql
@@ -9,6 +9,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineType as closed {
  content: string
 };
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs/issue_245_hdfs.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs/issue_245_hdfs.1.ddl.aql
index 41801a8..57ab677 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs/issue_245_hdfs.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs/issue_245_hdfs.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type LineType as closed {
  line: string
 };
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql
index aba1f9c..1b990be 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -35,3 +37,7 @@
   total: float,
   items: [int32]
 }
+
+create dataset Customers(CustomerType) primary key cid;
+create dataset Orders(OrderType) primary key oid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql
index c67e8a8..e94207f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join/btree-primary-equi-join.2.update.aql
@@ -7,9 +7,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-create dataset Orders(OrderType) primary key oid;
-
 load dataset Customers
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/nontagged/customerData.json"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
index 627e37d..442a8df 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -24,3 +26,6 @@
   misc: string
 }
 
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
index e794f51..78a8e47 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
@@ -7,9 +7,6 @@
 
 use dataverse test;
 
-create dataset DBLP(DBLPType) primary key id;
-create dataset CSX(CSXType) primary key id;
-
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":"));
@@ -18,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 title_index on DBLP(authors);
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
new file mode 100644
index 0000000..070ebdb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
@@ -0,0 +1,11 @@
+/*
+ * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
+ *                  DBLP has a secondary btree index on title, and given the 'indexnl' hint 
+ *                  we expect the join to be transformed into an indexed nested-loop join.
+ * Success        : Yes
+ */
+
+use dataverse test;
+
+create index title_index on DBLP(authors);
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
index 809639a..e24c6d7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type MyRecord as closed {
   id: int32,
   point: point,
@@ -20,3 +22,6 @@
   circle: circle
 }
 
+create dataset MyData1(MyRecord) primary key id;
+create dataset MyData2(MyRecord) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
index b4ffbac..ead81a7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
@@ -7,9 +7,6 @@
 
 use dataverse test;
 
-create dataset MyData1(MyRecord) primary key id;
-create dataset MyData2(MyRecord) primary key id;
-
 load dataset MyData1
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
@@ -18,5 +15,3 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
 
-create index rtree_index on MyData1(point) type rtree;
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
new file mode 100644
index 0000000..391501b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/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 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(point) type rtree;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
index 248c8ba..2e951e2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.1.ddl.aql
@@ -21,15 +21,5 @@
 
 create dataset employee(Emp) primary key id;
 
-load dataset employee
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
-
 create index idx_employee_f_l_name on employee(fname,lname);
 
-write output to nc1:"rttest/index-selection_btree-index-composite-key.adm";
-
-for $l in dataset('employee')
-where $l.fname="Julio" and $l.lname="Isa"
-return $l
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
index 248c8ba..b3251a8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
@@ -7,29 +7,9 @@
  * Date            : 7th August 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type Emp as closed {
-id:int32,
-fname:string,
-lname:string,
-age:int32,
-dept:string
-}
-
-create dataset employee(Emp) primary key id;
-
 load dataset employee
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
 
-create index idx_employee_f_l_name on employee(fname,lname);
-
-write output to nc1:"rttest/index-selection_btree-index-composite-key.adm";
-
-for $l in dataset('employee')
-where $l.fname="Julio" and $l.lname="Isa"
-return $l
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.query.aql
index 248c8ba..dff06ea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key/btree-index-composite-key.3.query.aql
@@ -7,28 +7,8 @@
  * Date            : 7th August 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type Emp as closed {
-id:int32,
-fname:string,
-lname:string,
-age:int32,
-dept:string
-}
-
-create dataset employee(Emp) primary key id;
-
-load dataset employee
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
-
-create index idx_employee_f_l_name on employee(fname,lname);
-
-write output to nc1:"rttest/index-selection_btree-index-composite-key.adm";
-
 for $l in dataset('employee')
 where $l.fname="Julio" and $l.lname="Isa"
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
index e3214de..aeb8652c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.1.ddl.aql
@@ -24,25 +24,5 @@
 
 create dataset Orders(OrderType) primary key o_orderkey;
 
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
 create index idx_Orders_Custkey on Orders(o_custkey);
 
-write output to nc1:"rttest/index-selection_btree-index-rewrite-multiple.adm";
-
-for $o in dataset('Orders')
-for $o2 in dataset('Orders')
-where $o.o_custkey = 20 and $o2.o_custkey = 10
-and $o.o_orderstatus < $o2.o_orderstatus
-order by $o.o_orderkey, $o2.o_orderkey
-return {
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey,
-  "o_orderstatus": $o.o_orderstatus,
-  "o_orderkey2": $o2.o_orderkey,
-  "o_custkey2": $o2.o_custkey,
-  "o_orderstatus2": $o2.o_orderstatus
-}
- 
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql
index e3214de..d6e52bd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.2.update.aql
@@ -6,43 +6,9 @@
  * Issue           : Issue 204
  */
  
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as open {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType) primary key o_orderkey;
-
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_Orders_Custkey on Orders(o_custkey);
-
-write output to nc1:"rttest/index-selection_btree-index-rewrite-multiple.adm";
-
-for $o in dataset('Orders')
-for $o2 in dataset('Orders')
-where $o.o_custkey = 20 and $o2.o_custkey = 10
-and $o.o_orderstatus < $o2.o_orderstatus
-order by $o.o_orderkey, $o2.o_orderkey
-return {
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey,
-  "o_orderstatus": $o.o_orderstatus,
-  "o_orderkey2": $o2.o_orderkey,
-  "o_custkey2": $o2.o_custkey,
-  "o_orderstatus2": $o2.o_orderstatus
-}
- 
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.query.aql
index e3214de..8d7faab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.query.aql
@@ -6,32 +6,8 @@
  * Issue           : Issue 204
  */
  
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as open {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType) primary key o_orderkey;
-
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_Orders_Custkey on Orders(o_custkey);
-
-write output to nc1:"rttest/index-selection_btree-index-rewrite-multiple.adm";
-
 for $o in dataset('Orders')
 for $o2 in dataset('Orders')
 where $o.o_custkey = 20 and $o2.o_custkey = 10
@@ -45,4 +21,4 @@
   "o_custkey2": $o2.o_custkey,
   "o_orderstatus2": $o2.o_orderstatus
 }
- 
\ No newline at end of file
+ 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql
index 8fb416b..82c835d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.1.ddl.aql
@@ -19,15 +19,5 @@
 
 create dataset Customers(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm"));
-
 create index age_index on Customers(age);
 
-write output to nc1:"rttest/index-selection_cust-index-age-nullable.adm";
-
-for $c in dataset('Customers')
-where $c.age < 20
-order by $c.cid
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.2.update.aql
index 8fb416b..a1c40f1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.2.update.aql
@@ -1,33 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm"));
 
-create index age_index on Customers(age);
-
-write output to nc1:"rttest/index-selection_cust-index-age-nullable.adm";
-
-for $c in dataset('Customers')
-where $c.age < 20
-order by $c.cid
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.query.aql
index 8fb416b..86e1e8d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable/cust-index-age-nullable.3.query.aql
@@ -1,32 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm"));
-
-create index age_index on Customers(age);
-
-write output to nc1:"rttest/index-selection_cust-index-age-nullable.adm";
-
 for $c in dataset('Customers')
 where $c.age < 20
 order by $c.cid
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
index e9b9540..7e7ae8c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.1.ddl.aql
@@ -15,15 +15,5 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-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;
-
 create index ngram_index on DBLP(title) type ngram(3);
 
-write output to nc1:"rttest/index-selection_inverted-index-ngram-contains.adm";
-
-for $o in dataset('DBLP')
-where contains($o.title, "Multimedia")
-order by $o.id
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql
index e9b9540..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.2.update.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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;
 
-create index ngram_index on DBLP(title) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-contains.adm";
-
-for $o in dataset('DBLP')
-where contains($o.title, "Multimedia")
-order by $o.id
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.query.aql
index e9b9540..d6de89d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.query.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
-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;
-
-create index ngram_index on DBLP(title) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-contains.adm";
-
 for $o in dataset('DBLP')
 where contains($o.title, "Multimedia")
 order by $o.id
-return $o
\ No newline at end of file
+return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/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/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
index 3e637ed..d2ef8c8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/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/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.1.ddl.aql
@@ -15,15 +15,5 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-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;
-
 create index ngram_index on DBLP(authors) type ngram(3);
 
-write output to nc1:"rttest/index-selection_inverted-index-ngram-edit-distance-panic.adm";
-
-for $o in dataset('DBLP')
-let $ed := edit-distance-check($o.authors, "Amihay Motro", 5)
-where $ed[0]
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/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/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.2.update.aql
index 3e637ed..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/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/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.2.update.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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;
 
-create index ngram_index on DBLP(authors) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-edit-distance-panic.adm";
-
-for $o in dataset('DBLP')
-let $ed := edit-distance-check($o.authors, "Amihay Motro", 5)
-where $ed[0]
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.query.aql
index 3e637ed..953f942 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.query.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
-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;
-
-create index ngram_index on DBLP(authors) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-edit-distance-panic.adm";
-
 for $o in dataset('DBLP')
 let $ed := edit-distance-check($o.authors, "Amihay Motro", 5)
 where $ed[0]
-return $o
\ No newline at end of file
+return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql
index 1fca0d4..d2ef8c8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.1.ddl.aql
@@ -15,15 +15,5 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-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;
-
 create index ngram_index on DBLP(authors) type ngram(3);
 
-write output to nc1:"rttest/index-selection_inverted-index-ngram-edit-distance.adm";
-
-for $o in dataset('DBLP')
-let $ed := edit-distance-check($o.authors, "Amihay Motro", 1)
-where $ed[0]
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.2.update.aql
index 1fca0d4..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.2.update.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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;
 
-create index ngram_index on DBLP(authors) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-edit-distance.adm";
-
-for $o in dataset('DBLP')
-let $ed := edit-distance-check($o.authors, "Amihay Motro", 1)
-where $ed[0]
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.query.aql
index 1fca0d4..70421c2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.query.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
-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;
-
-create index ngram_index on DBLP(authors) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-edit-distance.adm";
-
 for $o in dataset('DBLP')
 let $ed := edit-distance-check($o.authors, "Amihay Motro", 1)
 where $ed[0]
-return $o
\ No newline at end of file
+return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql
index 1b8167b..7e7ae8c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.1.ddl.aql
@@ -15,15 +15,5 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-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;
-
 create index ngram_index on DBLP(title) type ngram(3);
 
-write output to nc1:"rttest/index-selection_inverted-index-ngram-jaccard.adm";
-
-for $o in dataset('DBLP')
-let $jacc := similarity-jaccard-check(gram-tokens($o.title, 3, false), gram-tokens("Transactions for Cooperative Environments", 3, false), 0.5f)
-where $jacc[0]
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.2.update.aql
index 1b8167b..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.2.update.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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;
 
-create index ngram_index on DBLP(title) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-jaccard.adm";
-
-for $o in dataset('DBLP')
-let $jacc := similarity-jaccard-check(gram-tokens($o.title, 3, false), gram-tokens("Transactions for Cooperative Environments", 3, false), 0.5f)
-where $jacc[0]
-return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.query.aql
index 1b8167b..5d9ad67 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.query.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
-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;
-
-create index ngram_index on DBLP(title) type ngram(3);
-
-write output to nc1:"rttest/index-selection_inverted-index-ngram-jaccard.adm";
-
 for $o in dataset('DBLP')
 let $jacc := similarity-jaccard-check(gram-tokens($o.title, 3, false), gram-tokens("Transactions for Cooperative Environments", 3, false), 0.5f)
 where $jacc[0]
-return $o
\ No newline at end of file
+return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql
index 79e728f..207c8ec 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.1.ddl.aql
@@ -1,5 +1,3 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
 create type AddressType as closed {
@@ -22,16 +20,5 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-load dataset Customers 
-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;
 
-write output to nc1:"rttest/index-selection_inverted-index-olist-edit-distance-panic.adm";
-
-for $c in dataset('Customers')
-let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 3)
-where $ed[0]
-order by $c.cid
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.2.update.aql
index 79e728f..5b72d8a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.2.update.aql
@@ -1,37 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
 load dataset Customers 
 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;
-
-write output to nc1:"rttest/index-selection_inverted-index-olist-edit-distance-panic.adm";
-
-for $c in dataset('Customers')
-let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 3)
-where $ed[0]
-order by $c.cid
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.query.aql
index 79e728f..d4a4f60 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic/inverted-index-olist-edit-distance-panic.3.query.aql
@@ -1,35 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
-load dataset Customers 
-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;
-
-write output to nc1:"rttest/index-selection_inverted-index-olist-edit-distance-panic.adm";
-
 for $c in dataset('Customers')
 let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 3)
 where $ed[0]
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql
index 793d578..e5774db 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.1.ddl.aql
@@ -22,16 +22,5 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-load dataset Customers 
-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;
 
-write output to nc1:"rttest/index-selection_inverted-index-olist-edit-distance.adm";
-
-for $c in dataset('Customers')
-let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 1)
-where $ed[0]
-order by $c.cid
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.2.update.aql
index 793d578..5b72d8a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.2.update.aql
@@ -1,37 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
 load dataset Customers 
 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;
-
-write output to nc1:"rttest/index-selection_inverted-index-olist-edit-distance.adm";
-
-for $c in dataset('Customers')
-let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 1)
-where $ed[0]
-order by $c.cid
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.query.aql
index 793d578..7ebd73e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance/inverted-index-olist-edit-distance.3.query.aql
@@ -1,35 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
-load dataset Customers 
-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;
-
-write output to nc1:"rttest/index-selection_inverted-index-olist-edit-distance.adm";
-
 for $c in dataset('Customers')
 let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 1)
 where $ed[0]
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql
index aacb656..e5774db 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.1.ddl.aql
@@ -22,15 +22,5 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-load dataset Customers 
-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;
 
-write output to nc1:"rttest/index-selection_inverted-index-olist-jaccard.adm";
-
-for $c in dataset('Customers')
-let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
-where $jacc[0]
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.2.update.aql
index aacb656..5b72d8a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.2.update.aql
@@ -1,36 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
 load dataset Customers 
 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;
-
-write output to nc1:"rttest/index-selection_inverted-index-olist-jaccard.adm";
-
-for $c in dataset('Customers')
-let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
-where $jacc[0]
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.query.aql
index aacb656..27a838ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard/inverted-index-olist-jaccard.3.query.aql
@@ -1,35 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
-load dataset Customers 
-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;
-
-write output to nc1:"rttest/index-selection_inverted-index-olist-jaccard.adm";
-
 for $c in dataset('Customers')
 let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
 where $jacc[0]
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql
index a6ea348..a7177ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.1.ddl.aql
@@ -22,15 +22,5 @@
 create dataset Customers(CustomerType) 
   primary key cid on group1;
 
-load dataset Customers 
-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;
 
-write output to nc1:"rttest/index-selection_inverted-index-ulist-jaccard.adm";
-
-for $c in dataset('Customers')
-let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
-where $jacc[0]
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.2.update.aql
index a6ea348..079983b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.2.update.aql
@@ -1,36 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
 load dataset Customers 
 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;
-
-write output to nc1:"rttest/index-selection_inverted-index-ulist-jaccard.adm";
-
-for $c in dataset('Customers')
-let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
-where $jacc[0]
-return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.query.aql
index a6ea348..27a838ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.3.query.aql
@@ -1,35 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create nodegroup group1 if not exists on nc1;
-
-create dataset Customers(CustomerType) 
-  primary key cid on group1;
-
-load dataset Customers 
-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;
-
-write output to nc1:"rttest/index-selection_inverted-index-ulist-jaccard.adm";
-
 for $c in dataset('Customers')
 let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
 where $jacc[0]
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql
index f873dbb..bad04b6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.1.ddl.aql
@@ -15,15 +15,5 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-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;
-
 create index keyword_index on DBLP(title) type keyword;
 
-write output to nc1:"rttest/index-selection_inverted-index-word-contains.adm";
-
-for $o in dataset('DBLP')
-where contains($o.title, "Multimedia")
-order by $o.id
-return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.2.update.aql
index f873dbb..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.2.update.aql
@@ -1,29 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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;
 
-create index keyword_index on DBLP(title) type keyword;
-
-write output to nc1:"rttest/index-selection_inverted-index-word-contains.adm";
-
-for $o in dataset('DBLP')
-where contains($o.title, "Multimedia")
-order by $o.id
-return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.query.aql
index f873dbb..d6de89d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.query.aql
@@ -1,28 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
-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;
-
-create index keyword_index on DBLP(title) type keyword;
-
-write output to nc1:"rttest/index-selection_inverted-index-word-contains.adm";
-
 for $o in dataset('DBLP')
 where contains($o.title, "Multimedia")
 order by $o.id
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql
index 051f4f8..bad04b6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.1.ddl.aql
@@ -15,16 +15,5 @@
 create dataset DBLP(DBLPType) 
   primary key id on group1;
 
-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;
-
 create index keyword_index on DBLP(title) type keyword;
 
-write output to nc1:"rttest/index-selection_inverted-index-word-jaccard.adm";
-
-for $o in dataset('DBLP')
-let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
-where $jacc[0]
-return $o
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.2.update.aql
index 051f4f8..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.2.update.aql
@@ -1,30 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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;
 
-create index keyword_index on DBLP(title) type keyword;
-
-write output to nc1:"rttest/index-selection_inverted-index-word-jaccard.adm";
-
-for $o in dataset('DBLP')
-let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
-where $jacc[0]
-return $o
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.query.aql
index 051f4f8..7ce908c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.query.aql
@@ -1,28 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
-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;
-
-create index keyword_index on DBLP(title) type keyword;
-
-write output to nc1:"rttest/index-selection_inverted-index-word-jaccard.adm";
-
 for $o in dataset('DBLP')
 let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
 where $jacc[0]
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql
index 174c50f..51fdf24 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.1.ddl.aql
@@ -17,19 +17,5 @@
 create dataset Orders(OrderType)
   primary key o_orderkey;
 
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
 create index idx_Orders_Custkey on Orders(o_custkey) ;
 
-write output to nc1:"rttest/index-selection_orders-index-custkey-conjunctive-open.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40 and $o.o_totalprice > 150000.0
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.2.update.aql
index 174c50f..2ed1a52 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.2.update.aql
@@ -1,35 +1,6 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as closed {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_Orders_Custkey on Orders(o_custkey) ;
-
-write output to nc1:"rttest/index-selection_orders-index-custkey-conjunctive-open.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40 and $o.o_totalprice > 150000.0
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.query.aql
index 174c50f..6d18b32 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open/orders-index-custkey-conjunctive-open.3.query.aql
@@ -1,30 +1,5 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as closed {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_Orders_Custkey on Orders(o_custkey) ;
-
-write output to nc1:"rttest/index-selection_orders-index-custkey-conjunctive-open.adm";
-
 for $o in dataset('Orders')
 where
   $o.o_custkey = 40 and $o.o_totalprice > 150000.0
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql
index 6e4e659..51fdf24 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.1.ddl.aql
@@ -17,19 +17,5 @@
 create dataset Orders(OrderType)
   primary key o_orderkey;
 
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
 create index idx_Orders_Custkey on Orders(o_custkey) ;
 
-write output to nc1:"rttest/index-selection_orders-index-custkey-conjunctive.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40 and $o.o_totalprice > 150000.0
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.2.update.aql
index 6e4e659..2ed1a52 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.2.update.aql
@@ -1,35 +1,6 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as closed {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_Orders_Custkey on Orders(o_custkey) ;
-
-write output to nc1:"rttest/index-selection_orders-index-custkey-conjunctive.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40 and $o.o_totalprice > 150000.0
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.query.aql
index 6e4e659..6d18b32 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.query.aql
@@ -1,30 +1,5 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as closed {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_Orders_Custkey on Orders(o_custkey) ;
-
-write output to nc1:"rttest/index-selection_orders-index-custkey-conjunctive.adm";
-
 for $o in dataset('Orders')
 where
   $o.o_custkey = 40 and $o.o_totalprice > 150000.0
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql
index 50088f4..4d38a74 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.1.ddl.aql
@@ -20,19 +20,5 @@
 create dataset Orders(OrderType)
   primary key o_orderkey on group1;
 
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
 create index idx_Orders_Custkey on Orders(o_custkey);
 
-write output to nc1:"rttest/index-selection_orders-index-custkey-open.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey 
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.2.update.aql
index 50088f4..0d60097 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.2.update.aql
@@ -1,38 +1,6 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as open {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset Orders(OrderType)
-  primary key o_orderkey on group1;
-
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_Orders_Custkey on Orders(o_custkey);
-
-write output to nc1:"rttest/index-selection_orders-index-custkey-open.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey 
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.query.aql
index 50088f4..5d47296 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open/orders-index-custkey-open.3.query.aql
@@ -1,33 +1,5 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as open {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset Orders(OrderType)
-  primary key o_orderkey on group1;
-
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_Orders_Custkey on Orders(o_custkey);
-
-write output to nc1:"rttest/index-selection_orders-index-custkey-open.adm";
-
 for $o in dataset('Orders')
 where
   $o.o_custkey = 40
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql
index 9a950aa..8b12616 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.1.ddl.aql
@@ -17,19 +17,5 @@
 create dataset Orders(OrderType)
   primary key o_orderkey;
 
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
 create index idx_Orders_Custkey on Orders(o_custkey);
 
-write output to nc1:"rttest/index-selection_orders-index-custkey.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey 
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.2.update.aql
index 9a950aa..0d60097 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.2.update.aql
@@ -1,35 +1,6 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as closed {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_Orders_Custkey on Orders(o_custkey);
-
-write output to nc1:"rttest/index-selection_orders-index-custkey.adm";
-
-for $o in dataset('Orders')
-where
-  $o.o_custkey = 40
-order by $o.o_orderkey
-return {  
-  "o_orderkey": $o.o_orderkey,
-  "o_custkey": $o.o_custkey 
-}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.query.aql
index 9a950aa..5d47296 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey/orders-index-custkey.3.query.aql
@@ -1,30 +1,5 @@
-drop dataverse tpch if exists;
-create dataverse tpch;
 use dataverse tpch;
 
-create type OrderType as closed {
-  o_orderkey: int32, 
-  o_custkey: int32, 
-  o_orderstatus: string, 
-  o_totalprice: double, 
-  o_orderdate: string, 
-  o_orderpriority: string,
-  o_clerk: string, 
-  o_shippriority: int32, 
-  o_comment: string
-}
-
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_Orders_Custkey on Orders(o_custkey);
-
-write output to nc1:"rttest/index-selection_orders-index-custkey.adm";
-
 for $o in dataset('Orders')
 where
   $o.o_custkey = 40
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql
index 9a1906c..265e110 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.1.ddl.aql
@@ -25,17 +25,6 @@
 create dataset LineItem(LineItemType)
   primary key l_orderkey, l_linenumber;
 
-load dataset LineItem 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
 create index idx_LineItem_partkey on LineItem(l_linenumber);
 create index idx_LineItem_suppkey on LineItem(l_suppkey);
 
-write output to nc1:"rttest/index-selection_range-search-open.adm";
-      
-for $c in dataset('LineItem')
-where $c.l_suppkey < 100 and $c.l_suppkey>5
-order by $c.l_orderkey, $c.l_linenumber
-return $c 
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.2.update.aql
index 9a1906c..7ab39fd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.2.update.aql
@@ -1,41 +1,6 @@
-drop dataverse test if exists;
-  
-create dataverse test;
 use dataverse test;
 
-create type LineItemType as open {
-  l_orderkey: int32, 
-  l_partkey: int32, 
-  l_suppkey: int32, 
-  l_linenumber: int32, 
-  l_quantity: double, 
-  l_extendedprice: double,
-  l_discount: double, 
-  l_tax: double,
-  l_returnflag: string, 
-  l_linestatus: string, 
-  l_shipdate: string,
-  l_commitdate: string, 
-  l_receiptdate: string, 
-  l_shipinstruct: string, 
-  l_shipmode: string, 
-  l_comment: string
-}
-
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
-write output to nc1:"rttest/index-selection_range-search-open.adm";
-      
-for $c in dataset('LineItem')
-where $c.l_suppkey < 100 and $c.l_suppkey>5
-order by $c.l_orderkey, $c.l_linenumber
-return $c 
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.query.aql
index 9a1906c..62c9e84 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open/range-search-open.3.query.aql
@@ -1,38 +1,4 @@
-drop dataverse test if exists;
-  
-create dataverse test;
 use dataverse test;
-
-create type LineItemType as open {
-  l_orderkey: int32, 
-  l_partkey: int32, 
-  l_suppkey: int32, 
-  l_linenumber: int32, 
-  l_quantity: double, 
-  l_extendedprice: double,
-  l_discount: double, 
-  l_tax: double,
-  l_returnflag: string, 
-  l_linestatus: string, 
-  l_shipdate: string,
-  l_commitdate: string, 
-  l_receiptdate: string, 
-  l_shipinstruct: string, 
-  l_shipmode: string, 
-  l_comment: string
-}
-
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-load dataset LineItem 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
-write output to nc1:"rttest/index-selection_range-search-open.adm";
       
 for $c in dataset('LineItem')
 where $c.l_suppkey < 100 and $c.l_suppkey>5
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql
index 758e110..89eeec3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.1.ddl.aql
@@ -25,17 +25,7 @@
 create dataset LineItem(LineItemType)
   primary key l_orderkey, l_linenumber;
 
-load dataset LineItem 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
 create index idx_LineItem_partkey on LineItem(l_linenumber);
 create index idx_LineItem_suppkey on LineItem(l_suppkey);
 
-write output to nc1:"rttest/index-selection_range-search.adm";
-
-for $c in dataset('LineItem')
-where $c.l_suppkey < 100 and $c.l_suppkey>5
-order by $c.l_orderkey, $c.l_linenumber
-return $c 
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.2.update.aql
index 758e110..7ab39fd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.2.update.aql
@@ -1,41 +1,6 @@
-drop dataverse test if exists;
-  
-create dataverse test;
 use dataverse test;
 
-create type LineItemType as closed {
-  l_orderkey: int32, 
-  l_partkey: int32, 
-  l_suppkey: int32, 
-  l_linenumber: int32, 
-  l_quantity: double, 
-  l_extendedprice: double,
-  l_discount: double, 
-  l_tax: double,
-  l_returnflag: string, 
-  l_linestatus: string, 
-  l_shipdate: string,
-  l_commitdate: string, 
-  l_receiptdate: string, 
-  l_shipinstruct: string, 
-  l_shipmode: string, 
-  l_comment: string
-}
-
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
-write output to nc1:"rttest/index-selection_range-search.adm";
-
-for $c in dataset('LineItem')
-where $c.l_suppkey < 100 and $c.l_suppkey>5
-order by $c.l_orderkey, $c.l_linenumber
-return $c 
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.query.aql
index 758e110..7d79f2b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search/range-search.3.query.aql
@@ -1,39 +1,5 @@
-drop dataverse test if exists;
-  
-create dataverse test;
 use dataverse test;
 
-create type LineItemType as closed {
-  l_orderkey: int32, 
-  l_partkey: int32, 
-  l_suppkey: int32, 
-  l_linenumber: int32, 
-  l_quantity: double, 
-  l_extendedprice: double,
-  l_discount: double, 
-  l_tax: double,
-  l_returnflag: string, 
-  l_linestatus: string, 
-  l_shipdate: string,
-  l_commitdate: string, 
-  l_receiptdate: string, 
-  l_shipinstruct: string, 
-  l_shipmode: string, 
-  l_comment: string
-}
-
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
-load dataset LineItem 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
-
-create index idx_LineItem_partkey on LineItem(l_linenumber);
-create index idx_LineItem_suppkey on LineItem(l_suppkey);
-
-write output to nc1:"rttest/index-selection_range-search.adm";
-
 for $c in dataset('LineItem')
 where $c.l_suppkey < 100 and $c.l_suppkey>5
 order by $c.l_orderkey, $c.l_linenumber
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql
index d920cfce..088317c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.1.ddl.aql
@@ -16,15 +16,5 @@
 create dataset MyData(MyRecord)
   primary key id;
 
-load dataset MyData 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm"));
-
 create index rtree_index_point on MyData(point) type rtree;
 
-write output to nc1:"rttest/index-selection_rtree-secondary-index-nullable.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.2.update.aql
index d920cfce..2ac581c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.2.update.aql
@@ -1,30 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type MyRecord as closed {
-  id: int32,
-  point: point?,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle
-}
-
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm"));
 
-create index rtree_index_point on MyData(point) type rtree;
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index-nullable.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.query.aql
index d920cfce..9d067bc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable/rtree-secondary-index-nullable.3.query.aql
@@ -1,29 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type MyRecord as closed {
-  id: int32,
-  point: point?,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle
-}
-
-create dataset MyData(MyRecord)
-  primary key id;
-
-load dataset MyData 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm"));
-
-create index rtree_index_point on MyData(point) type rtree;
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index-nullable.adm";
-
 for $o in dataset('MyData')
 where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
 order by $o.id
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql
index 0a49ac1..be8978c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.1.ddl.aql
@@ -16,16 +16,5 @@
 create dataset MyData(MyRecord)
   primary key id;
 
-load dataset MyData 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
-
 create index rtree_index_point on MyData(point) type rtree;
 
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index-open.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.2.update.aql
index 0a49ac1..d845d68 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.2.update.aql
@@ -1,31 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type MyRecord as open {
-  id: int32,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle
-}
-
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
 
-create index rtree_index_point on MyData(point) type rtree;
-
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index-open.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.query.aql
index 0a49ac1..9d067bc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open/rtree-secondary-index-open.3.query.aql
@@ -1,30 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type MyRecord as open {
-  id: int32,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle
-}
-
-create dataset MyData(MyRecord)
-  primary key id;
-
-load dataset MyData 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
-
-create index rtree_index_point on MyData(point) type rtree;
-
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index-open.adm";
-
 for $o in dataset('MyData')
 where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
 order by $o.id
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql
index 19df2db..41973e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.1.ddl.aql
@@ -17,15 +17,5 @@
 create dataset MyData(MyRecord)
   primary key id;
 
-load dataset MyData 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
-
 create index rtree_index_point on MyData(point) type rtree;
 
-write output to nc1:"rttest/index-selection_rtree-secondary-index.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.2.update.aql
index 19df2db..d845d68 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.2.update.aql
@@ -1,31 +1,6 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type MyRecord as closed {
-  id: int32,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle,
-  circle: circle
-}
-
-create dataset MyData(MyRecord)
-  primary key id;
-
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
 
-create index rtree_index_point on MyData(point) type rtree;
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index.adm";
-
-for $o in dataset('MyData')
-where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
-order by $o.id
-return {"id":$o.id}
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.query.aql
index 19df2db..9d067bc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index/rtree-secondary-index.3.query.aql
@@ -1,30 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type MyRecord as closed {
-  id: int32,
-  point: point,
-  kwds: string,
-  line1: line,
-  line2: line,
-  poly1: polygon,
-  poly2: polygon,
-  rec: rectangle,
-  circle: circle
-}
-
-create dataset MyData(MyRecord)
-  primary key id;
-
-load dataset MyData 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
-(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
-
-create index rtree_index_point on MyData(point) type rtree;
-
-write output to nc1:"rttest/index-selection_rtree-secondary-index.adm";
-
 for $o in dataset('MyData')
 where spatial-intersect($o.point, create-polygon(create-point(4.0,1.0), create-point(4.0,4.0), create-point(12.0,4.0), create-point(12.0,1.0)))
 order by $o.id
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 c6e29e6..a199655 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,21 +29,5 @@
 
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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);
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $ed := edit-distance($a.name, $b.name)
-where $ed <= 4 and $a.cid < $b.cid
-order by $ed, $a.cid, $b.cid
-return { "a": $a.name, "b": $b.name, "ed": $ed }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
index c6e29e6..3c90bca 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline/ngram-edit-distance-inline.2.update.aql
@@ -6,29 +6,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
@@ -37,13 +16,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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $ed := edit-distance($a.name, $b.name)
-where $ed <= 4 and $a.cid < $b.cid
-order by $ed, $a.cid, $b.cid
-return { "a": $a.name, "b": $b.name, "ed": $ed }
\ No newline at end of file
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.3.query.aql
index c6e29e6..5ea4feb 100644
--- 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.3.query.aql
@@ -6,44 +6,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 let $ed := edit-distance($a.name, $b.name)
 where $ed <= 4 and $a.cid < $b.cid
 order by $ed, $a.cid, $b.cid
-return { "a": $a.name, "b": $b.name, "ed": $ed }
\ No newline at end of file
+return { "a": $a.name, "b": $b.name, "ed": $ed }
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
index 46cd05c..c761611 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
@@ -28,20 +28,4 @@
 
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where edit-distance($a.name, $b.name) <= 4 and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "a": $a.name, "b": $b.name }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.2.update.aql
index 46cd05c..fd5c673 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.2.update.aql
@@ -5,29 +5,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
@@ -36,12 +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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where edit-distance($a.name, $b.name) <= 4 and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "a": $a.name, "b": $b.name }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.query.aql
index 46cd05c..19c780b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance/ngram-edit-distance.3.query.aql
@@ -9,39 +9,8 @@
 create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 where edit-distance($a.name, $b.name) <= 4 and $a.cid < $b.cid
 order by $a.cid, $b.cid
-return { "a": $a.name, "b": $b.name }
\ No newline at end of file
+return { "a": $a.name, "b": $b.name }
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 f2f330e..1989a63 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,21 +30,5 @@
 
 create dataset CSX(CSXType) primary key id;
 
-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;
-
-load dataset CSX
-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);
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
-where $jacc >= 0.5f and $a.id < $b.id
-order by $jacc, $a.id, $b.id
-return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql
index f2f330e..9388959 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.2.update.aql
@@ -6,30 +6,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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;
@@ -38,13 +16,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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
-where $jacc >= 0.5f and $a.id < $b.id
-order by $jacc, $a.id, $b.id
-return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
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.3.query.aql
index f2f330e..dcd5245 100644
--- 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.3.query.aql
@@ -6,45 +6,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
-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;
-
-load dataset CSX
-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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm";
-
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
 let $jacc := similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false))
 where $jacc >= 0.5f and $a.id < $b.id
 order by $jacc, $a.id, $b.id
-return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
+return { "a": $a.title, "b": $b.title, "jacc": $jacc }
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 1df7a5b..958185c 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,21 +29,5 @@
 
 create dataset CSX(CSXType) primary key id;
 
-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;
-
-load dataset CSX
-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);
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f 
-      and $a.id < $b.id
-order by $a.id, $b.id
-return { "a": $a.title, "b": $b.title }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.2.update.aql
index 1df7a5b..319c927 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.2.update.aql
@@ -5,30 +5,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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;
@@ -37,13 +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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f 
-      and $a.id < $b.id
-order by $a.id, $b.id
-return { "a": $a.title, "b": $b.title }
\ No newline at end of file
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.3.query.aql
index 1df7a5b..4364545 100644
--- 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.3.query.aql
@@ -5,45 +5,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
-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;
-
-load dataset CSX
-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);
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard.adm";
-
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
 where similarity-jaccard(gram-tokens($a.title, 3, false), gram-tokens($b.title, 3, false)) >= 0.5f 
       and $a.id < $b.id
 order by $a.id, $b.id
-return { "a": $a.title, "b": $b.title }
\ No newline at end of file
+return { "a": $a.title, "b": $b.title }
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 a72d292..ec9e8dd 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,21 +29,5 @@
 
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $ed := edit-distance($a.interests, $b.interests)
-where len($a.interests) > 2 and len($b.interests) > 2 and $ed <= 1 and $a.cid < $b.cid
-order by $ed, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "ed": $ed }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql
index a72d292..a288228 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.2.update.aql
@@ -6,29 +6,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
@@ -37,13 +16,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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $ed := edit-distance($a.interests, $b.interests)
-where len($a.interests) > 2 and len($b.interests) > 2 and $ed <= 1 and $a.cid < $b.cid
-order by $ed, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "ed": $ed }
\ No newline at end of file
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.3.query.aql
index a72d292..d904c09 100644
--- 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.3.query.aql
@@ -6,44 +6,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance-inline.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 let $ed := edit-distance($a.interests, $b.interests)
 where len($a.interests) > 2 and len($b.interests) > 2 and $ed <= 1 and $a.cid < $b.cid
 order by $ed, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "ed": $ed }
\ No newline at end of file
+return { "a": $a.interests, "b": $b.interests, "ed": $ed }
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 ea05e33..e5848d9 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,20 +28,5 @@
 
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where len($a.interests) > 2 and len($b.interests) > 2 and edit-distance($a.interests, $b.interests) <= 1 and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.2.update.aql
index ea05e33..b298b25 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.2.update.aql
@@ -5,29 +5,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
@@ -36,12 +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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where len($a.interests) > 2 and len($b.interests) > 2 and edit-distance($a.interests, $b.interests) <= 1 and $a.cid < $b.cid
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
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.3.query.aql
index ea05e33..b9221da 100644
--- 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.3.query.aql
@@ -5,43 +5,10 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as open {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as open {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-edit-distance.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 where len($a.interests) > 2 and len($b.interests) > 2 and edit-distance($a.interests, $b.interests) <= 1 and $a.cid < $b.cid
 order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
+return { "a": $a.interests, "b": $b.interests }
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 e8b4b05..532477f 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,21 +29,5 @@
   
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $jacc := /*+ indexnl */similarity-jaccard($a.interests, $b.interests)
-where $jacc >= 0.9f  and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $jacc, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.2.update.aql
index e8b4b05..3505c80 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.2.update.aql
@@ -6,29 +6,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
@@ -37,13 +16,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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $jacc := /*+ indexnl */similarity-jaccard($a.interests, $b.interests)
-where $jacc >= 0.9f  and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $jacc, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
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.3.query.aql
index e8b4b05..8dda04e 100644
--- 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.3.query.aql
@@ -6,44 +6,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard-inline.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 let $jacc := /*+ indexnl */similarity-jaccard($a.interests, $b.interests)
 where $jacc >= 0.9f  and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
 order by $jacc, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
+return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
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 d33fc87..44b619c 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,21 +28,5 @@
   
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f 
-      and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.2.update.aql
index d33fc87..0a87342 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.2.update.aql
@@ -5,29 +5,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
@@ -36,13 +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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f 
-      and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
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.3.query.aql
index d33fc87..0af3efe 100644
--- 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.3.query.aql
@@ -5,44 +5,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: [string],
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_olist-jaccard.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f 
       and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
 order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
+return { "a": $a.interests, "b": $b.interests }
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql
index c46d534..c8243dc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.1.ddl.aql
@@ -29,21 +29,3 @@
   
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
-where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $jacc, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
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 c46d534..575f77a 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
@@ -6,29 +6,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
@@ -39,11 +18,3 @@
 
 create index interests_index on Customers(interests) type keyword;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard-inline.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
-where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $jacc, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
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.3.query.aql
index c46d534..b7b056e 100644
--- 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.3.query.aql
@@ -6,44 +6,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard-inline.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 let $jacc := /*+ indexnl */ similarity-jaccard($a.interests, $b.interests)
 where $jacc >= 0.9f and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
 order by $jacc, $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
\ No newline at end of file
+return { "a": $a.interests, "b": $b.interests, "jacc": $jacc }
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 c7534f3..eafa308 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,21 +28,5 @@
   
 create dataset Customers2(CustomerType) primary key cid;
 
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f 
-      and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.2.update.aql
index c7534f3..f183f5e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.2.update.aql
@@ -5,29 +5,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
@@ -36,13 +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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard.adm";
-
-for $a in dataset('Customers')
-for $b in dataset('Customers2')
-where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f 
-      and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
-order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
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.3.query.aql
index c7534f3..57fd37c 100644
--- 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.3.query.aql
@@ -5,44 +5,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type AddressType as closed {
-  number: int32, 
-  street: string,
-  city: string
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ { name: string, age: int32? } ]
-}
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
-
-load dataset Customers2
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_ulist-jaccard.adm";
-
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
 where /*+ indexnl */ similarity-jaccard($a.interests, $b.interests) >= 0.9f 
       and $a.cid < $b.cid and len($a.interests) > 1 and len($b.interests) > 1
 order by $a.cid, $b.cid
-return { "a": $a.interests, "b": $b.interests }
\ No newline at end of file
+return { "a": $a.interests, "b": $b.interests }
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 ebec1d8..7635405 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,21 +30,5 @@
 
 create dataset CSX(CSXType) primary key id;
 
-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;
-
-load dataset CSX
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
-where $jacc >= 0.5f and $a.id < $b.id
-order by $jacc, $a.id, $b.id
-return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
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 ebec1d8..38d3d8f 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
@@ -6,29 +6,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
@@ -38,13 +17,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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
-where $jacc >= 0.5f and $a.id < $b.id
-order by $jacc, $a.id, $b.id
-return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
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.3.query.aql
index ebec1d8..6faa6a7 100644
--- 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.3.query.aql
@@ -6,45 +6,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
-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;
-
-load dataset CSX
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm";
-
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
 let $jacc := similarity-jaccard(word-tokens($a.title), word-tokens($b.title))
 where $jacc >= 0.5f and $a.id < $b.id
 order by $jacc, $a.id, $b.id
-return { "a": $a.title, "b": $b.title, "jacc": $jacc }
\ No newline at end of file
+return { "a": $a.title, "b": $b.title, "jacc": $jacc }
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 29e17bc..a8c105d 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,21 +29,5 @@
 
 create dataset CSX(CSXType) primary key id;
 
-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;
-
-load dataset CSX
-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;
 
-write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f 
-      and $a.id < $b.id
-order by $a.id, $b.id
-return { "a": $a.title, "b": $b.title }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.2.update.aql
index 29e17bc..a166535 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.2.update.aql
@@ -5,30 +5,8 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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;
@@ -37,13 +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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard.adm";
-
-for $a in dataset('DBLP')
-for $b in dataset('CSX')
-where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f 
-      and $a.id < $b.id
-order by $a.id, $b.id
-return { "a": $a.title, "b": $b.title }
\ No newline at end of file
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.3.query.aql
index 29e17bc..3db8b5f 100644
--- 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.3.query.aql
@@ -5,45 +5,11 @@
  * Success        : Yes
  */
 
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-create type DBLPType as closed {
-  id: int32, 
-  dblpid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create type CSXType as closed {
-  id: int32, 
-  csxid: string,
-  title: string,
-  authors: string,
-  misc: string
-}
-
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
-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;
-
-load dataset CSX
-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;
-
-write output to nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard.adm";
-
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
 where similarity-jaccard(word-tokens($a.title), word-tokens($b.title)) >= 0.5f 
       and $a.id < $b.id
 order by $a.id, $b.id
-return { "a": $a.title, "b": $b.title }
\ No newline at end of file
+return { "a": $a.title, "b": $b.title }
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 0f86c57..f68bc90 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
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -23,3 +25,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/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 0ee51c6..635a02e 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
@@ -8,10 +8,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 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.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance/ngram-edit-distance.1.ddl.aql
index 134fc27..0fe2b47 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
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -22,3 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/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 30b185e..e39bb31 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
@@ -6,10 +6,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 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-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 0266cb3..8b56f37 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
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -24,3 +26,7 @@
   misc: string
 }
 
+create dataset DBLP(DBLPType) primary key id;
+
+create dataset CSX(CSXType) primary key id;
+
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 3eaefa8..2cb5ea3 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
@@ -7,10 +7,6 @@
 
 use dataverse test;
 
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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/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 7e2cc88..5a1b6c7 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
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -23,3 +25,7 @@
   misc: string
 }
 
+create dataset DBLP(DBLPType) primary key id;
+
+create dataset CSX(CSXType) primary key id;
+
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 619c93c..e441143 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
@@ -6,10 +6,6 @@
 
 use dataverse test;
 
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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/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 d685247..0682edf 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
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -23,3 +25,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/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 270d49a..8e868df 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
@@ -7,10 +7,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 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/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 18d3edb..9bee585 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
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -22,3 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/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 d45e548..6f94bef 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
@@ -6,10 +6,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 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/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 717391c..c1703df 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
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as closed {
   number: int32, 
   street: string,
@@ -23,3 +25,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/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 a6ab8ab..c6bb575 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
@@ -7,10 +7,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 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/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 bdcf057..671b651 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
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as closed {
   number: int32, 
   street: string,
@@ -22,3 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/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 a75fa08..b9b8a43 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
@@ -6,10 +6,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 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/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 1e3d0cc..1b24b5b 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
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as closed {
   number: int32, 
   street: string,
@@ -23,3 +25,6 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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 9fa3ada..37fecd9 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
@@ -7,10 +7,6 @@
 
 use dataverse test;
 
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
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 3e33f51..9c8c3a2 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
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as closed {
   number: int32, 
   street: string,
@@ -22,3 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
+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/ulist-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard/ulist-jaccard.2.update.aql
index a248610..adaa5e8 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
@@ -6,11 +6,6 @@
 
 use dataverse test;
 
-
-create dataset Customers(CustomerType) primary key cid;
-  
-create dataset Customers2(CustomerType) primary key cid;
-
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
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 56ac381..561303f 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
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -24,3 +26,7 @@
   misc: string
 }
 
+create dataset DBLP(DBLPType) primary key id;
+
+create dataset CSX(CSXType) primary key id;
+
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 8512979..8062fe6 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
@@ -7,10 +7,6 @@
 
 use dataverse test;
 
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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/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 b8736a7..eee20ab 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
@@ -7,6 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -23,3 +25,7 @@
   misc: string
 }
 
+create dataset DBLP(DBLPType) primary key id;
+
+create dataset CSX(CSXType) primary key id;
+
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 3b7a84a..02bcaa22 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
@@ -6,10 +6,6 @@
 
 use dataverse test;
 
-create dataset DBLP(DBLPType) primary key id;
-
-create dataset CSX(CSXType) primary key id;
-
 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/misc/groupby-orderby-count/groupby-orderby-count.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/misc/groupby-orderby-count/groupby-orderby-count.1.ddl.aql
index 8aa3f3d..2b0ed38 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/groupby-orderby-count/groupby-orderby-count.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/groupby-orderby-count/groupby-orderby-count.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse twitter if exists;
 create dataverse twitter;
 
+use dataverse twitter;
+
 create type Tweet as open {
   id: int32,
   tweetid: int64,
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.1.ddl.aql
index 910e206..67ad586 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type UserType as open {
   uid: int32, 
   name: string,
@@ -15,3 +17,7 @@
   interests: {{string}}
 }
 
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.2.update.aql
index 52b94db..caa966a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01/nested-loop-join_01.2.update.aql
@@ -1,9 +1,5 @@
 use dataverse test;
 
-create dataset Users(UserType) primary key uid;
-create dataset Visitors(VisitorType) primary key vid;
-
-
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/users-visitors-small/users.json"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.1.ddl.aql
index 2c00de4..da25235 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.1.ddl.aql
@@ -7,7 +7,11 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open{
 name1:string
 }
 
+create dataset testds(TestType) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.2.update.aql
index ac167e6..253fd75 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/partition-by-nonexistent-field/partition-by-nonexistent-field.2.update.aql
@@ -6,7 +6,5 @@
  
 use dataverse test;
 
-create dataset testds(TestType) primary key id;
-
 insert into dataset testds({"name1":"John","name2":"Smith"});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.1.ddl.aql
index 3c567c4..1b75b6c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
@@ -27,3 +29,8 @@
   total: float
 }
 
+create dataset CustomerSomeSat02(CustomerType)
+  primary key cid;
+create dataset OrdersSomeSat02(OrderType)
+  primary key oid;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.2.update.aql
index 3a72ee9..6728649 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02/somesat_02.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create dataset CustomerSomeSat02(CustomerType)
-  primary key cid;
-create dataset OrdersSomeSat02(OrderType)
-  primary key oid;
-
 load dataset CustomerSomeSat02 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
 (("path"="nc1://data/custord-tiny/customer-tiny.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/10/10.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/10/10.1.ddl.aql
index de4ec24..aad13a5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/10/10.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/10/10.1.ddl.aql
@@ -2,6 +2,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as open {
   id: int32, 
   dblpid: string,
@@ -10,3 +12,6 @@
   misc: string
 }
 
+create dataset DBLP1(DBLPType) 
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/10/10.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/10/10.2.update.aql
index bdbc5c2..987a489 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/10/10.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/10/10.2.update.aql
@@ -1,9 +1,6 @@
 /* scan and print a delimited text file */
 use dataverse test;
 
-create dataset DBLP1(DBLPType) 
-  primary key id;
-
 // drop dataset DBLP1;
 load dataset DBLP1
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/20/20.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/20/20.1.ddl.aql
index 3cbc097..0e65639 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/20/20.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/20/20.1.ddl.aql
@@ -3,6 +3,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -11,3 +13,6 @@
   misc: string
 }
 
+create dataset DBLPadm(DBLPType) 
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/20/20.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/20/20.2.update.aql
index 9212fc7..d8c9945 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/20/20.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/20/20.2.update.aql
@@ -2,9 +2,6 @@
 
 use dataverse test;
 
-create dataset DBLPadm(DBLPType) 
-  primary key id;
-
 // drop dataset DBLPadm;
 load dataset DBLPadm 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/30/30.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/30/30.1.ddl.aql
index 3536fbc..d3e3cdc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/30/30.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/30/30.1.ddl.aql
@@ -2,6 +2,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
index 541c198..de9d1a4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
index a9123ca..c582792 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
@@ -8,6 +8,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type AddressType as open {
   number: int32, 
   street: string,
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.1.ddl.aql
index bcc8bfd..f4f165c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.1.ddl.aql
@@ -6,9 +6,14 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type Employee as closed {
 id: int32,
 name: string,
 salary: int32
 }
 
+create dataset Office(Employee)
+primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.2.update.aql
index fdb9180..a6cf403 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/invalid-scan-syntax/invalid-scan-syntax.2.update.aql
@@ -5,8 +5,5 @@
  */
 use dataverse test;
 
-create dataset Office(Employee)
-primary key id;
-
 insert into dataset Office({"id": 1, "name": "clerk#1", "salary":120000});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.1.ddl.aql
index 1cf21cd..7ebf213 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.1.ddl.aql
@@ -11,6 +11,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -19,3 +21,6 @@
   misc: string
 }
 
+create dataset DBLPadm(DBLPType) 
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.2.update.aql
index efa406e..1524cac 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1/issue238_query_1.2.update.aql
@@ -10,9 +10,6 @@
 
 use dataverse test;
 
-create dataset DBLPadm(DBLPType) 
-  primary key id;
-
 // drop dataset DBLPadm;
 load dataset DBLPadm 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.1.ddl.aql
index 2e303f2..ef20dab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.1.ddl.aql
@@ -11,6 +11,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -19,3 +21,6 @@
   misc: string
 }
 
+create dataset DBLPadm(DBLPType) 
+  primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.2.update.aql
index d5bc504..b154222 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2/issue238_query_2.2.update.aql
@@ -10,9 +10,6 @@
 
 use dataverse test;
 
-create dataset DBLPadm(DBLPType) 
-  primary key id;
-
 // drop dataset DBLPadm;
 load dataset DBLPadm 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/numeric_types_01/numeric_types_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/numeric_types_01/numeric_types_01.1.ddl.aql
index 39b856f..fdfb40a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/numeric_types_01/numeric_types_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/numeric_types_01/numeric_types_01.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type NumericType as open {
   id: int32,
   int8Field: int8?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_01/spatial_types_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_01/spatial_types_01.1.ddl.aql
index 4036289..de16361 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_01/spatial_types_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_01/spatial_types_01.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type SpatialType as open {
   id: int32,
   point: point,
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.1.ddl.aql
index 4036289..cf87ca5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type SpatialType as open {
   id: int32,
   point: point,
@@ -10,3 +12,6 @@
   circle: circle
 }
 
+create dataset Spatial2(SpatialType) 
+	primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.2.update.aql
index cef77e0..d631c4d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02/spatial_types_02.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset Spatial2(SpatialType) 
-	primary key id;
-
 load dataset Spatial2 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/nontagged/spatialData.txt"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_01/temp_types_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_01/temp_types_01.1.ddl.aql
index a3bb09e..d22d699 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_01/temp_types_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_01/temp_types_01.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TempType as open {
   id: int32,
   date: date,
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.1.ddl.aql
index c688e81..6c9ef0c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TempType as closed {
   id: int32,
   date: date,
@@ -9,3 +11,6 @@
   duration: duration
 }
 
+create dataset Temp2(TempType) 
+	primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.2.update.aql
index 74eac6b..f042767 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02/temp_types_02.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse test;
 
-create dataset Temp2(TempType) 
-	primary key id;
-
 load dataset Temp2 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/nontagged/tempData.txt"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.1.ddl.aql
index e9994a3..cad2811 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -9,3 +11,8 @@
   misc: string
 }
 
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLP(DBLPType) 
+  primary key id on group1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.2.update.aql
index ddbab4f..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance/fuzzyeq-edit-distance.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.1.ddl.aql
index e9994a3..cad2811 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -9,3 +11,8 @@
   misc: string
 }
 
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLP(DBLPType) 
+  primary key id on group1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.2.update.aql
index ddbab4f..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard/fuzzyeq-similarity-jaccard.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.1.ddl.aql
index e9994a3..cad2811 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -9,3 +11,8 @@
   misc: string
 }
 
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLP(DBLPType) 
+  primary key id on group1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.2.update.aql
index ddbab4f..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query/similarity-jaccard-check_query.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.1.ddl.aql
index e0514a6..2598fe4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.1.ddl.aql
@@ -8,3 +8,8 @@
   misc: string
 }
 
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLP(DBLPType) 
+  primary key id on group1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.2.update.aql
index ddbab4f..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.1.ddl.aql
index e9994a3..cad2811 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -9,3 +11,8 @@
   misc: string
 }
 
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLP(DBLPType) 
+  primary key id on group1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.2.update.aql
index ddbab4f..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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/similarity/similarity-jaccard_query/similarity-jaccard_query.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.1.ddl.aql
index e9994a3..cad2811 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type DBLPType as closed {
   id: int32, 
   dblpid: string,
@@ -9,3 +11,8 @@
   misc: string
 }
 
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset DBLP(DBLPType) 
+  primary key id on group1;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.2.update.aql
index ddbab4f..29632d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.2.update.aql
@@ -1,10 +1,5 @@
 use dataverse test;
 
-create nodegroup group1 if not exists on nc1, nc2;
-
-create dataset DBLP(DBLPType) 
-  primary key id on group1;
-
 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/string/cpttostr01/cpttostr01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.1.ddl.aql
index 3e2aca4..e9cf00a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.1.ddl.aql
@@ -10,8 +10,11 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open{
 id:int32,
 cpt:[int32]
 }
 
+create dataset testds(TestType) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.2.update.aql
index 41ea7fd..7c83cdf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01/cpttostr01.2.update.aql
@@ -9,8 +9,6 @@
 
 use dataverse test;
 
-create dataset testds(TestType) primary key id;
-
 // insert codepoint data into internal dataset testds here into the cpt attribute
 
 insert into dataset testds({"id":123,"cpt":[0048,0045,0057,0044,0065,0045,0090]});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04/cpttostr04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04/cpttostr04.1.ddl.aql
index 1f298f8..4ce693a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04/cpttostr04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr04/cpttostr04.1.ddl.aql
@@ -7,5 +7,3 @@
 
 //Input = Output
 
-let $c1 := codepoint-to-string(string-to-codepoint("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))
-return { "c1":$c1 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.1.ddl.aql
index 60a052c..6f6e9f0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.1.ddl.aql
@@ -10,7 +10,10 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as {
 name:string
 }
 
+create dataset testds(TestType) primary key name;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.2.update.aql
index 6a3cbae..9a9752d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/endwith03/endwith03.2.update.aql
@@ -9,8 +9,6 @@
 
 use dataverse test;
 
-create dataset testds(TestType) primary key name;
-
 insert into dataset testds({"name":"Jim Jones"});
 insert into dataset testds({"name":"Ravi Kumar"});
 insert into dataset testds({"name":"Bruce Li"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.1.ddl.aql
index 77d8337..6665f77 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.1.ddl.aql
@@ -9,9 +9,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType1 as{
 fname:string,
 lname:string,
 id:int32
 }
 
+create dataset testds1(TestType1) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.2.update.aql
index 3928b86..b56e33e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches05/matches05.2.update.aql
@@ -8,8 +8,6 @@
 
 use dataverse test;
 
-create dataset testds1(TestType1) primary key id;
-
 insert into dataset testds1({"fname":"Test","lname":"Test","id":123});
 insert into dataset testds1({"fname":"Testa","lname":"Test","id":124});
 insert into dataset testds1({"fname":"Test1","lname":"Test1","id":125});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches06/matches06.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches06/matches06.1.ddl.aql
index 70180c0..b7af427 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/matches06/matches06.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches06/matches06.1.ddl.aql
@@ -4,20 +4,3 @@
  * Date         : May 21 2012
  */
 
-for $a in [matches("mnop","."),
-matches("abcdefABCDEF","/d"),
-matches("12345","\d"),
-matches("abcdefGHIJK","\D"),
-matches("       ","\s"),
-matches("       ","\S"),
-matches("Welcome to pattern matching!","[a-zA-Z_0-9]"),
-matches("!@#$%^&*()","[a-zA-Z_0-9]"),
-matches("!@#$%^&*()","[^\W]"),
-matches("!@#$%^&*","[^\w]"),
-matches("0xffff","[\p{XDigit}]"),
-matches("FFFFFFFF","[\p{XDigit}]"),
-matches("abcdefgh","[\p{javaLowerCase}]"),
-matches("ABCDEF","[\p{javaLowerCase}]"),
-matches(codepoint-to-string([0163]),"[\p{Sc}]")]
-return $a
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.1.ddl.aql
index f6c94d8..3b855ec 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.1.ddl.aql
@@ -10,7 +10,11 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as {
 name:string
 }
 
+create dataset testds(TestType) primary key name;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.2.update.aql
index cfd5940..451a6ab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/startwith03/startwith03.2.update.aql
@@ -9,8 +9,6 @@
 
 use dataverse test;
 
-create dataset testds(TestType) primary key name;
-
 insert into dataset testds({"name":"John Smith"});
 insert into dataset testds({"name":"John Doe"});
 insert into dataset testds({"name":"John Wayne"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.1.ddl.aql
index d223292..706597f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.1.ddl.aql
@@ -10,9 +10,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open{
 id:int32,
 fname:string,
 lname:string
 }
 
+create dataset testds(TestType) primary key id;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.2.update.aql
index 973dd83..bb5329c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01/strconcat01.2.update.aql
@@ -9,8 +9,6 @@
 
 use dataverse test;
 
-create dataset testds(TestType) primary key id;
-
 // insert string data into internal dataset testds into the name attribute
 
 insert into dataset testds({"id":123,"fname":"John","lname":"Smith"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.1.ddl.aql
index 856058f..9f8d0e8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.1.ddl.aql
@@ -14,3 +14,4 @@
 name:string
 }
 
+create dataset testds(TestType) primary key name;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.2.update.aql
index 89ec7d7..05bd430 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strlen03/strlen03.2.update.aql
@@ -9,8 +9,6 @@
 
 use dataverse test;
 
-create dataset testds(TestType) primary key name;
-
 insert into dataset testds({"name":"Maradona"});
 insert into dataset testds({"name":"Pele"});
 insert into dataset testds({"name":"Roberto Baggio"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.1.ddl.aql
index 1967c1f..cd3bee1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.1.ddl.aql
@@ -10,7 +10,10 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 name : string
 }
 
+create dataset testdst(TestType) primary key name;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.2.update.aql
index 4dcafbd..da796c7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr05/substr05.2.update.aql
@@ -9,8 +9,6 @@
 
 use dataverse test;
 
-create dataset testdst(TestType) primary key name;
-
 insert into dataset testdst({"name":"UC Berkeley"});
 insert into dataset testdst({"name":"UC Irvine"});
 insert into dataset testdst({"name":"UC LA"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.1.ddl.aql
index 1c12e15..404e531 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.1.ddl.aql
@@ -9,7 +9,10 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as open {
 name : string
 }
 
+create dataset testdst(TestType) primary key name;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.2.update.aql
index b3b6803..150cd94 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr06/substr06.2.update.aql
@@ -8,8 +8,6 @@
 
 use dataverse test;
 
-create dataset testdst(TestType) primary key name;
-
 insert into dataset testdst({"name":"UC Berkeley"});
 insert into dataset testdst({"name":"UC Irvine"});
 insert into dataset testdst({"name":"UC LA"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.1.ddl.aql
index c8394b4..8791da7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.1.ddl.aql
@@ -12,7 +12,10 @@
 drop dataverse test if exists;
 create dataverse test;
 
+use dataverse test;
+
 create type TestType as {
 name:string
 }
 
+create dataset testds(TestType) primary key name;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.2.update.aql
index 47574ab..dbb0e70 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03/toLowerCase03.2.update.aql
@@ -11,8 +11,6 @@
 
 use dataverse test;
 
-create dataset testds(TestType) primary key name;
-
 insert into dataset testds({"name":"Maradona"});
 insert into dataset testds({"name":"Pele"});
 insert into dataset testds({"name":"Roberto Baggio"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.1.ddl.aql
index a6083b1..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.1.ddl.aql
@@ -2,11 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_01.adm";
-
-for $l in subset-collection([1], 0, 1)
-return $l
-/*
-output: 
-1
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.2.update.aql
index a6083b1..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.2.update.aql
@@ -1,12 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_01.adm";
-
-for $l in subset-collection([1], 0, 1)
-return $l
-/*
-output: 
-1
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql
index a6083b1..05612a3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_01.adm";
-
 for $l in subset-collection([1], 0, 1)
 return $l
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.1.ddl.aql
index 8069ee5..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.1.ddl.aql
@@ -2,12 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_02.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 1, 2)
-return $l
-/*
-output: 
-2
-3
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.2.update.aql
index 8069ee5..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.2.update.aql
@@ -1,13 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_02.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 1, 2)
-return $l
-/*
-output: 
-2
-3
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql
index 8069ee5..14b3e4e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_02.adm";
-
 for $l in subset-collection([1, 2, 3, 4], 1, 2)
 return $l
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.1.ddl.aql
index 17b54d0..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.1.ddl.aql
@@ -2,11 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_03.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 0, 0)
-return $l
-/*
-output: 
-EMPTY
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.2.update.aql
index 17b54d0..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.2.update.aql
@@ -1,12 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_03.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 0, 0)
-return $l
-/*
-output: 
-EMPTY
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql
index 17b54d0..248bff3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_03.adm";
-
 for $l in subset-collection([1, 2, 3, 4], 0, 0)
 return $l
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.1.ddl.aql
index 97babb9..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.1.ddl.aql
@@ -2,11 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_04.adm";
-
-for $l in [1]
-return subset-collection([1, 2, 3, 4], 1, 2)
-/*
-edu.uci.ics.asterix.common.exceptions.AsterixException: Trying to create an aggregate from a scalar function descriptor. (fid=subset-collection@3)
-        at edu.uci.ics.asterix.algebra.expressions.FunctionCallExpression.createEvaluatorFactory(FunctionCallExpression.java:85)
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.2.update.aql
index 97babb9..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.2.update.aql
@@ -1,12 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_04.adm";
-
-for $l in [1]
-return subset-collection([1, 2, 3, 4], 1, 2)
-/*
-edu.uci.ics.asterix.common.exceptions.AsterixException: Trying to create an aggregate from a scalar function descriptor. (fid=subset-collection@3)
-        at edu.uci.ics.asterix.algebra.expressions.FunctionCallExpression.createEvaluatorFactory(FunctionCallExpression.java:85)
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql
index 97babb9..0fde28a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_04.adm";
-
 for $l in [1]
 return subset-collection([1, 2, 3, 4], 1, 2)
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.1.ddl.aql
index 8be1211..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.1.ddl.aql
@@ -2,12 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_05.adm";
-
-for $l in subset-collection(['a', 'b', 'c', 'd'], 1, 2)
-return $l
-/*
-output:
-"b"
-"c"
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.2.update.aql
index 8be1211..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.2.update.aql
@@ -1,13 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_05.adm";
-
-for $l in subset-collection(['a', 'b', 'c', 'd'], 1, 2)
-return $l
-/*
-output:
-"b"
-"c"
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql
index 8be1211..2403754 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_05.adm";
-
 for $l in subset-collection(['a', 'b', 'c', 'd'], 1, 2)
 return $l
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.1.ddl.aql
index 1569d5a..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.1.ddl.aql
@@ -2,12 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_06.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 2, 2)
-return $l
-/*
-output:
-3
-4
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.2.update.aql
index 1569d5a..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.2.update.aql
@@ -1,13 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_06.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 2, 2)
-return $l
-/*
-output:
-3
-4
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql
index 1569d5a..c8e78af 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_06.adm";
-
 for $l in subset-collection([1, 2, 3, 4], 2, 2)
 return $l
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.1.ddl.aql
index 49a9d6a..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.1.ddl.aql
@@ -2,12 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_07.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 2, 10)
-return $l
-/*
-output:
-3
-4
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.2.update.aql
index 49a9d6a..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.2.update.aql
@@ -1,13 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/subset-collection_07.adm";
-
-for $l in subset-collection([1, 2, 3, 4], 2, 10)
-return $l
-/*
-output:
-3
-4
-*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql
index 49a9d6a..5166adf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/subset-collection_07.adm";
-
 for $l in subset-collection([1, 2, 3, 4], 2, 10)
 return $l
 /*
diff --git a/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_delimited_ds/insert_from_delimited_ds.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_delimited_ds/insert_from_delimited_ds.1.ddl.aql
index c82a867..2e83832 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_delimited_ds/insert_from_delimited_ds.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_delimited_ds/insert_from_delimited_ds.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse testdvt if exists;
 create dataverse testdvt;
 
+use dataverse test;
+
 create type testtype as closed {
   id: string,
   dateField: date,
diff --git a/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_ext_ds/insert_from_ext_ds.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_ext_ds/insert_from_ext_ds.1.ddl.aql
index f2295b0..c5befee 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_ext_ds/insert_from_ext_ds.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temp/insert_from_ext_ds/insert_from_ext_ds.1.ddl.aql
@@ -7,6 +7,8 @@
 drop dataverse testdvt if exists;
 create dataverse testdvt;
 
+use dataverse testdvt;
+
 create type testtype as open {
   id: string,
   dateField: date?,
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.1.ddl.aql
index d360853..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_counthashed-gram-tokens_01.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := counthashed-gram-tokens($txt, 3, false)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.2.update.aql
index d360853..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_counthashed-gram-tokens_01.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := counthashed-gram-tokens($txt, 3, false)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql
index d360853..7b2148c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_counthashed-gram-tokens_01.adm";
-
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := counthashed-gram-tokens($txt, 3, false)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.1.ddl.aql
index cb5240d..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_counthashed-gram-tokens_02.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := counthashed-gram-tokens($txt, 3, true)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.2.update.aql
index cb5240d..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_counthashed-gram-tokens_02.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := counthashed-gram-tokens($txt, 3, true)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql
index cb5240d..f871047 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_counthashed-gram-tokens_02.adm";
-
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := counthashed-gram-tokens($txt, 3, true)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.1.ddl.aql
index 99c7b1d..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_counthashed-word-tokens_01.adm";
-
-let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
-let $tokens := counthashed-word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.2.update.aql
index 99c7b1d..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_counthashed-word-tokens_01.adm";
-
-let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
-let $tokens := counthashed-word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql
index 99c7b1d..3d44cfb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_counthashed-word-tokens_01.adm";
-
 let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
 let $tokens := counthashed-word-tokens($txt)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.1.ddl.aql
index 6be0066..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_gram-tokens_01.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := gram-tokens($txt, 3, false)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.2.update.aql
index 6be0066..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_gram-tokens_01.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := gram-tokens($txt, 3, false)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql
index 6be0066..ae3a339 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_gram-tokens_01.adm";
-
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := gram-tokens($txt, 3, false)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.1.ddl.aql
index adc34a6..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_gram-tokens_02.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := gram-tokens($txt, 3, true)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.2.update.aql
index adc34a6..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_gram-tokens_02.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := gram-tokens($txt, 3, true)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql
index adc34a6..1fa90ca 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_gram-tokens_02.adm";
-
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := gram-tokens($txt, 3, true)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.1.ddl.aql
index 73a1a77..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_hashed-gram-tokens_01.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := hashed-gram-tokens($txt, 3, false)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.2.update.aql
index 73a1a77..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_hashed-gram-tokens_01.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := hashed-gram-tokens($txt, 3, false)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql
index 73a1a77..694ef83 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_hashed-gram-tokens_01.adm";
-
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := hashed-gram-tokens($txt, 3, false)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.1.ddl.aql
index 854398f..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_hashed-gram-tokens_02.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := hashed-gram-tokens($txt, 3, true)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.2.update.aql
index 854398f..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_hashed-gram-tokens_02.adm";
-
-let $txt := "Jürgen S. Generic's Car"
-let $tokens := hashed-gram-tokens($txt, 3, true)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql
index 854398f..8e46d4a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_hashed-gram-tokens_02.adm";
-
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := hashed-gram-tokens($txt, 3, true)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.1.ddl.aql
index c4d2490..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_hashed-word-tokens_01.adm";
-
-let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
-let $tokens := hashed-word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.2.update.aql
index c4d2490..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_hashed-word-tokens_01.adm";
-
-let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
-let $tokens := hashed-word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql
index c4d2490..62d8387 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_hashed-word-tokens_01.adm";
-
 let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
 let $tokens := hashed-word-tokens($txt)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.1.ddl.aql
index c6bb819..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_word-tokens_01.adm";
-
-let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
-let $tokens := word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.2.update.aql
index c6bb819..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_word-tokens_01.adm";
-
-let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
-let $tokens := word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.3.query.aql
index c6bb819..dc9fa07 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_01/word-tokens_01.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_word-tokens_01.adm";
-
 let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
 let $tokens := word-tokens($txt)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.1.ddl.aql
index 75b816c..a5de0dd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.1.ddl.aql
@@ -2,9 +2,3 @@
 create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_word-tokens_02.adm";
-
-let $txt := "ΩΣ"
-let $tokens := word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.2.update.aql
index 75b816c..e69de29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.2.update.aql
@@ -1,10 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-write output to nc1:"rttest/tokenizers_word-tokens_02.adm";
-
-let $txt := "ΩΣ"
-let $tokens := word-tokens($txt)
-for $token in $tokens
-return $token
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.3.query.aql
index 75b816c..3e577b2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/word-tokens_02/word-tokens_02.3.query.aql
@@ -1,9 +1,5 @@
-drop dataverse test if exists;
-create dataverse test;
 use dataverse test;
 
-write output to nc1:"rttest/tokenizers_word-tokens_02.adm";
-
 let $txt := "ΩΣ"
 let $tokens := word-tokens($txt)
 for $token in $tokens
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.1.ddl.aql
index 2d4c583..acd6728 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -20,3 +22,6 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.2.update.aql
index cf309aa..f781e6e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by/distinct_by.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.1.ddl.aql
index d1d8fad..f415b38 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.1.ddl.aql
@@ -1,9 +1,14 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type RegionType as closed {
   r_regionkey: int32,
   r_name: string,
   r_comment: string
 }
 
+create dataset Regions_group_no_agg(RegionType) 
+  primary key r_regionkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.2.update.aql
index 6d39c81..3f37bfa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg/group_no_agg.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse tpch;
 
-create dataset Regions_group_no_agg(RegionType) 
-  primary key r_regionkey;
-
 load dataset Regions_group_no_agg 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/region.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item/q10_returned_item.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.1.ddl.aql
index 0189020..4b4967f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int64, 
   l_partkey: int64, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64/q10_returned_item_int64.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock/q11_important_stock.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock/q11_important_stock.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock/q11_important_stock.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock/q11_important_stock.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping/q12_shipping.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution/q13_customer_distribution.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect/q14_promotion_effect.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier/q15_top_supplier.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship/q16_parts_supplier_relationship.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue/q17_small_quantity_order_revenue.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer/q18_large_volume_customer.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.1.ddl.aql
index 2d4c583..acd6728 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -20,3 +22,6 @@
   l_comment: string
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.2.update.aql
index cf309aa..f781e6e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.2.update.aql
@@ -1,8 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion/q20_potential_part_promotion.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting/q21_suppliers_who_kept_orders_waiting.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity/q22_global_sales_opportunity.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier/q2_minimum_cost_supplier.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.2.update.aql
index 9ab931f..a860934 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt/q3_shipping_priority_nt.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority/q4_order_priority.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.1.ddl.aql
index 6a49c45..ee0ed24 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.1.ddl.aql
@@ -1,5 +1,7 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
+
+use dataverse tpch;
   
 create type LineItemType as closed {
   l_orderkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume/q5_local_supplier_volume.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aql
index 5231e76..99ffc17 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aqlq6_forecast_revenue_change.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aqlq6_forecast_revenue_change.1.ddl.aql
new file mode 100644
index 0000000..733d940
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.1.ddl.aqlq6_forecast_revenue_change.1.ddl.aql
@@ -0,0 +1,107 @@
+drop dataverse tpch if exists;
+create dataverse tpch;
+  
+use dataverse tpch;
+
+create type LineItemType as closed {
+  l_orderkey: int32, 
+  l_partkey: int32, 
+  l_suppkey: int32, 
+  l_linenumber: int32, 
+  l_quantity: int32, 
+  l_extendedprice: double,
+  l_discount: double, 
+  l_tax: double,
+  l_returnflag: string, 
+  l_linestatus: string, 
+  l_shipdate: string,
+  l_commitdate: string, 
+  l_receiptdate: string, 
+  l_shipinstruct: string, 
+  l_shipmode: string, 
+  l_comment: string
+}
+
+create type OrderType as closed {
+  o_orderkey: int32, 
+  o_custkey: int32, 
+  o_orderstatus: string, 
+  o_totalprice: double, 
+  o_orderdate: string, 
+  o_orderpriority: string,
+  o_clerk: string, 
+  o_shippriority: int32, 
+  o_comment: string
+}
+
+create type CustomerType as closed {
+  c_custkey: int32, 
+  c_name: string, 
+  c_address: string, 
+  c_nationkey: int32, 
+  c_phone: string, 
+  c_acctbal: double, 
+  c_mktsegment: string,
+  c_comment: string
+}
+
+create type SupplierType as closed {
+  s_suppkey: int32, 
+  s_name: string,
+  s_address: string,
+  s_nationkey: int32,
+  s_phone: string,
+  s_acctbal: double,
+  s_comment: string
+}
+
+create type NationType as closed {
+  n_nationkey: int32,
+  n_name: string,
+  n_regionkey: int32,
+  n_comment: string
+}
+
+create type RegionType as closed {
+	r_regionkey: int32, 
+	r_name: string, 
+	r_comment: string
+} 
+
+create type PartType as closed {
+  p_partkey: int32, 
+  p_name: string, 
+  p_mfgr: string,
+  p_brand: string,
+  p_type: string,
+  p_size: int32,
+  p_container: string,
+  p_retailprice: double,
+  p_comment: string
+}
+
+create type PartSuppType as closed {
+  ps_partkey: int32, 
+  ps_suppkey: int32,
+  ps_availqty: int32,
+  ps_supplycost: double,
+  ps_comment: string 
+}
+
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.2.update.aql
index 2d70882..0adc8e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change/q6_forecast_revenue_change.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping/q7_volume_shipping.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping/q7_volume_shipping.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping/q7_volume_shipping.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping/q7_volume_shipping.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.1.ddl.aql
index 5231e76..8af3065 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset Partsupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.2.update.aql
index 519fb97..b23ff7f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share/q8_national_market_share.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset Partsupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.1.ddl.aql
index 5231e76..c7fbbc6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.1.ddl.aql
@@ -1,6 +1,8 @@
 drop dataverse tpch if exists;
 create dataverse tpch;
 
+use dataverse tpch;
+
 create type LineItemType as closed {
   l_orderkey: int32, 
   l_partkey: int32, 
@@ -86,3 +88,20 @@
   ps_comment: string 
 }
 
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+create dataset Orders(OrderType)
+  primary key o_orderkey;
+create dataset Supplier(SupplierType)
+  primary key s_suppkey;
+create dataset Region(RegionType) 
+  primary key r_regionkey;
+create dataset Nation(NationType) 
+  primary key n_nationkey;
+create dataset Part(PartType)
+  primary key p_partkey;
+create dataset PartSupp(PartSuppType)
+  primary key ps_partkey, ps_suppkey;  
+create dataset Customer(CustomerType) 
+  primary key c_custkey;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.2.update.aql
index 9cf84c3..c68e0af 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt/q9_product_type_profit_nt.2.update.aql
@@ -1,22 +1,5 @@
 use dataverse tpch;
 
-create dataset LineItem(LineItemType)
-  primary key l_orderkey, l_linenumber;
-create dataset Orders(OrderType)
-  primary key o_orderkey;
-create dataset Supplier(SupplierType)
-  primary key s_suppkey;
-create dataset Region(RegionType) 
-  primary key r_regionkey;
-create dataset Nation(NationType) 
-  primary key n_nationkey;
-create dataset Part(PartType)
-  primary key p_partkey;
-create dataset PartSupp(PartSuppType)
-  primary key ps_partkey, ps_suppkey;  
-create dataset Customer(CustomerType) 
-  primary key c_custkey;
-
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.1.ddl.aql
index 7f87de7..e49225c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.1.ddl.aql
@@ -8,7 +8,5 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_f01.adm";
+use dataverse test;
 
-let $c1 := int8()
-return $c1
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.2.update.aql
index 7f87de7..3a64f98 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.2.update.aql
@@ -4,11 +4,3 @@
  * Date         : Nov 13th 2012
  */
 
-
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_f01.adm";
-
-let $c1 := int8()
-return $c1
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.3.query.aql
index 7f87de7..dbc01cc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/f01/f01.3.query.aql
@@ -5,10 +5,7 @@
  */
 
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_f01.adm";
+use dataverse test;
 
 let $c1 := int8()
 return $c1
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.1.ddl.aql
index 35718b1..1a4483e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.1.ddl.aql
@@ -8,11 +8,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf01.adm";
+use dataverse test;
 
 create function test.echo($list){
 $list
 }
 
-for $a in [1,2,3,4,5,6,7,8,9,10]
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.2.update.aql
index 35718b1..f3255c8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.2.update.aql
@@ -5,14 +5,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf01.adm";
-
-create function test.echo($list){
-$list
-}
-
-for $a in [1,2,3,4,5,6,7,8,9,10]
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.3.query.aql
index 35718b1..3191683 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf01/udf01.3.query.aql
@@ -5,14 +5,7 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf01.adm";
-
-create function test.echo($list){
-$list
-}
+use dataverse test;
 
 for $a in [1,2,3,4,5,6,7,8,9,10]
 return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.1.ddl.aql
index 2605f7a..e149c07 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.1.ddl.aql
@@ -7,11 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf02.adm";
+use dataverse test;
 
 create function test.getFirst($list){
 $list[0]
 }
-
-for $a in [[1,2],[3,4]]
-return test.getFirst($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.2.update.aql
index 2605f7a..652d06a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf02.adm";
-
-create function test.getFirst($list){
-$list[0]
-}
-
-for $a in [[1,2],[3,4]]
-return test.getFirst($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.3.query.aql
index 2605f7a..3e550c8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf02/udf02.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf02.adm";
-
-create function test.getFirst($list){
-$list[0]
-}
+use dataverse test;
 
 for $a in [[1,2],[3,4]]
 return test.getFirst($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.1.ddl.aql
index 747f29d..2bcbfab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.1.ddl.aql
@@ -10,11 +10,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf03.adm";
+use dataverse test;
 
 create function test.echo($list){
 $list
 }
 
-for $a in [[1,2],["A","B"],["UCLA","UCSD","UCR","UCI"]]
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.2.update.aql
index 747f29d..1ea43e0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.2.update.aql
@@ -7,14 +7,3 @@
 
 // This test is returning NPE... Issue 200 
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf03.adm";
-
-create function test.echo($list){
-$list
-}
-
-for $a in [[1,2],["A","B"],["UCLA","UCSD","UCR","UCI"]]
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.3.query.aql
index 747f29d..5c135c3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf03/udf03.3.query.aql
@@ -7,14 +7,7 @@
 
 // This test is returning NPE... Issue 200 
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf03.adm";
-
-create function test.echo($list){
-$list
-}
+use dataverse test;
 
 for $a in [[1,2],["A","B"],["UCLA","UCSD","UCR","UCI"]]
 return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.1.ddl.aql
index bd6544f..6bcfd05 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.1.ddl.aql
@@ -7,11 +7,8 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf04.adm";
+use dataverse test;
 
 create function test.echo($list){
 $list
 }
-
-for $a in [{"name":"John","age":45,"id":123},{"name":"Jim","age":55,"id":103},{"name":"Bill","age":35,"id":125}]
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.2.update.aql
index bd6544f..ad89936 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf04.adm";
-
-create function test.echo($list){
-$list
-}
-
-for $a in [{"name":"John","age":45,"id":123},{"name":"Jim","age":55,"id":103},{"name":"Bill","age":35,"id":125}]
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.3.query.aql
index bd6544f..d166e81 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf04/udf04.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf04.adm";
-
-create function test.echo($list){
-$list
-}
+use dataverse test;
 
 for $a in [{"name":"John","age":45,"id":123},{"name":"Jim","age":55,"id":103},{"name":"Bill","age":35,"id":125}]
 return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.1.ddl.aql
index 2429f1c..02b0cdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.1.ddl.aql
@@ -6,12 +6,9 @@
 
 drop dataverse test if exists;
 create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf05.adm";
+use dataverse test;
 
 create function test.echo($a){
 $a
 }
 
-let $b:=1234
-return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.2.update.aql
index 2429f1c..1a6845d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf05.adm";
-
-create function test.echo($a){
-$a
-}
-
-let $b:=1234
-return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.3.query.aql
index 2429f1c..71b592d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf05/udf05.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf05.adm";
-
-create function test.echo($a){
-$a
-}
+use dataverse test;
 
 let $b:=1234
 return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.1.ddl.aql
index 3301d5c..fa094ed 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.1.ddl.aql
@@ -7,11 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf06.adm";
+use dataverse test;
 
 create function test.echo($a){
 $a
 }
 
-let $b:=1234.1
-return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.2.update.aql
index 3301d5c..dc16bfc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf06.adm";
-
-create function test.echo($a){
-$a
-}
-
-let $b:=1234.1
-return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.3.query.aql
index 3301d5c..ba130dc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf06/udf06.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf06.adm";
-
-create function test.echo($a){
-$a
-}
+use dataverse test;
 
 let $b:=1234.1
 return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.1.ddl.aql
index 0280e92..518a6f1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.1.ddl.aql
@@ -7,11 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf07.adm";
+use dataverse test;
 
 create function test.echo($a){
 $a
 }
 
-let $b:=1234.1f
-return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.2.update.aql
index 0280e92..23a19e2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf07.adm";
-
-create function test.echo($a){
-$a
-}
-
-let $b:=1234.1f
-return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.3.query.aql
index 0280e92..f4edd80 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf07/udf07.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf07.adm";
-
-create function test.echo($a){
-$a
-}
+use dataverse test;
 
 let $b:=1234.1f
 return test.echo($b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.1.ddl.aql
index 5dfb9a2..5b41ce3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.1.ddl.aql
@@ -7,11 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf08.adm";
+use dataverse test;
 
 create function test.echo($a){
 $a
 }
 
-let $a:="This is a test string"
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.2.update.aql
index 5dfb9a2..524b312 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf08.adm";
-
-create function test.echo($a){
-$a
-}
-
-let $a:="This is a test string"
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.3.query.aql
index 5dfb9a2..168228d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf08/udf08.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf08.adm";
-
-create function test.echo($a){
-$a
-}
+use dataverse test;
 
 let $a:="This is a test string"
 return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.1.ddl.aql
index 8a09ea2..b485a1c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.1.ddl.aql
@@ -7,7 +7,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf09.adm";
+use dataverse test;
 
 create type test.TestType as open {
 id : int32
@@ -15,17 +15,6 @@
 
 create dataset test.t1(TestType) primary key id;
 
-insert into dataset test.t1({"id":345});
-insert into dataset test.t1({"id":315});
-insert into dataset test.t1({"id":245});
-insert into dataset test.t1({"id":385});
-insert into dataset test.t1({"id":241});
-insert into dataset test.t1({"id":745});
-insert into dataset test.t1({"id":349});
-insert into dataset test.t1({"id":845});
-
 create function test.readDataset($a) {
 $a
 }
-   
-test.readDataset(for $a in dataset('test.t1') order by $a.id return $a);
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.2.update.aql
index 8a09ea2..1196ae7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.2.update.aql
@@ -4,16 +4,7 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf09.adm";
-
-create type test.TestType as open {
-id : int32
-}
-
-create dataset test.t1(TestType) primary key id;
+use dataverse test;
 
 insert into dataset test.t1({"id":345});
 insert into dataset test.t1({"id":315});
@@ -24,8 +15,3 @@
 insert into dataset test.t1({"id":349});
 insert into dataset test.t1({"id":845});
 
-create function test.readDataset($a) {
-$a
-}
-   
-test.readDataset(for $a in dataset('test.t1') order by $a.id return $a);
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.3.query.aql
index 8a09ea2..bbe89e6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09/udf09.3.query.aql
@@ -4,28 +4,6 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf09.adm";
-
-create type test.TestType as open {
-id : int32
-}
-
-create dataset test.t1(TestType) primary key id;
-
-insert into dataset test.t1({"id":345});
-insert into dataset test.t1({"id":315});
-insert into dataset test.t1({"id":245});
-insert into dataset test.t1({"id":385});
-insert into dataset test.t1({"id":241});
-insert into dataset test.t1({"id":745});
-insert into dataset test.t1({"id":349});
-insert into dataset test.t1({"id":845});
-
-create function test.readDataset($a) {
-$a
-}
+use dataverse test;
    
 test.readDataset(for $a in dataset('test.t1') order by $a.id return $a);
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.1.ddl.aql
index d0da4e1..1ac5132 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.1.ddl.aql
@@ -7,11 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf10.adm";
+use dataverse test;
 
 create function test.echo($uolist){
 $uolist
 }
 
-let $a:={{"this is optional data","this is extra data","open types are good"}}
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.2.update.aql
index d0da4e1..3ba2d37 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf10.adm";
-
-create function test.echo($uolist){
-$uolist
-}
-
-let $a:={{"this is optional data","this is extra data","open types are good"}}
-return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.3.query.aql
index d0da4e1..baad7a8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf10/udf10.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf10.adm";
-
-create function test.echo($uolist){
-$uolist
-}
+use dataverse test;
 
 let $a:={{"this is optional data","this is extra data","open types are good"}}
 return test.echo($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.1.ddl.aql
index b842c93..6197e3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.1.ddl.aql
@@ -7,11 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf11.adm";
+use dataverse test;
 
 create function test.OList(){
 [1,2,3,4,5,6,7,8,9,10]
 }
 
-for $a in test.OList()
-return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.2.update.aql
index b842c93..42148fb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.2.update.aql
@@ -4,14 +4,4 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf11.adm";
-
-create function test.OList(){
-[1,2,3,4,5,6,7,8,9,10]
-}
-
-for $a in test.OList()
-return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.3.query.aql
index b842c93..89019d0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf11/udf11.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 4th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf11.adm";
-
-create function test.OList(){
-[1,2,3,4,5,6,7,8,9,10]
-}
+use dataverse test;
 
 for $a in test.OList()
 return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.1.ddl.aql
index e3f8122..f158210 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.1.ddl.aql
@@ -7,10 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf12.adm";
+use dataverse test;
 
 create function test.foo($a,$b) {
 $a+$b
 }
 
-test.foo(100,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.2.update.aql
index e3f8122..b011718 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.2.update.aql
@@ -4,13 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf12.adm";
-
-create function test.foo($a,$b) {
-$a+$b
-}
-
-test.foo(100,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.3.query.aql
index e3f8122..8d993e5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf12/udf12.3.query.aql
@@ -4,13 +4,6 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf12.adm";
-
-create function test.foo($a,$b) {
-$a+$b
-}
+use dataverse test;
 
 test.foo(100,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.1.ddl.aql
index 533def7..1e88934 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.1.ddl.aql
@@ -7,10 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf13.adm";
+use dataverse test;
 
 create function test.foo($a,$b) {
 $a - $b
 }
 
-test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.2.update.aql
index 533def7..4ce8c6d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.2.update.aql
@@ -4,13 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf13.adm";
-
-create function test.foo($a,$b) {
-$a - $b
-}
-
-test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.3.query.aql
index 533def7..f92eeb9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf13/udf13.3.query.aql
@@ -4,13 +4,6 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf13.adm";
-
-create function test.foo($a,$b) {
-$a - $b
-}
+use dataverse test;
 
 test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.1.ddl.aql
index fc3447d..0e034d8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.1.ddl.aql
@@ -7,10 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf14.adm";
+use dataverse test;
 
 create function test.foo($a,$b) {
 $a*$b
 }
 
-test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.2.update.aql
index fc3447d..63c1ba4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.2.update.aql
@@ -4,13 +4,3 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf14.adm";
-
-create function test.foo($a,$b) {
-$a*$b
-}
-
-test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.3.query.aql
index fc3447d..5b89d75 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf14/udf14.3.query.aql
@@ -4,13 +4,6 @@
  * Date         : 4th September 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf14.adm";
-
-create function test.foo($a,$b) {
-$a*$b
-}
+use dataverse test;
 
 test.foo(400,200)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.1.ddl.aql
index 4b4992a..4ea1733 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.1.ddl.aql
@@ -11,11 +11,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf15.adm";
+use dataverse test;
 
 create function test.OList2(){
 [[1,2,3,4,5,6,7,8,9,10],["a","b","c","d","e","f","g","h","y"]]
 }
 
-for $a in test.OList2()
-return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.2.update.aql
index 4b4992a..8328535 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.2.update.aql
@@ -8,14 +8,3 @@
 
 // this test resturns NPE:Issue 166
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf15.adm";
-
-create function test.OList2(){
-[[1,2,3,4,5,6,7,8,9,10],["a","b","c","d","e","f","g","h","y"]]
-}
-
-for $a in test.OList2()
-return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.3.query.aql
index 4b4992a..5d4ab28 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf15/udf15.3.query.aql
@@ -8,14 +8,7 @@
 
 // this test resturns NPE:Issue 166
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf15.adm";
-
-create function test.OList2(){
-[[1,2,3,4,5,6,7,8,9,10],["a","b","c","d","e","f","g","h","y"]]
-}
+use dataverse test;
 
 for $a in test.OList2()
 return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.1.ddl.aql
index e9f0742..0c90307 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.1.ddl.aql
@@ -8,11 +8,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf16.adm";
+use dataverse test;
 
 create function test.fn02(){
 "Welcome to the world of Asterix"
 }
 
-let $str := test.fn02()
-return string-length($str)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.2.update.aql
index e9f0742..86e9b8c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.2.update.aql
@@ -5,14 +5,3 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf16.adm";
-
-create function test.fn02(){
-"Welcome to the world of Asterix"
-}
-
-let $str := test.fn02()
-return string-length($str)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.3.query.aql
index e9f0742..3537503 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf16/udf16.3.query.aql
@@ -5,14 +5,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf16.adm";
-
-create function test.fn02(){
-"Welcome to the world of Asterix"
-}
+use dataverse test;
 
 let $str := test.fn02()
 return string-length($str)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.1.ddl.aql
index b98d123..ade9f42 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.1.ddl.aql
@@ -8,7 +8,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf17.adm";
+use dataverse test;
 
 create function test.parent(){
 test.child()
@@ -18,5 +18,3 @@
 "This data is from the child function"
 }
 
-let $str := test.parent()
-return $str
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.2.update.aql
index b98d123..936919d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.2.update.aql
@@ -5,18 +5,3 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf17.adm";
-
-create function test.parent(){
-test.child()
-}
-
-create function test.child() {
-"This data is from the child function"
-}
-
-let $str := test.parent()
-return $str
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.3.query.aql
index b98d123..92cbf55 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf17/udf17.3.query.aql
@@ -5,18 +5,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf17.adm";
-
-create function test.parent(){
-test.child()
-}
-
-create function test.child() {
-"This data is from the child function"
-}
+use dataverse test;
 
 let $str := test.parent()
 return $str
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.1.ddl.aql
index aa6a57b..a887282 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.1.ddl.aql
@@ -7,11 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf18.adm";
+use dataverse test;
 
 create function test.fn06(){
 false
 }
 
-let $val := not(test.fn06())
-return $val
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.2.update.aql
index aa6a57b..ad2eee1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.2.update.aql
@@ -4,14 +4,3 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf18.adm";
-
-create function test.fn06(){
-false
-}
-
-let $val := not(test.fn06())
-return $val
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.3.query.aql
index aa6a57b..0bdf0e4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf18/udf18.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf18.adm";
-
-create function test.fn06(){
-false
-}
+use dataverse test;
 
 let $val := not(test.fn06())
 return $val
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.1.ddl.aql
index 87c39a5..e8695d2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.1.ddl.aql
@@ -7,7 +7,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf19.adm";
+use dataverse test;
 
 create function test.pie(){
 3.14
@@ -17,7 +17,3 @@
 test.pie() * $radius * $radius
 }
 
-for $a in [2,4,6,8,10,12]
-where test.area($a) > 100
-return test.area($a)
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.2.update.aql
index 87c39a5..a209919 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.2.update.aql
@@ -4,20 +4,4 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf19.adm";
-
-create function test.pie(){
-3.14
-}
-
-create function test.area($radius){
-test.pie() * $radius * $radius
-}
-
-for $a in [2,4,6,8,10,12]
-where test.area($a) > 100
-return test.area($a)
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.3.query.aql
index 87c39a5..ccbd0b1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf19/udf19.3.query.aql
@@ -4,18 +4,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf19.adm";
-
-create function test.pie(){
-3.14
-}
-
-create function test.area($radius){
-test.pie() * $radius * $radius
-}
+use dataverse test;
 
 for $a in [2,4,6,8,10,12]
 where test.area($a) > 100
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.1.ddl.aql
index e0a16a1..cf1b5d3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.1.ddl.aql
@@ -8,7 +8,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf20.adm";
+use dataverse test;
 
 create function test.pie(){
 3.14
@@ -18,6 +18,3 @@
 test.pie() * $radius * $radius
 }
 
-for $a in [2,4,6,8,10,12]
-where test.area($a) > 100
-return { "radius" : $a,"area" : test.area($a) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.2.update.aql
index e0a16a1..1b0856e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.2.update.aql
@@ -4,20 +4,3 @@
  * Date         : Sep 5th 2012
  */
 
-
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf20.adm";
-
-create function test.pie(){
-3.14
-}
-
-create function test.area($radius){
-test.pie() * $radius * $radius
-}
-
-for $a in [2,4,6,8,10,12]
-where test.area($a) > 100
-return { "radius" : $a,"area" : test.area($a) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.3.query.aql
index e0a16a1..3f88d6d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf20/udf20.3.query.aql
@@ -5,18 +5,7 @@
  */
 
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf20.adm";
-
-create function test.pie(){
-3.14
-}
-
-create function test.area($radius){
-test.pie() * $radius * $radius
-}
+use dataverse test;
 
 for $a in [2,4,6,8,10,12]
 where test.area($a) > 100
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.1.ddl.aql
index 7e943c3..bc0e5cd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.1.ddl.aql
@@ -7,12 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf21.adm";
+use dataverse test;
 
 create function test.isOdd($b){
 $b%2 != 0
 }
 
-for $a in [10,20,2,30,4,3,6,44,5,7,9,1,13,17,992,19,40,50,60,25,45,65,75]
-where test.isOdd($a)
-return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.2.update.aql
index 7e943c3..a186d5e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.2.update.aql
@@ -4,15 +4,3 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf21.adm";
-
-create function test.isOdd($b){
-$b%2 != 0
-}
-
-for $a in [10,20,2,30,4,3,6,44,5,7,9,1,13,17,992,19,40,50,60,25,45,65,75]
-where test.isOdd($a)
-return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.3.query.aql
index 7e943c3..5b9066d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf21/udf21.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf21.adm";
-
-create function test.isOdd($b){
-$b%2 != 0
-}
+use dataverse test;
 
 for $a in [10,20,2,30,4,3,6,44,5,7,9,1,13,17,992,19,40,50,60,25,45,65,75]
 where test.isOdd($a)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.1.ddl.aql
index 83e19e6..97ad3b4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.1.ddl.aql
@@ -7,12 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf22.adm";
+use dataverse test;
 
 create function test.getFullName($fname,$lname){
 string-concat([$fname,$lname])
 }
 
-let $fn := "Bob"
-let $ln := "Harbus"
-return test.getFullName($fn,$ln)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.2.update.aql
index 83e19e6..2af21f1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.2.update.aql
@@ -4,15 +4,3 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf22.adm";
-
-create function test.getFullName($fname,$lname){
-string-concat([$fname,$lname])
-}
-
-let $fn := "Bob"
-let $ln := "Harbus"
-return test.getFullName($fn,$ln)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.3.query.aql
index 83e19e6..60e52ca 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf22/udf22.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf22.adm";
-
-create function test.getFullName($fname,$lname){
-string-concat([$fname,$lname])
-}
+use dataverse test;
 
 let $fn := "Bob"
 let $ln := "Harbus"
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.1.ddl.aql
index a2d8ec5..864b697 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.1.ddl.aql
@@ -7,12 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf23.adm";
+use dataverse test;
 
 create function test.numRows(){
 6
 }
-   
-for $l in dataset('Metadata.Dataset')
-limit test.numRows()
-return $l
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.2.update.aql
index a2d8ec5..9c2b7f2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.2.update.aql
@@ -4,15 +4,3 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf23.adm";
-
-create function test.numRows(){
-6
-}
-   
-for $l in dataset('Metadata.Dataset')
-limit test.numRows()
-return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.3.query.aql
index a2d8ec5..f43c299 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf23/udf23.3.query.aql
@@ -4,14 +4,7 @@
  * Date         : Sep 5th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf23.adm";
-
-create function test.numRows(){
-6
-}
+use dataverse test;
    
 for $l in dataset('Metadata.Dataset')
 limit test.numRows()
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.1.ddl.aql
index eef906d..3c8fc04 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.1.ddl.aql
@@ -10,12 +10,10 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf24.adm";
+use dataverse test;
 
 create function test.myRangeFn($n)
 {
    range(1,$n)
 }
 
-for $i in test.myRangeFn(100)
-return $i
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.2.update.aql
index eef906d..fc6a252 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.2.update.aql
@@ -7,15 +7,3 @@
 
 // Returns java.lang.ClassCastException : Issue 195
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf24.adm";
-
-create function test.myRangeFn($n)
-{
-   range(1,$n)
-}
-
-for $i in test.myRangeFn(100)
-return $i
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.3.query.aql
index eef906d..4e85a92 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf24/udf24.3.query.aql
@@ -7,15 +7,7 @@
 
 // Returns java.lang.ClassCastException : Issue 195
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf24.adm";
-
-create function test.myRangeFn($n)
-{
-   range(1,$n)
-}
+use dataverse test;
 
 for $i in test.myRangeFn(100)
 return $i
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.1.ddl.aql
index fefc07e..174b3c9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.1.ddl.aql
@@ -9,7 +9,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf25.adm";
+use dataverse test;
 
 create function test.computeBonus($pbcRating,$salary)
 {
@@ -19,5 +19,3 @@
         $salary * 0.10
 }
 
-test.computeBonus(-1,-1)
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.2.update.aql
index fefc07e..13118c8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.2.update.aql
@@ -6,18 +6,3 @@
 
 // This one returns NPE...
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf25.adm";
-
-create function test.computeBonus($pbcRating,$salary)
-{
-   if ($pbcRating = 1) then
-        $salary * 0.25
-   else
-        $salary * 0.10
-}
-
-test.computeBonus(-1,-1)
-
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.3.query.aql
index fefc07e..f2b1bc1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf25/udf25.3.query.aql
@@ -6,18 +6,7 @@
 
 // This one returns NPE...
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf25.adm";
-
-create function test.computeBonus($pbcRating,$salary)
-{
-   if ($pbcRating = 1) then
-        $salary * 0.25
-   else
-        $salary * 0.10
-}
+use dataverse test;
 
 test.computeBonus(-1,-1)
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.1.ddl.aql
index 95420b7..3e0cf76 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.1.ddl.aql
@@ -7,10 +7,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf26.adm";
+use dataverse test;
 
 create function test.needs_f1($x){
  $x + f1()
 }
 
-test.needs_f1(12345)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.2.update.aql
index 95420b7..58cfb49 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.2.update.aql
@@ -4,13 +4,4 @@
  * Date         : Sep 6th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf26.adm";
-
-create function test.needs_f1($x){
- $x + f1()
-}
-
-test.needs_f1(12345)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.3.query.aql
index 95420b7..686b261 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf26/udf26.3.query.aql
@@ -4,13 +4,6 @@
  * Date         : Sep 6th 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf26.adm";
-
-create function test.needs_f1($x){
- $x + f1()
-}
+use dataverse test;
 
 test.needs_f1(12345)
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.1.ddl.aql
index b9db17f..8e46ca9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.1.ddl.aql
@@ -10,11 +10,9 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf27.adm";
+use dataverse test;
 
 create function test.f1(){
 100
 }
 
-let $a := true
-return some $i in [100,200] satisfies test.f1()
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.2.update.aql
index b9db17f..57b59fb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.2.update.aql
@@ -7,14 +7,4 @@
 // this test is not giving expected results.
 // issue 194 reported to track this
 
-drop dataverse test if exists;
-create dataverse test;
 
-write output to nc1:"rttest/user-defined-functions_udf27.adm";
-
-create function test.f1(){
-100
-}
-
-let $a := true
-return some $i in [100,200] satisfies test.f1()
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.3.query.aql
index b9db17f..50a1cb2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf27/udf27.3.query.aql
@@ -7,14 +7,7 @@
 // this test is not giving expected results.
 // issue 194 reported to track this
 
-drop dataverse test if exists;
-create dataverse test;
-
-write output to nc1:"rttest/user-defined-functions_udf27.adm";
-
-create function test.f1(){
-100
-}
+use dataverse test;
 
 let $a := true
 return some $i in [100,200] satisfies test.f1()
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.1.ddl.aql
index 0505179..1290600 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.1.ddl.aql
@@ -5,8 +5,3 @@
  * Date         : 26th November 2012
  */
  
-write output to nc1:"rttest/user-defined-functions_query-issue201.adm";
-
-let $x:=range(1,100)
-for $i in $x
-return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.2.update.aql
index 0505179..31d1bb3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.2.update.aql
@@ -4,9 +4,4 @@
  * Expected Res : Success
  * Date         : 26th November 2012
  */
- 
-write output to nc1:"rttest/user-defined-functions_query-issue201.adm";
 
-let $x:=range(1,100)
-for $i in $x
-return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.3.query.aql
index 0505179..6dc27e2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/uery-issue201/uery-issue201.3.query.aql
@@ -4,9 +4,8 @@
  * Expected Res : Success
  * Date         : 26th November 2012
  */
- 
-write output to nc1:"rttest/user-defined-functions_query-issue201.adm";
+
 
 let $x:=range(1,100)
 for $i in $x
-return $i
\ No newline at end of file
+return $i
diff --git a/asterix-app/src/test/resources/runtimets/results/tpch/q10_returned_ite/q10_returned_ite.1.adm b/asterix-app/src/test/resources/runtimets/results/tpch/q10_returned_item/q10_returned_ite.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/tpch/q10_returned_ite/q10_returned_ite.1.adm
rename to asterix-app/src/test/resources/runtimets/results/tpch/q10_returned_item/q10_returned_ite.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 625272d..39b8b19 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -1,9 +1,3970 @@
-<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries">
+<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
   <test-group name="aggregate">
-   <test-case FilePath="aggregate">
+    <test-case FilePath="aggregate">
       <compilation-unit name="avg_double">
         <output-dir compare="Text">avg_double</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_double_null">
+        <output-dir compare="Text">avg_double_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_empty_01">
+        <output-dir compare="Text">avg_empty_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_empty_02">
+        <output-dir compare="Text">avg_empty_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_float">
+        <output-dir compare="Text">avg_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_float_null">
+        <output-dir compare="Text">avg_float_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int16">
+        <output-dir compare="Text">avg_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int16_null">
+        <output-dir compare="Text">avg_int16_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int32">
+        <output-dir compare="Text">avg_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int32_null">
+        <output-dir compare="Text">avg_int32_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int64">
+        <output-dir compare="Text">avg_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int64_null">
+        <output-dir compare="Text">avg_int64_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int8">
+        <output-dir compare="Text">avg_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="avg_int8_null">
+        <output-dir compare="Text">avg_int8_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="count_01">
+        <output-dir compare="Text">count_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="count_empty_01">
+        <output-dir compare="Text">count_empty_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="count_empty_02">
+        <output-dir compare="Text">count_empty_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="count_null">
+        <output-dir compare="Text">count_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="aggregate">
+      <compilation-unit name="droptype">
+        <output-dir compare="Text">droptype</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="aggregate">
+      <compilation-unit name="global-avg_01">
+        <output-dir compare="Text">global-avg_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="global-avg_null">
+        <output-dir compare="Text">global-avg_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_double">
+        <output-dir compare="Text">local-avg_double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_double_null">
+        <output-dir compare="Text">local-avg_double_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_float">
+        <output-dir compare="Text">local-avg_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_float_null">
+        <output-dir compare="Text">local-avg_float_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int16">
+        <output-dir compare="Text">local-avg_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int16_null">
+        <output-dir compare="Text">local-avg_int16_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int32">
+        <output-dir compare="Text">local-avg_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int32_null">
+        <output-dir compare="Text">local-avg_int32_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int64">
+        <output-dir compare="Text">local-avg_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int64_null">
+        <output-dir compare="Text">local-avg_int64_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int8">
+        <output-dir compare="Text">local-avg_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="local-avg_int8_null">
+        <output-dir compare="Text">local-avg_int8_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="max_empty_01">
+        <output-dir compare="Text">max_empty_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="max_empty_02">
+        <output-dir compare="Text">max_empty_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="min_empty_01">
+        <output-dir compare="Text">min_empty_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="min_empty_02">
+        <output-dir compare="Text">min_empty_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_avg">
+        <output-dir compare="Text">scalar_avg</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_avg_empty">
+        <output-dir compare="Text">scalar_avg_empty</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_avg_null">
+        <output-dir compare="Text">scalar_avg_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_count">
+        <output-dir compare="Text">scalar_count</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_count_empty">
+        <output-dir compare="Text">scalar_count_empty</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_count_null">
+        <output-dir compare="Text">scalar_count_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_max">
+        <output-dir compare="Text">scalar_max</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_max_empty">
+        <output-dir compare="Text">scalar_max_empty</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_max_null">
+        <output-dir compare="Text">scalar_max_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_min">
+        <output-dir compare="Text">scalar_min</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_min_empty">
+        <output-dir compare="Text">scalar_min_empty</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_min_null">
+        <output-dir compare="Text">scalar_min_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_sum">
+        <output-dir compare="Text">scalar_sum</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_sum_empty">
+        <output-dir compare="Text">scalar_sum_empty</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="scalar_sum_null">
+        <output-dir compare="Text">scalar_sum_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_double">
+        <output-dir compare="Text">sum_double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_double_null">
+        <output-dir compare="Text">sum_double_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_empty_01">
+        <output-dir compare="Text">sum_empty_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_empty_02">
+        <output-dir compare="Text">sum_empty_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_float">
+        <output-dir compare="Text">sum_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_float_null">
+        <output-dir compare="Text">sum_float_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int16">
+        <output-dir compare="Text">sum_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int16_null">
+        <output-dir compare="Text">sum_int16_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int32">
+        <output-dir compare="Text">sum_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int32_null">
+        <output-dir compare="Text">sum_int32_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int64">
+        <output-dir compare="Text">sum_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int64_null">
+        <output-dir compare="Text">sum_int64_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int8">
+        <output-dir compare="Text">sum_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_int8_null">
+        <output-dir compare="Text">sum_int8_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_null-with-pred">
+        <output-dir compare="Text">sum_null-with-pred</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="sum_numeric_null">
+        <output-dir compare="Text">sum_numeric_null</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="boolean">
+    <test-case FilePath="boolean">
+      <compilation-unit name="and_01">
+        <output-dir compare="Text">and_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="boolean">
+      <compilation-unit name="and_null">
+        <output-dir compare="Text">and_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="boolean">
+      <compilation-unit name="and_null_false">
+        <output-dir compare="Text">and_null_false</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="boolean">
+      <compilation-unit name="not_01">
+        <output-dir compare="Text">not_01</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="comparison">
+    <test-case FilePath="comparison">
+      <compilation-unit name="datetime_order">
+        <output-dir compare="Text">datetime_order</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="datetime_range">
+        <output-dir compare="Text">datetime_range</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="datetime_tzeq">
+        <output-dir compare="Text">datetime_tzeq</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="double">
+        <output-dir compare="Text">double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="double_gte_01">
+        <output-dir compare="Text">double_gte_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="double_null">
+        <output-dir compare="Text">double_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="eq_01">
+        <output-dir compare="Text">eq_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="float">
+        <output-dir compare="Text">float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="float_null">
+        <output-dir compare="Text">float_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="gt_01">
+        <output-dir compare="Text">gt_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="gte_01">
+        <output-dir compare="Text">gte_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int16">
+        <output-dir compare="Text">int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int16_null">
+        <output-dir compare="Text">int16_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int32">
+        <output-dir compare="Text">int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int32_null">
+        <output-dir compare="Text">int32_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int64">
+        <output-dir compare="Text">int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int64_null">
+        <output-dir compare="Text">int64_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int8">
+        <output-dir compare="Text">int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="int8_null">
+        <output-dir compare="Text">int8_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="lt_01">
+        <output-dir compare="Text">lt_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="lte_01">
+        <output-dir compare="Text">lte_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="neq_01">
+        <output-dir compare="Text">neq_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="comparison">
+      <compilation-unit name="numeric-comparison_01">
+        <output-dir compare="Text">numeric-comparison_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="comparison">
+      <compilation-unit name="string">
+        <output-dir compare="Text">string</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="string_null">
+        <output-dir compare="Text">string_null</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="constructor">
+    <test-case FilePath="constructor">
+      <compilation-unit name="add-null">
+        <output-dir compare="Text">add-null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="boolean_01">
+        <output-dir compare="Text">boolean_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="circle_01">
+        <output-dir compare="Text">circle_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="date_01">
+        <output-dir compare="Text">date_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="datetime_01">
+        <output-dir compare="Text">datetime_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="double_01">
+        <output-dir compare="Text">double_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="duration_01">
+        <output-dir compare="Text">duration_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="float_01">
+        <output-dir compare="Text">float_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="int_01">
+        <output-dir compare="Text">int_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="line_01">
+        <output-dir compare="Text">line_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="point_01">
+        <output-dir compare="Text">point_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="polygon_01">
+        <output-dir compare="Text">polygon_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="primitive-01">
+        <output-dir compare="Text">primitive-01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="primitive-02">
+        <output-dir compare="Text">primitive-02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="primitive-03">
+        <output-dir compare="Text">primitive-03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="primitive-04">
+        <output-dir compare="Text">primitive-04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="string_01">
+        <output-dir compare="Text">string_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
+      <compilation-unit name="time_01">
+        <output-dir compare="Text">time_01</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="custord">
+    <!--
+    <test-case FilePath="custord">
+      <compilation-unit name="co">
+        <output-dir compare="Text">co</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_01">
+        <output-dir compare="Text">customer_q_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_02">
+        <output-dir compare="Text">customer_q_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_03">
+        <output-dir compare="Text">customer_q_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_04">
+        <output-dir compare="Text">customer_q_04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_05">
+        <output-dir compare="Text">customer_q_05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_06">
+        <output-dir compare="Text">customer_q_06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_07">
+        <output-dir compare="Text">customer_q_07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="customer_q_08">
+        <output-dir compare="Text">customer_q_08</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="custord">
+      <compilation-unit name="denorm-cust-order_01">
+        <output-dir compare="Text">denorm-cust-order_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="custord">
+      <compilation-unit name="denorm-cust-order_02">
+        <output-dir compare="Text">denorm-cust-order_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="custord">
+      <compilation-unit name="denorm-cust-order_03">
+        <output-dir compare="Text">denorm-cust-order_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="custord">
+      <compilation-unit name="freq-clerk">
+        <output-dir compare="Text">freq-clerk</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="custord">
+      <compilation-unit name="join_q_01">
+        <output-dir compare="Text">join_q_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="join_q_02">
+        <output-dir compare="Text">join_q_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="join_q_03">
+        <output-dir compare="Text">join_q_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="custord">
+      <compilation-unit name="join_q_04">
+        <output-dir compare="Text">join_q_04</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="custord">
+      <compilation-unit name="load-test">
+        <output-dir compare="Text">load-test</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="order_q_01">
+        <output-dir compare="Text">order_q_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="order_q_02">
+        <output-dir compare="Text">order_q_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="order_q_03">
+        <output-dir compare="Text">order_q_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="order_q_04">
+        <output-dir compare="Text">order_q_04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="order_q_05">
+        <output-dir compare="Text">order_q_05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
+      <compilation-unit name="order_q_06">
+        <output-dir compare="Text">order_q_06</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="dapd">
+    <test-case FilePath="dapd">
+      <compilation-unit name="q1">
+        <output-dir compare="Text">q1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dapd">
+      <compilation-unit name="q2">
+        <output-dir compare="Text">q2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="dapd">
+      <compilation-unit name="q3">
+        <output-dir compare="Text">q3</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+  </test-group>
+  <test-group name="dml">
+    <test-case FilePath="dml">
+      <compilation-unit name="query-issue205">
+        <output-dir compare="Text">query-issue205</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="delete-from-loaded-dataset-with-index">
+        <output-dir compare="Text">delete-from-loaded-dataset-with-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="delete-from-loaded-dataset">
+        <output-dir compare="Text">delete-from-loaded-dataset</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="delete-syntax-change">
+        <output-dir compare="Text">delete-syntax-change</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="drop-empty-secondary-indexes">
+        <output-dir compare="Text">drop-empty-secondary-indexes</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="create-drop-cltype">
+        <output-dir compare="Text">create-drop-cltype</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="create-drop-opntype">
+        <output-dir compare="Text">create-drop-opntype</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="empty-load-with-index">
+        <output-dir compare="Text">empty-load-with-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="empty-load">
+        <output-dir compare="Text">empty-load</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-into-empty-dataset-with-index">
+        <output-dir compare="Text">insert-into-empty-dataset-with-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-into-empty-dataset-with-index">
+        <output-dir compare="Text">insert-into-empty-dataset-with-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-syntax">
+        <output-dir compare="Text">insert-syntax</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-into-loaded-dataset-with-index_01">
+        <output-dir compare="Text">insert-into-loaded-dataset-with-index_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-into-loaded-dataset-with-index_02">
+        <output-dir compare="Text">insert-into-loaded-dataset-with-index_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-into-loaded-dataset_01">
+        <output-dir compare="Text">insert-into-loaded-dataset_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-into-loaded-dataset_02">
+        <output-dir compare="Text">insert-into-loaded-dataset_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert-src-dst-01">
+        <output-dir compare="Text">insert-src-dst-01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert">
+        <output-dir compare="Text">insert</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="insert_less_nc">
+        <output-dir compare="Text">insert_less_nc</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="dml">
+      <compilation-unit name="load-from-hdfs">
+        <output-dir compare="Text">load-from-hdfs</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="dml">
+      <compilation-unit name="load-with-index">
+        <output-dir compare="Text">load-with-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-c2o-recursive">
+        <output-dir compare="Text">opentype-c2o-recursive</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-c2o">
+        <output-dir compare="Text">opentype-c2o</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-closed-optional">
+        <output-dir compare="Text">opentype-closed-optional</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-insert">
+        <output-dir compare="Text">opentype-insert</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-insert2">
+        <output-dir compare="Text">opentype-insert2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-noexpand">
+        <output-dir compare="Text">opentype-noexpand</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-o2c-recursive">
+        <output-dir compare="Text">opentype-o2c-recursive</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-o2c">
+        <output-dir compare="Text">opentype-o2c</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="opentype-o2o">
+        <output-dir compare="Text">opentype-o2o</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-btree-secondary-index-nullable">
+        <output-dir compare="Text">scan-delete-btree-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-rtree-secondary-index-nullable">
+        <output-dir compare="Text">scan-delete-rtree-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-rtree-secondary-index">
+        <output-dir compare="Text">scan-delete-rtree-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-btree-secondary-index-nullable">
+        <output-dir compare="Text">scan-insert-btree-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-rtree-secondary-index-nullable">
+        <output-dir compare="Text">scan-insert-rtree-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-rtree-secondary-index">
+        <output-dir compare="Text">scan-insert-rtree-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="employee">
+    <test-case FilePath="employee">
+      <compilation-unit name="q_01">
+        <output-dir compare="Text">q_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="employee">
+      <compilation-unit name="q_02">
+        <output-dir compare="Text">q_02</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="failure">
+    <test-case FilePath="failure">
+      <compilation-unit name="delete-rtree">
+        <output-dir compare="Text">delete-rtree</output-dir>
+        <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+      </compilation-unit>
+      <compilation-unit name="verify_delete-rtree">
+        <output-dir compare="Text">delete-rtree</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="failure">
+      <compilation-unit name="delete">
+        <output-dir compare="Text">delete</output-dir>
+        <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+      </compilation-unit>
+      <compilation-unit name="verify_delete">
+        <output-dir compare="Text">delete</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="failure">
+      <compilation-unit name="insert-rtree">
+        <output-dir compare="Text">insert-rtree</output-dir>
+        <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+      </compilation-unit>
+      <compilation-unit name="verify_insert-rtree">
+        <output-dir compare="Text">insert-rtree</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="failure">
+      <compilation-unit name="insert">
+        <output-dir compare="Text">insert</output-dir>
+        <expected-error>edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException</expected-error>
+      </compilation-unit>
+      <compilation-unit name="verify_insert">
+        <output-dir compare="Text">insert</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="failure">
+      <compilation-unit name="q1_pricing_summary_report_failure">
+        <output-dir compare="Text">q1_pricing_summary_report_failure</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+  </test-group>
+  <!--
+  <test-group name="flwor">
+    <test-case FilePath="flwor">
+      <compilation-unit name="for01">
+        <output-dir compare="Text">for01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for02">
+        <output-dir compare="Text">for02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for03">
+        <output-dir compare="Text">for03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for04">
+        <output-dir compare="Text">for04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for05">
+        <output-dir compare="Text">for05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for06">
+        <output-dir compare="Text">for06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for07">
+        <output-dir compare="Text">for07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for08">
+        <output-dir compare="Text">for08</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for09">
+        <output-dir compare="Text">for09</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for10">
+        <output-dir compare="Text">for10</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for11">
+        <output-dir compare="Text">for11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for12">
+        <output-dir compare="Text">for12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for13">
+        <output-dir compare="Text">for13</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for14">
+        <output-dir compare="Text">for14</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for15">
+        <output-dir compare="Text">for15</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for16">
+        <output-dir compare="Text">for16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for17">
+        <output-dir compare="Text">for17</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for18">
+        <output-dir compare="Text">for18</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="for19">
+        <output-dir compare="Text">for19</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="grpby01">
+        <output-dir compare="Text">grpby01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="grpby02">
+        <output-dir compare="Text">grpby02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let01">
+        <output-dir compare="Text">let01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let02">
+        <output-dir compare="Text">let02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let03">
+        <output-dir compare="Text">let03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let04">
+        <output-dir compare="Text">let04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let05">
+        <output-dir compare="Text">let05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let06">
+        <output-dir compare="Text">let06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let07">
+        <output-dir compare="Text">let07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let08">
+        <output-dir compare="Text">let08</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let09">
+        <output-dir compare="Text">let09</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let10">
+        <output-dir compare="Text">let10</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let11">
+        <output-dir compare="Text">let11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let12">
+        <output-dir compare="Text">let12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let13">
+        <output-dir compare="Text">let13</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let14">
+        <output-dir compare="Text">let14</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let15">
+        <output-dir compare="Text">let15</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let16">
+        <output-dir compare="Text">let16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let17">
+        <output-dir compare="Text">let17</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let18">
+        <output-dir compare="Text">let18</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let19">
+        <output-dir compare="Text">let19</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let20">
+        <output-dir compare="Text">let20</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let21">
+        <output-dir compare="Text">let21</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let22">
+        <output-dir compare="Text">let22</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let23">
+        <output-dir compare="Text">let23</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let24">
+        <output-dir compare="Text">let24</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let25">
+        <output-dir compare="Text">let25</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let26">
+        <output-dir compare="Text">let26</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let27">
+        <output-dir compare="Text">let27</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let28">
+        <output-dir compare="Text">let28</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let29">
+        <output-dir compare="Text">let29</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let30">
+        <output-dir compare="Text">let30</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let31">
+        <output-dir compare="Text">let31</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="let32">
+        <output-dir compare="Text">let32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-01">
+        <output-dir compare="Text">order-by-01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-02">
+        <output-dir compare="Text">order-by-02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-03">
+        <output-dir compare="Text">order-by-03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-04">
+        <output-dir compare="Text">order-by-04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-05">
+        <output-dir compare="Text">order-by-05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-06">
+        <output-dir compare="Text">order-by-06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-07">
+        <output-dir compare="Text">order-by-07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-08">
+        <output-dir compare="Text">order-by-08</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-09">
+        <output-dir compare="Text">order-by-09</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-10">
+        <output-dir compare="Text">order-by-10</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-11">
+        <output-dir compare="Text">order-by-11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="order-by-12">
+        <output-dir compare="Text">order-by-12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-01">
+        <output-dir compare="Text">ret-01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-02">
+        <output-dir compare="Text">ret-02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-03">
+        <output-dir compare="Text">ret-03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-04">
+        <output-dir compare="Text">ret-04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-05">
+        <output-dir compare="Text">ret-05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-06">
+        <output-dir compare="Text">ret-06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-07">
+        <output-dir compare="Text">ret-07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-08">
+        <output-dir compare="Text">ret-08</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-09">
+        <output-dir compare="Text">ret-09</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-10">
+        <output-dir compare="Text">ret-10</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-11">
+        <output-dir compare="Text">ret-11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-12">
+        <output-dir compare="Text">ret-12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-13">
+        <output-dir compare="Text">ret-13</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-14">
+        <output-dir compare="Text">ret-14</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-15">
+        <output-dir compare="Text">ret-15</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-16">
+        <output-dir compare="Text">ret-16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-17">
+        <output-dir compare="Text">ret-17</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-18">
+        <output-dir compare="Text">ret-18</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="flwor">
+      <compilation-unit name="ret-19">
+        <output-dir compare="Text">ret-19</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  -->
+  <test-group name="fuzzyjoin">
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-1_1">
+        <output-dir compare="Text">dblp-1_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-1_2.1.1">
+        <output-dir compare="Text">dblp-1_2.1.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-1_2.1">
+        <output-dir compare="Text">dblp-1_2.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-1_2">
+        <output-dir compare="Text">dblp-1_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2.1_5.3.1">
+        <output-dir compare="Text">dblp-2.1_5.3.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_1">
+        <output-dir compare="Text">dblp-2_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_2">
+        <output-dir compare="Text">dblp-2_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2.2">
+        <output-dir compare="Text">dblp-2.2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_3">
+        <output-dir compare="Text">dblp-2_3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_4">
+        <output-dir compare="Text">dblp-2_4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_5.1">
+        <output-dir compare="Text">dblp-2_5.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_5.2">
+        <output-dir compare="Text">dblp-2_5.2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_5.3.1">
+        <output-dir compare="Text">dblp-2_5.3.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_5.3">
+        <output-dir compare="Text">dblp-2_5.3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-2_5">
+        <output-dir compare="Text">dblp-2_5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-3_1.1">
+        <output-dir compare="Text">dblp-3_1.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-3_1.2">
+        <output-dir compare="Text">dblp-3_1.2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-3_1">
+        <output-dir compare="Text">dblp-3_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-aqlplus_1">
+        <output-dir compare="Text">dblp-aqlplus_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-aqlplus_2">
+        <output-dir compare="Text">dblp-aqlplus_2</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_1">
+        <output-dir compare="Text">dblp-csx-2_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_2">
+        <output-dir compare="Text">dblp-csx-2_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_3">
+        <output-dir compare="Text">dblp-csx-2_3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_4">
+        <output-dir compare="Text">dblp-csx-2_4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_5.1">
+        <output-dir compare="Text">dblp-csx-2_5.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_5.2">
+        <output-dir compare="Text">dblp-csx-2_5.2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_5.3.1">
+        <output-dir compare="Text">dblp-csx-2_5.3.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_5.3">
+        <output-dir compare="Text">dblp-csx-2_5.3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-2_5">
+        <output-dir compare="Text">dblp-csx-2_5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_1">
+        <output-dir compare="Text">dblp-csx-3_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_2">
+        <output-dir compare="Text">dblp-csx-3_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_3">
+        <output-dir compare="Text">dblp-csx-3_3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_4">
+        <output-dir compare="Text">dblp-csx-3_4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5.1">
+        <output-dir compare="Text">dblp-csx-3_5.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5.2">
+        <output-dir compare="Text">dblp-csx-3_5.2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5.3.1">
+        <output-dir compare="Text">dblp-csx-3_5.3.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5.3">
+        <output-dir compare="Text">dblp-csx-3_5.3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5.4.1">
+        <output-dir compare="Text">dblp-csx-3_5.4.1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5.4">
+        <output-dir compare="Text">dblp-csx-3_5.4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-3_5">
+        <output-dir compare="Text">dblp-csx-3_5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-aqlplus_1">
+        <output-dir compare="Text">dblp-csx-aqlplus_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-aqlplus_2">
+        <output-dir compare="Text">dblp-csx-aqlplus_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-aqlplus_3">
+        <output-dir compare="Text">dblp-csx-aqlplus_3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-csx-dblp-aqlplus_1">
+        <output-dir compare="Text">dblp-csx-dblp-aqlplus_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-lookup_1">
+        <output-dir compare="Text">dblp-lookup_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="fuzzyjoin">
+      <compilation-unit name="dblp-splits-3_1">
+        <output-dir compare="Text">dblp-splits-3_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+  </test-group>
+  <test-group name="index-join">
+    <test-case FilePath="index-join">
+      <compilation-unit name="btree-primary-equi-join">
+        <output-dir compare="Text">btree-primary-equi-join</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-join">
+      <compilation-unit name="btree-secondary-equi-join">
+        <output-dir compare="Text">btree-secondary-equi-join</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-join">
+      <compilation-unit name="rtree-spatial-intersect-point">
+        <output-dir compare="Text">rtree-spatial-intersect-point</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="index-selection">
+    <test-case FilePath="index-selection">
+      <compilation-unit name="btree-index-composite-key">
+        <output-dir compare="Text">btree-index-composite-key</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="btree-index-rewrite-multiple">
+        <output-dir compare="Text">btree-index-rewrite-multiple</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="cust-index-age-nullable">
+        <output-dir compare="Text">cust-index-age-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-ngram-contains">
+        <output-dir compare="Text">inverted-index-ngram-contains</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-ngram-edit-distance-panic">
+        <output-dir compare="Text">inverted-index-ngram-edit-distance-panic</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-ngram-edit-distance">
+        <output-dir compare="Text">inverted-index-ngram-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-ngram-jaccard">
+        <output-dir compare="Text">inverted-index-ngram-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-olist-edit-distance-panic">
+        <output-dir compare="Text">inverted-index-olist-edit-distance-panic</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-olist-edit-distance">
+        <output-dir compare="Text">inverted-index-olist-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-olist-jaccard">
+        <output-dir compare="Text">inverted-index-olist-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-ulist-jaccard">
+        <output-dir compare="Text">inverted-index-ulist-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-word-contains">
+        <output-dir compare="Text">inverted-index-word-contains</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="inverted-index-word-jaccard">
+        <output-dir compare="Text">inverted-index-word-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="orders-index-custkey-conjunctive-open">
+        <output-dir compare="Text">orders-index-custkey-conjunctive-open</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="orders-index-custkey-conjunctive">
+        <output-dir compare="Text">orders-index-custkey-conjunctive</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="orders-index-custkey-open">
+        <output-dir compare="Text">orders-index-custkey-open</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="orders-index-custkey">
+        <output-dir compare="Text">orders-index-custkey</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="range-search-open">
+        <output-dir compare="Text">range-search-open</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="range-search">
+        <output-dir compare="Text">range-search</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="rtree-secondary-index-nullable">
+        <output-dir compare="Text">rtree-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="rtree-secondary-index-open">
+        <output-dir compare="Text">rtree-secondary-index-open</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="index-selection">
+      <compilation-unit name="rtree-secondary-index">
+        <output-dir compare="Text">rtree-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="inverted-index-join">
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="ngram-edit-distance">
+        <output-dir compare="Text">ngram-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="ngram-edit-distance-inline">
+        <output-dir compare="Text">ngram-edit-distance-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="ngram-jaccard">
+        <output-dir compare="Text">ngram-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="ngram-jaccard-inline">
+        <output-dir compare="Text">ngram-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="olist-edit-distance">
+        <output-dir compare="Text">olist-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="olist-edit-distance-inline">
+        <output-dir compare="Text">olist-edit-distance-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="olist-jaccard">
+        <output-dir compare="Text">olist-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="olist-jaccard-inline">
+        <output-dir compare="Text">olist-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="ulist-jaccard">
+        <output-dir compare="Text">ulist-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="ulist-jaccard-inline">
+        <output-dir compare="Text">ulist-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="word-jaccard">
+        <output-dir compare="Text">word-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join">
+      <compilation-unit name="word-jaccard-inline">
+        <output-dir compare="Text">word-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="inverted-index-join-noeqjoin">
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="ngram-edit-distance">
+        <output-dir compare="Text">ngram-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="ngram-edit-distance-inline">
+        <output-dir compare="Text">ngram-edit-distance-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="ngram-jaccard">
+        <output-dir compare="Text">ngram-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="ngram-jaccard-inline">
+        <output-dir compare="Text">ngram-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="olist-edit-distance">
+        <output-dir compare="Text">olist-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="olist-edit-distance-inline">
+        <output-dir compare="Text">olist-edit-distance-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="olist-jaccard">
+        <output-dir compare="Text">olist-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="olist-jaccard-inline">
+        <output-dir compare="Text">olist-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="ulist-jaccard">
+        <output-dir compare="Text">ulist-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="ulist-jaccard-inline">
+        <output-dir compare="Text">ulist-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="word-jaccard">
+        <output-dir compare="Text">word-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="inverted-index-join-noeqjoin">
+      <compilation-unit name="word-jaccard-inline">
+        <output-dir compare="Text">word-jaccard-inline</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="list">
+    <test-case FilePath="list">
+      <compilation-unit name="any-collection-member_01">
+        <output-dir compare="Text">any-collection-member_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="get-item_01">
+        <output-dir compare="Text">get-item_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="len_01">
+        <output-dir compare="Text">len_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="len_null_01">
+        <output-dir compare="Text">len_null_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="listify_01">
+        <output-dir compare="Text">listify_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="listify_02">
+        <output-dir compare="Text">listify_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="listify_03">
+        <output-dir compare="Text">listify_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="ordered-list-constructor_01">
+        <output-dir compare="Text">ordered-list-constructor_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="ordered-list-constructor_02">
+        <output-dir compare="Text">ordered-list-constructor_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="ordered-list-constructor_03">
+        <output-dir compare="Text">ordered-list-constructor_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="scan-collection_01">
+        <output-dir compare="Text">scan-collection_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="union_01">
+        <output-dir compare="Text">union_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="union_02">
+        <output-dir compare="Text">union_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="unordered-list-constructor_01">
+        <output-dir compare="Text">unordered-list-constructor_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="unordered-list-constructor_02">
+        <output-dir compare="Text">unordered-list-constructor_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="list">
+      <compilation-unit name="unordered-list-constructor_03">
+        <output-dir compare="Text">unordered-list-constructor_03</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="misc">
+  <test-case FilePath="misc">
+      <compilation-unit name="partition-by-nonexistent-field">
+        <output-dir compare="Text">partition-by-nonexistent-field</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="float_01">
+        <output-dir compare="Text">float_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="groupby-orderby-count">
+        <output-dir compare="Text">groupby-orderby-count</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="ifthenelse_01">
+        <output-dir compare="Text">ifthenelse_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="is-null_01">
+        <output-dir compare="Text">is-null_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="nested-loop-join_01">
+        <output-dir compare="Text">nested-loop-join_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="range_01">
+        <output-dir compare="Text">range_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="tid_01">
+        <output-dir compare="Text">tid_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="misc">
+      <compilation-unit name="year_01">
+        <output-dir compare="Text">year_01</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="nestrecords">
+    <test-case FilePath="nestrecords">
+      <compilation-unit name="nestrecord">
+        <output-dir compare="Text">nestrecord</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="numeric">
+    <test-case FilePath="numeric">
+      <compilation-unit name="abs0">
+        <output-dir compare="Text">abs0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="abs1">
+        <output-dir compare="Text">abs1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="abs2">
+        <output-dir compare="Text">abs2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="abs3">
+        <output-dir compare="Text">abs3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="abs4">
+        <output-dir compare="Text">abs4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="add_double">
+        <output-dir compare="Text">add_double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="add_float">
+        <output-dir compare="Text">add_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="add_int16">
+        <output-dir compare="Text">add_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="add_int32">
+        <output-dir compare="Text">add_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="add_int64">
+        <output-dir compare="Text">add_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="add_int8">
+        <output-dir compare="Text">add_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="ceiling0">
+        <output-dir compare="Text">ceiling0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="ceiling1">
+        <output-dir compare="Text">ceiling1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="ceiling2">
+        <output-dir compare="Text">ceiling2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="ceiling3">
+        <output-dir compare="Text">ceiling3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="ceiling4">
+        <output-dir compare="Text">ceiling4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="divide_double">
+        <output-dir compare="Text">divide_double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="divide_float">
+        <output-dir compare="Text">divide_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="divide_int16">
+        <output-dir compare="Text">divide_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="divide_int32">
+        <output-dir compare="Text">divide_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="divide_int64">
+        <output-dir compare="Text">divide_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="divide_int8">
+        <output-dir compare="Text">divide_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="floor0">
+        <output-dir compare="Text">floor0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="floor1">
+        <output-dir compare="Text">floor1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="floor2">
+        <output-dir compare="Text">floor2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="floor3">
+        <output-dir compare="Text">floor3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="floor4">
+        <output-dir compare="Text">floor4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="multiply_double">
+        <output-dir compare="Text">multiply_double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="multiply_float">
+        <output-dir compare="Text">multiply_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="multiply_int16">
+        <output-dir compare="Text">multiply_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="multiply_int32">
+        <output-dir compare="Text">multiply_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="multiply_int64">
+        <output-dir compare="Text">multiply_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="multiply_int8">
+        <output-dir compare="Text">multiply_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even0">
+        <output-dir compare="Text">round-half-to-even0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even1">
+        <output-dir compare="Text">round-half-to-even1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even2">
+        <output-dir compare="Text">round-half-to-even2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even20">
+        <output-dir compare="Text">round-half-to-even20</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even21">
+        <output-dir compare="Text">round-half-to-even21</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even22">
+        <output-dir compare="Text">round-half-to-even22</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even23">
+        <output-dir compare="Text">round-half-to-even23</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even24">
+        <output-dir compare="Text">round-half-to-even24</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even3">
+        <output-dir compare="Text">round-half-to-even3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even4">
+        <output-dir compare="Text">round-half-to-even4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round-half-to-even5">
+        <output-dir compare="Text">round-half-to-even5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round0">
+        <output-dir compare="Text">round0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round1">
+        <output-dir compare="Text">round1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round2">
+        <output-dir compare="Text">round2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round3">
+        <output-dir compare="Text">round3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="round4">
+        <output-dir compare="Text">round4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="subtract_double">
+        <output-dir compare="Text">subtract_double</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="subtract_float">
+        <output-dir compare="Text">subtract_float</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="subtract_int16">
+        <output-dir compare="Text">subtract_int16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="subtract_int32">
+        <output-dir compare="Text">subtract_int32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="subtract_int64">
+        <output-dir compare="Text">subtract_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="subtract_int8">
+        <output-dir compare="Text">subtract_int8</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_double_01">
+        <output-dir compare="Text">unary-minus_double_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_double_02">
+        <output-dir compare="Text">unary-minus_double_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_float_01">
+        <output-dir compare="Text">unary-minus_float_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_float_02">
+        <output-dir compare="Text">unary-minus_float_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_int_01">
+        <output-dir compare="Text">unary-minus_int_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_int_02">
+        <output-dir compare="Text">unary-minus_int_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
+      <compilation-unit name="unary-minus_null">
+        <output-dir compare="Text">unary-minus_null</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="open-closed">
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="c2c-w-optional">
+        <output-dir compare="Text">c2c-w-optional</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="c2c-wo-optional">
+        <output-dir compare="Text">c2c-wo-optional</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="c2c">
+        <output-dir compare="Text">c2c</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="open-closed">
+      <compilation-unit name="heterog-list-ordered01">
+        <output-dir compare="Text">heterog-list-ordered01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="heterog-list01">
+        <output-dir compare="Text">heterog-list01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="heterog-list02">
+        <output-dir compare="Text">heterog-list02</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="heterog-list03">
+        <output-dir compare="Text">heterog-list03</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-01">
+        <output-dir compare="Text">open-closed-01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-12">
+        <output-dir compare="Text">open-closed-12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-14">
+        <output-dir compare="Text">open-closed-14</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-issue134">
+        <output-dir compare="Text">query-issue134</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-issue55">
+        <output-dir compare="Text">query-issue55</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-issue55-1">
+        <output-dir compare="Text">query-issue55-1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-issue166">
+        <output-dir compare="Text">query-issue166</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-issue208">
+        <output-dir compare="Text">query-issue208</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-issue236">
+       <output-dir compare="Text">query-issue236</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-15">
+        <output-dir compare="Text">open-closed-15</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-16">
+        <output-dir compare="Text">open-closed-16</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-17">
+        <output-dir compare="Text">open-closed-17</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-19">
+        <output-dir compare="Text">open-closed-19</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-20">
+        <output-dir compare="Text">open-closed-20</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-21">
+        <output-dir compare="Text">open-closed-21</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-22">
+        <output-dir compare="Text">open-closed-22</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-24">
+        <output-dir compare="Text">open-closed-24</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-25">
+        <output-dir compare="Text">open-closed-25</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-26">
+        <output-dir compare="Text">open-closed-26</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-28">
+        <output-dir compare="Text">open-closed-28</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-29">
+        <output-dir compare="Text">open-closed-29</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-30">
+        <output-dir compare="Text">open-closed-30</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-31">
+        <output-dir compare="Text">open-closed-31</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-32">
+        <output-dir compare="Text">open-closed-32</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="open-closed-33">
+        <output-dir compare="Text">open-closed-33</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-proposal02">
+        <output-dir compare="Text">query-proposal02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="open-closed">
+      <compilation-unit name="query-proposal">
+        <output-dir compare="Text">query-proposal</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="quantifiers">
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="everysat_01">
+        <output-dir compare="Text">everysat_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="everysat_02">
+        <output-dir compare="Text">everysat_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="everysat_03">
+        <output-dir compare="Text">everysat_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="everysat_04">
+        <output-dir compare="Text">everysat_04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="somesat_01">
+        <output-dir compare="Text">somesat_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="somesat_02">
+        <output-dir compare="Text">somesat_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="somesat_03">
+        <output-dir compare="Text">somesat_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="somesat_04">
+        <output-dir compare="Text">somesat_04</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="somesat_05">
+        <output-dir compare="Text">somesat_05</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="quantifiers">
+      <compilation-unit name="somesat_06">
+        <output-dir compare="Text">somesat_06</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="records">
+    <test-case FilePath="records">
+      <compilation-unit name="closed-record-constructor_01">
+        <output-dir compare="Text">closed-record-constructor_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="closed-record-constructor_02">
+        <output-dir compare="Text">closed-record-constructor_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="closed-record-constructor_03">
+        <output-dir compare="Text">closed-record-constructor_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="expFieldName">
+        <output-dir compare="Text">expFieldName</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="field-access-by-index_01">
+        <output-dir compare="Text">field-access-by-index_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="field-access-on-open-field">
+        <output-dir compare="Text">field-access-on-open-field</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="open-record-constructor_01">
+        <output-dir compare="Text">open-record-constructor_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="open-record-constructor_02">
+        <output-dir compare="Text">open-record-constructor_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="closed-closed-fieldname-conflict_issue173">
+        <output-dir compare="Text">closed-closed-fieldname-conflict_issue173</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+  <test-case FilePath="records">
+      <compilation-unit name="open-closed-fieldname-conflict_issue173">
+        <output-dir compare="Text">open-closed-fieldname-conflict_issue173</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="records">
+      <compilation-unit name="open-open-fieldname-conflict_issue173">
+        <output-dir compare="Text">open-open-fieldname-conflict_issue173</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="scan">
+    <test-case FilePath="scan">
+      <compilation-unit name="10">
+        <output-dir compare="Text">10</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="20">
+        <output-dir compare="Text">20</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="issue238_query_1">
+        <output-dir compare="Text">issue238_query_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="issue238_query_2">
+        <output-dir compare="Text">issue238_query_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="invalid-scan-syntax">
+        <output-dir compare="Text">invalid-scan-syntax</output-dir>
+        <expected-error>SyntaxError</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="30">
+        <output-dir compare="Text">30</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="alltypes_01">
+        <output-dir compare="Text">alltypes_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="alltypes_02">
+        <output-dir compare="Text">alltypes_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="numeric_types_01">
+        <output-dir compare="Text">numeric_types_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="scan">
+      <compilation-unit name="spatial_types_01">
+        <output-dir compare="Text">spatial_types_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="scan">
+      <compilation-unit name="spatial_types_02">
+        <output-dir compare="Text">spatial_types_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="scan">
+      <compilation-unit name="temp_types_01">
+        <output-dir compare="Text">temp_types_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="scan">
+      <compilation-unit name="temp_types_02">
+        <output-dir compare="Text">temp_types_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+  </test-group>
+  <test-group name="semistructured">
+    <test-case FilePath="semistructured">
+      <compilation-unit name="count-nullable">
+        <output-dir compare="Text">count-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="semistructured">
+      <compilation-unit name="cust-filter">
+        <output-dir compare="Text">cust-filter</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="semistructured">
+      <compilation-unit name="has-param1">
+        <output-dir compare="Text">has-param1</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="similarity">
+    <test-case FilePath="similarity">
+      <compilation-unit name="edit-distance-check_ints">
+        <output-dir compare="Text">edit-distance-check_ints</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="edit-distance-check_strings">
+        <output-dir compare="Text">edit-distance-check_strings</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="edit-distance-list-is-filterable">
+        <output-dir compare="Text">edit-distance-list-is-filterable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="edit-distance-string-is-filterable">
+        <output-dir compare="Text">edit-distance-string-is-filterable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="edit-distance_ints">
+        <output-dir compare="Text">edit-distance_ints</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="edit-distance_strings">
+        <output-dir compare="Text">edit-distance_strings</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="fuzzyeq-edit-distance">
+        <output-dir compare="Text">fuzzyeq-edit-distance</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="fuzzyeq-similarity-jaccard">
+        <output-dir compare="Text">fuzzyeq-similarity-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="prefix-len-jaccard">
+        <output-dir compare="Text">prefix-len-jaccard</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-check_ints">
+        <output-dir compare="Text">similarity-jaccard-check_ints</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-check_query">
+        <output-dir compare="Text">similarity-jaccard-check_query</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-check_strings">
+        <output-dir compare="Text">similarity-jaccard-check_strings</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-prefix-check">
+        <output-dir compare="Text">similarity-jaccard-prefix-check</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-prefix">
+        <output-dir compare="Text">similarity-jaccard-prefix</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-sorted-check_ints">
+        <output-dir compare="Text">similarity-jaccard-sorted-check_ints</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-sorted-check_query">
+        <output-dir compare="Text">similarity-jaccard-sorted-check_query</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-sorted-check_strings">
+        <output-dir compare="Text">similarity-jaccard-sorted-check_strings</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-sorted_ints">
+        <output-dir compare="Text">similarity-jaccard-sorted_ints</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-sorted_query">
+        <output-dir compare="Text">similarity-jaccard-sorted_query</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard-sorted_strings">
+        <output-dir compare="Text">similarity-jaccard-sorted_strings</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard_ints">
+        <output-dir compare="Text">similarity-jaccard_ints</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard_query">
+        <output-dir compare="Text">similarity-jaccard_query</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="similarity">
+      <compilation-unit name="similarity-jaccard_strings">
+        <output-dir compare="Text">similarity-jaccard_strings</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="spatial">
+    <test-case FilePath="spatial">
+      <compilation-unit name="cell-aggregation-with-filtering">
+        <output-dir compare="Text">cell-aggregation-with-filtering</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="cell-aggregation">
+        <output-dir compare="Text">cell-aggregation</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="circle_accessor">
+        <output-dir compare="Text">circle_accessor</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="circle-intersect-circle">
+        <output-dir compare="Text">circle-intersect-circle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="create-rtree-index">
+        <output-dir compare="Text">create-rtree-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="distance-between-points">
+        <output-dir compare="Text">distance-between-points</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="line_accessor">
+        <output-dir compare="Text">line_accessor</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="line-intersect-circle">
+        <output-dir compare="Text">line-intersect-circle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="line-intersect-line">
+        <output-dir compare="Text">line-intersect-line</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="line-intersect-polygon">
+        <output-dir compare="Text">line-intersect-polygon</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="line-intersect-rectangle">
+        <output-dir compare="Text">line-intersect-rectangle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="point_accessor">
+        <output-dir compare="Text">point_accessor</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="point-equals-point">
+        <output-dir compare="Text">point-equals-point</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="point-in-circle">
+        <output-dir compare="Text">point-in-circle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="point-in-polygon">
+        <output-dir compare="Text">point-in-polygon</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="point-in-rectangle">
+        <output-dir compare="Text">point-in-rectangle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="point-on-line">
+        <output-dir compare="Text">point-on-line</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="polygon_accessor">
+        <output-dir compare="Text">polygon_accessor</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="polygon-intersect-circle">
+        <output-dir compare="Text">polygon-intersect-circle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="polygon-intersect-polygon">
+        <output-dir compare="Text">polygon-intersect-polygon</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="polygon-intersect-rectangle">
+        <output-dir compare="Text">polygon-intersect-rectangle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="rectangle_accessor">
+        <output-dir compare="Text">rectangle_accessor</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="rectangle-intersect-circle">
+        <output-dir compare="Text">rectangle-intersect-circle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="rectangle-intersect-rectangle">
+        <output-dir compare="Text">rectangle-intersect-rectangle</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="spatial">
+      <compilation-unit name="spatial-area">
+        <output-dir compare="Text">spatial-area</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="string">
+    <test-case FilePath="string">
+      <compilation-unit name="codepoint-to-string1">
+        <output-dir compare="Text">codepoint-to-string1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="codepoint-to-string2">
+        <output-dir compare="Text">codepoint-to-string2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="concat_01">
+        <output-dir compare="Text">concat_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="concat_02">
+        <output-dir compare="Text">concat_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="contains_01">
+        <output-dir compare="Text">contains_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="cpttostr01">
+        <output-dir compare="Text">cpttostr01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="cpttostr02">
+        <output-dir compare="Text">cpttostr02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="cpttostr04">
+        <output-dir compare="Text">cpttostr04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="end-with1">
+        <output-dir compare="Text">end-with1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="end-with2">
+        <output-dir compare="Text">end-with2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="end-with3">
+        <output-dir compare="Text">end-with3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="end-with4">
+        <output-dir compare="Text">end-with4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="end-with5">
+        <output-dir compare="Text">end-with5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="ends-with_01">
+        <output-dir compare="Text">ends-with_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="endwith02">
+        <output-dir compare="Text">endwith02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="endwith03">
+        <output-dir compare="Text">endwith03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="length_01">
+        <output-dir compare="Text">length_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="length_02">
+        <output-dir compare="Text">length_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="like_01">
+        <output-dir compare="Text">like_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="like_null">
+        <output-dir compare="Text">like_null</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="lowercase">
+        <output-dir compare="Text">lowercase</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches02">
+        <output-dir compare="Text">matches02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches03">
+        <output-dir compare="Text">matches03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches04">
+        <output-dir compare="Text">matches04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches05">
+        <output-dir compare="Text">matches05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches06">
+        <output-dir compare="Text">matches06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches1">
+        <output-dir compare="Text">matches1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches11">
+        <output-dir compare="Text">matches11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches2">
+        <output-dir compare="Text">matches2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches21">
+        <output-dir compare="Text">matches21</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches22">
+        <output-dir compare="Text">matches22</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches23">
+        <output-dir compare="Text">matches23</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matches3">
+        <output-dir compare="Text">matches3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="matchesnull">
+        <output-dir compare="Text">matchesnull</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="replace1">
+        <output-dir compare="Text">replace1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="replace2">
+        <output-dir compare="Text">replace2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="replace21">
+        <output-dir compare="Text">replace21</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="replace22">
+        <output-dir compare="Text">replace22</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="replace3">
+        <output-dir compare="Text">replace3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="start-with1">
+        <output-dir compare="Text">start-with1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="start-with2">
+        <output-dir compare="Text">start-with2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="start-with3">
+        <output-dir compare="Text">start-with3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="start-with4">
+        <output-dir compare="Text">start-with4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="start-with5">
+        <output-dir compare="Text">start-with5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="starts-with_01">
+        <output-dir compare="Text">starts-with_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="startwith02">
+        <output-dir compare="Text">startwith02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="string">
+      <compilation-unit name="startwith03">
+        <output-dir compare="Text">startwith03</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="string">
+      <compilation-unit name="strconcat01">
+        <output-dir compare="Text">strconcat01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="strconcat02">
+        <output-dir compare="Text">strconcat02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-concat1">
+        <output-dir compare="Text">string-concat1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-equal1">
+        <output-dir compare="Text">string-equal1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-equal2">
+        <output-dir compare="Text">string-equal2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-equal3">
+        <output-dir compare="Text">string-equal3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-equal4">
+        <output-dir compare="Text">string-equal4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-join1">
+        <output-dir compare="Text">string-join1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-to-codepoint">
+        <output-dir compare="Text">string-to-codepoint</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="string-to-codepoint1">
+        <output-dir compare="Text">string-to-codepoint1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="strlen02">
+        <output-dir compare="Text">strlen02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="strlen03">
+        <output-dir compare="Text">strlen03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="strtocpt01">
+        <output-dir compare="Text">strtocpt01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="strtocpt02">
+        <output-dir compare="Text">strtocpt02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="strtocpt03">
+        <output-dir compare="Text">strtocpt03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substr01">
+        <output-dir compare="Text">substr01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!-- Issue no 219
+    <test-case FilePath="string">
+      <compilation-unit name="substr04">
+        <output-dir compare="Text">substr04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substr05">
+        <output-dir compare="Text">substr05</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="string">
+      <compilation-unit name="substr06">
+        <output-dir compare="Text">substr06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-after-1">
+        <output-dir compare="Text">substring-after-1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-after-2">
+        <output-dir compare="Text">substring-after-2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-after-3">
+        <output-dir compare="Text">substring-after-3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-after-4">
+        <output-dir compare="Text">substring-after-4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-before-1">
+        <output-dir compare="Text">substring-before-1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-before-2">
+        <output-dir compare="Text">substring-before-2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring-before-3">
+        <output-dir compare="Text">substring-before-3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring2-1">
+        <output-dir compare="Text">substring2-1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring2-2">
+        <output-dir compare="Text">substring2-2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring2-3">
+        <output-dir compare="Text">substring2-3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring2-4">
+        <output-dir compare="Text">substring2-4</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="substring_01">
+        <output-dir compare="Text">substring_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="toLowerCase02">
+        <output-dir compare="Text">toLowerCase02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="toLowerCase03">
+        <output-dir compare="Text">toLowerCase03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="string">
+      <compilation-unit name="toLowerCase04">
+        <output-dir compare="Text">toLowerCase04</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="subset-collection">
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="01">
+        <output-dir compare="Text">01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="02">
+        <output-dir compare="Text">02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="03">
+        <output-dir compare="Text">03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="04">
+        <output-dir compare="Text">04</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="05">
+        <output-dir compare="Text">05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="06">
+        <output-dir compare="Text">06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="subset-collection">
+      <compilation-unit name="07">
+        <output-dir compare="Text">07</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="tokenizers">
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="counthashed-gram-tokens_01">
+        <output-dir compare="Text">counthashed-gram-tokens_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="counthashed-gram-tokens_02">
+        <output-dir compare="Text">counthashed-gram-tokens_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="counthashed-word-tokens_01">
+        <output-dir compare="Text">counthashed-word-tokens_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="gram-tokens_01">
+        <output-dir compare="Text">gram-tokens_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="gram-tokens_02">
+        <output-dir compare="Text">gram-tokens_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="hashed-gram-tokens_01">
+        <output-dir compare="Text">hashed-gram-tokens_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="hashed-gram-tokens_02">
+        <output-dir compare="Text">hashed-gram-tokens_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="hashed-word-tokens_01">
+        <output-dir compare="Text">hashed-word-tokens_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="word-tokens_01">
+        <output-dir compare="Text">word-tokens_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tokenizers">
+      <compilation-unit name="word-tokens_02">
+        <output-dir compare="Text">word-tokens_02</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="tpch">
+    <test-case FilePath="tpch">
+      <compilation-unit name="distinct_by">
+        <output-dir compare="Text">distinct_by</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="group_no_agg">
+        <output-dir compare="Text">group_no_agg</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q10_returned_item">
+        <output-dir compare="Text">q10_returned_item</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q10_returned_item_int64">
+	<output-dir compare="Text">q10_returned_item_int64</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q11_important_stock">
+        <output-dir compare="Text">q11_important_stock</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q12_shipping">
+        <output-dir compare="Text">q12_shipping</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q13_customer_distribution">
+        <output-dir compare="Text">q13_customer_distribution</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q14_promotion_effect">
+        <output-dir compare="Text">q14_promotion_effect</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q15_top_supplier">
+        <output-dir compare="Text">q15_top_supplier</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q16_parts_supplier_relationship">
+        <output-dir compare="Text">q16_parts_supplier_relationship</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q17_small_quantity_order_revenue">
+        <output-dir compare="Text">q17_small_quantity_order_revenue</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q18_large_volume_customer">
+        <output-dir compare="Text">q18_large_volume_customer</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q19_discounted_revenue">
+        <output-dir compare="Text">q19_discounted_revenue</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q1_pricing_summary_report_nt">
+        <output-dir compare="Text">q1_pricing_summary_report_nt</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q20_potential_part_promotion">
+        <output-dir compare="Text">q20_potential_part_promotion</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q21_suppliers_who_kept_orders_waiting">
+        <output-dir compare="Text">q21_suppliers_who_kept_orders_waiting</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q22_global_sales_opportunity">
+        <output-dir compare="Text">q22_global_sales_opportunity</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q2_minimum_cost_supplier">
+        <output-dir compare="Text">q2_minimum_cost_supplier</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q3_shipping_priority_nt">
+        <output-dir compare="Text">q3_shipping_priority_nt</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q4_order_priority">
+        <output-dir compare="Text">q4_order_priority</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q5_local_supplier_volume">
+        <output-dir compare="Text">q5_local_supplier_volume</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q6_forecast_revenue_change">
+        <output-dir compare="Text">q6_forecast_revenue_change</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q7_volume_shipping">
+        <output-dir compare="Text">q7_volume_shipping</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q8_national_market_share">
+        <output-dir compare="Text">q8_national_market_share</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="tpch">
+      <compilation-unit name="q9_product_type_profit_nt">
+        <output-dir compare="Text">q9_product_type_profit_nt</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="writers">
+    <test-case FilePath="writers">
+      <compilation-unit name="print_01">
+        <output-dir compare="Text">print_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="writers">
+      <compilation-unit name="serialized_01">
+        <output-dir compare="Text">serialized_01</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="cross-dataverse">
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv01">
+        <output-dir compare="Text">cross-dv01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv02">
+        <output-dir compare="Text">cross-dv02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv03">
+        <output-dir compare="Text">cross-dv03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv04">
+        <output-dir compare="Text">cross-dv04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv07">
+        <output-dir compare="Text">cross-dv07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!--NotImplementedException: No binary comparator factory implemented for type RECORD. 
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv08">
+        <output-dir compare="Text">cross-dv08</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv09">
+        <output-dir compare="Text">cross-dv09</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv11">
+        <output-dir compare="Text">cross-dv11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv12">
+        <output-dir compare="Text">cross-dv12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv13">
+        <output-dir compare="Text">cross-dv13</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv14">
+        <output-dir compare="Text">cross-dv14</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv15">
+        <output-dir compare="Text">cross-dv15</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv16">
+        <output-dir compare="Text">cross-dv16</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <!--NotImplementedException: No binary comparator factory implemented for type RECORD. 
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv17">
+        <output-dir compare="Text">cross-dv17</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!--NotImplementedException: No binary comparator factory implemented for type RECORD.
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv18">
+        <output-dir compare="Text">cross-dv18</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv19">
+        <output-dir compare="Text">cross-dv19</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="cross-dv20">
+        <output-dir compare="Text">cross-dv20</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="insert_across_dataverses">
+        <output-dir compare="Text">insert_across_dataverses</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="cross-dataverse">
+      <compilation-unit name="join_across_dataverses">
+        <output-dir compare="Text">join_across_dataverses</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="user-defined-functions">
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="query-issue201">
+        <output-dir compare="Text">query-issue201</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf01">
+        <output-dir compare="Text">udf01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf02">
+        <output-dir compare="Text">udf02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!-- causes NPE: Issue 200
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf03">
+        <output-dir compare="Text">udf03</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf04">
+        <output-dir compare="Text">udf04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf05">
+        <output-dir compare="Text">udf05</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf06">
+        <output-dir compare="Text">udf06</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf07">
+        <output-dir compare="Text">udf07</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf08">
+        <output-dir compare="Text">udf08</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf09">
+        <output-dir compare="Text">udf09</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf10">
+        <output-dir compare="Text">udf10</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf11">
+        <output-dir compare="Text">udf11</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf12">
+        <output-dir compare="Text">udf12</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf13">
+        <output-dir compare="Text">udf13</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf14">
+        <output-dir compare="Text">udf14</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!-- Issue 166
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf15">
+        <output-dir compare="Text">udf15</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf16">
+        <output-dir compare="Text">udf16</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf17">
+        <output-dir compare="Text">udf17</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf18">
+        <output-dir compare="Text">udf18</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf19">
+        <output-dir compare="Text">udf19</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf20">
+        <output-dir compare="Text">udf20</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf21">
+        <output-dir compare="Text">udf21</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf22">
+        <output-dir compare="Text">udf22</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf23">
+        <output-dir compare="Text">udf23</output-dir>
+      </compilation-unit>
+    </test-case>
+    <!-- Issue 195
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf24">
+        <output-dir compare="Text">udf24</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <!-- Issue 218
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf25">
+        <output-dir compare="Text">udf25</output-dir>
+      </compilation-unit>
+    </test-case>
+    -->
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf26">
+        <output-dir compare="Text">udf26</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="udf27">
+        <output-dir compare="Text">udf27</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="user-defined-functions">
+      <compilation-unit name="f01">
+        <output-dir compare="Text">f01</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error> 
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="load">
+    <test-case FilePath="load">
+      <compilation-unit name="issue14_query">
+        <output-dir compare="Text">none</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error> 
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="hints">
+    <test-case FilePath="hints">
+      <compilation-unit name="issue_251_dataset_hint_5">
+        <output-dir compare="Text">issue_251_dataset_hint_5</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="hints">
+      <compilation-unit name="issue_251_dataset_hint_6">
+        <output-dir compare="Text">issue_251_dataset_hint_6</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="hints">
+      <compilation-unit name="issue_251_dataset_hint_7">
+        <output-dir compare="Text">issue_251_dataset_hint_7</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="feeds">
+    <test-case FilePath="feeds">
+      <compilation-unit name="feeds_01">
+        <output-dir compare="Text">feeds_01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="feeds">
+      <compilation-unit name="feeds_02">
+        <output-dir compare="Text">feeds_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="feeds">
+      <compilation-unit name="feeds_03">
+        <output-dir compare="Text">feeds_03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="feeds">
+      <compilation-unit name="feeds_04">
+        <output-dir compare="Text">feeds_04</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="feeds">
+      <compilation-unit name="issue_230_feeds">
+        <output-dir compare="Text">issue_230_feeds</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="hdfs">
+    <test-case FilePath="hdfs">
+      <compilation-unit name="issue_245_hdfs">
+        <output-dir compare="Text">issue_245_hdfs</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="hdfs">
+      <compilation-unit name="hdfs_02">
+        <output-dir compare="Text">hdfs_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="hdfs">
+      <compilation-unit name="hdfs_03">
+        <output-dir compare="Text">hdfs_03</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
 </test-suite>
+
diff --git a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
index bc4e5f1..a92b617 100644
--- a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
+++ b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
@@ -76,6 +76,7 @@
         path = new File(path, cUnit.getOutputDir().getValue());
 
         String fileNames[] = path.list();
+        System.out.println("Path: " + path.toString());
         for (String fName : fileNames) {
             File testFile = new File(path, fName);
             TestFileContext tfsc = new TestFileContext(testFile);