Merge branch 'master' into jimahn/master_issue536
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
index f25fd7d..fb8becc 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
@@ -729,8 +729,8 @@
             IAObject obj = constVal.getObject();
             type = obj.getType();
             typeTag = type.getTypeTag();
-            if (typeTag != ATypeTag.ORDEREDLIST && typeTag != ATypeTag.STRING) {
-                throw new AlgebricksException("Only ordered lists and string types supported.");
+            if (typeTag != ATypeTag.ORDEREDLIST && typeTag != ATypeTag.STRING && typeTag != ATypeTag.UNORDEREDLIST) {
+                throw new AlgebricksException("Only ordered lists, string, and unordered lists types supported.");
             }
         }
         jobGenParams.setSearchKeyType(typeTag);
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
index 4ac02c8..4a5c1df7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
@@ -33,5 +33,5 @@
 set simthreshold '0.8f';
 
 for $c in dataset('Customers')
-where $c.interests ~= ["databases", "computers", "wine"]
+where $c.interests ~= {{"databases", "computers", "wine"}}
 return $c
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
index 80e8aef..80766ae 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
@@ -30,5 +30,5 @@
 write output to nc1:"rttest/inverted-index-basic_ulist-jaccard.adm";
 
 for $c in dataset('Customers')
-where similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)[0]
+where similarity-jaccard-check($c.interests, {{"databases", "computers", "wine"}}, 0.7f)[0]
 return $c
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
index 588ca14..b67bab4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
@@ -30,5 +30,5 @@
 write output to nc1:"rttest/inverted-index-basic_ulist-jaccard.adm";
 
 for $c in dataset('Customers')
-where similarity-jaccard($c.interests, ["databases", "computers", "wine"]) >= 0.7f
+where similarity-jaccard($c.interests, {{"databases", "computers", "wine"}}) >= 0.7f
 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.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 b2dc701..dfc0f4e 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,3 +1,5 @@
+drop dataverse test if exists;
+create dataverse test;
 use dataverse test;
 
 create type AddressType as closed {
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.4.query.aql
index 27a838ba..257c79d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard/inverted-index-ulist-jaccard.4.query.aql
@@ -1,6 +1,6 @@
 use dataverse test;
 
 for $c in dataset('Customers')
-let $jacc := similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)
+let $jacc := similarity-jaccard-check($c.interests, {{"databases", "computers", "wine"}}, 0.7f)
 where $jacc[0]
 return $c