Fix open field CREATE INDEX syntax (AQL and SQLPP).

Our CREATE INDEX syntax for open fields didn't match our semantics.
Our semantics allow to-be-indexed open field(s) to be MISSING.
We don't support (or offer :-)) tighter semantics than that.
Our syntax didn't require creators to say this, but now it does:
  Old: CREATE INDEX myIdx on MyDSet(myTime: datetime) ENFORCED;
  New: CREATE INDEX myIdx on MyDSet(myTime: datetime?) ENFORCED;
Have now addressed all of  Till's comments (I think).

Change-Id: I32bf8bc5ac1c0e6aa6744ca8f91a197311219814
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1106
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql
index a64569f..cd0c11a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql
@@ -31,6 +31,6 @@
 
 create dataset testdv.t1(testtype) primary key id;
 
-create index idx1 on testdv.t1(name: string) enforced;
+create index idx1 on testdv.t1(name: string?) enforced;
 
 /* drop index testdv.t1.idx1; */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql
index 0f92326..4205378 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql
@@ -32,4 +32,4 @@
 
 create dataset testdv.t1(testtype) primary key id;
 
-create index idx1 on testdv.t1(location: point) type rtree enforced;
+create index idx1 on testdv.t1(location: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql
index 7ae4adb..2d6b3c0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql
@@ -31,4 +31,4 @@
 
 create dataset testdv.t1(testtype) primary key id;
 
-create index idx1 on testdv.t1(name: string) type btree enforced;
+create index idx1 on testdv.t1(name: string?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-lojoin_with_meta-1.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-lojoin_with_meta-1.aql
index 788db55..4107ad2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-lojoin_with_meta-1.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-lojoin_with_meta-1.aql
@@ -33,9 +33,9 @@
 primary key meta().id;
 
 create index NumIndex1 on Book(meta().num);
-create index NumIndex2 on Book(linenum:int32) enforced;
-create index NumIndex3 on Book(count1:int32) enforced;
-create index NumIndex4 on Book(count2:int32) enforced;
+create index NumIndex2 on Book(linenum:int32?) enforced;
+create index NumIndex3 on Book(count1:int32?) enforced;
+create index NumIndex4 on Book(count2:int32?) enforced;
 
 for $t1 in dataset Book
 where $t1.linenum < 10
@@ -48,4 +48,4 @@
           order by $t2.linenum
           return {"linenum2": $t2.linenum,
                   "count2":$t2.count2}
-};
\ No newline at end of file
+};
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-1.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-1.aql
index 447c25c..1dc3b44 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-1.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-1.aql
@@ -32,9 +32,9 @@
 create dataset Book(LineType) with meta(AuxiliaryType)
 primary key meta().id;
 
-create index NumIndex on Book(lineid:int64) enforced;
+create index NumIndex on Book(lineid:int64?) enforced;
 
 for $x in dataset Book
 for $y in dataset Book
 where $x.lineid /*+ indexnl */ = $y.lineid
-return {"authx":$x.author,"authy":$y.author};
\ No newline at end of file
+return {"authx":$x.author,"authy":$y.author};
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-2.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-2.aql
index 1545f33..09ffd0a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-2.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index-nljoin_with_meta-2.aql
@@ -38,9 +38,9 @@
 create dataset Book2(LineTypeWithNum) with meta(AuxiliaryType)
 primary key meta().id;
 
-create index NumIndex on Book1(lineid:int64) enforced;
+create index NumIndex on Book1(lineid:int64?) enforced;
 
 for $y in dataset Book2
 for $x in dataset Book1
 where $y.lineid  /*+ indexnl */=  $x.lineid
-return {"authx":$x.author,"authy":$y.author};
\ No newline at end of file
+return {"authx":$x.author,"authy":$y.author};
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index_with_meta-2.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index_with_meta-2.aql
index 7f13ac3..b570498 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index_with_meta-2.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/meta/secondary_index_with_meta-2.aql
@@ -32,7 +32,7 @@
 create dataset Book(LineType) with meta(AuxiliaryType)
 primary key meta().id;
 
-create index NumIndex on Book(lineid:int64) enforced;
+create index NumIndex on Book(lineid:int64?) enforced;
 
 for $x in dataset Book
 where $x.lineid >10
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_01.aql
index b5f36e7..1812b3b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData1' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_02.aql
index 76eb7c9..bed6626 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData2' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData2' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_03.aql
index 5d0b806..e991ee8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-index/rtree-index-join/spatial-intersect-point_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Self-joins a dataset on the intersection of its point attribute.
- *                  The dataset has an enforced open RTree index, and we expect the
+ *                  The dataset has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/disjunction-to-join.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/disjunction-to-join.aql
index f72b875..707ba4d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/disjunction-to-join.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/disjunction-to-join.aql
@@ -37,7 +37,7 @@
 
 
 create dataset TestSet(TestType) primary key "id";
-create index TestSetIndex on TestSet(nested.idx: string) enforced;
+create index TestSetIndex on TestSet(nested.idx: string?) enforced;
 
 for $x in dataset TestSet 
 where $x.nested.idx = "one" or $x.nested.idx = "two"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql
index 7991694..20d8a7c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql
@@ -53,7 +53,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index msgCountBIx on TweetMessages(nested.countB: int32) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql
index 81746b9..84d653f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql
@@ -52,8 +52,8 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index msgCountAIx on TweetMessages(nested.countA: int32) type btree enforced;
-create index msgCountBIx on TweetMessages(nested.countB: int32) type btree enforced;
+create index msgCountAIx on TweetMessages(nested.countA: int32?) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql
index d23c8fa..8cc857b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql
@@ -53,7 +53,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index msgCountBIx on TweetMessages(nested.countB: int32) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql
index f58b102..7b7cb85 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql
@@ -52,8 +52,8 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index msgCountAIx on TweetMessages(nested.countA: int32) type btree enforced;
-create index msgCountBIx on TweetMessages(nested.countB: int32) type btree enforced;
+create index msgCountAIx on TweetMessages(nested.countA: int32?) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_01.aql
index ad3769c..6792ae4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_01.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_02.aql
index 5d8db16..a4a2dbd 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_02.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_03.aql
index f33a1d0..6a1e4e9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-join_03.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.aql
index e0db31b..c92b4e5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.aql
index 7fdd838..064abc8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.aql
index e1dfd2c..ec9520c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.aql
index 01ce4ce..0370ad9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.aql
index a1e2581..4911f67 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_05.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.aql
index 4765190..67a8e12 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.aql
@@ -36,7 +36,7 @@
 }
 
 create dataset Names(NameType) primary key nested.id;
-create index Name_idx on Names(nested.fname: string,lnested.name: string) enforced;
+create index Name_idx on Names(nested.fname: string?,lnested.name: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_06.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multiindex.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multiindex.aql
index bcaaf61..4c2e45c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multiindex.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multiindex.aql
@@ -69,7 +69,7 @@
 create dataset FacebookMessages(FacebookMessageType)
 primary key nested.message-id;
 
-create index fbmIdxAutId if not exists on FacebookMessages(nested.author-id-copy: int32) enforced;
+create index fbmIdxAutId if not exists on FacebookMessages(nested.author-id-copy: int32?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multiindex.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multipred.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multipred.aql
index b4e7e78..c46530c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multipred.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join-multipred.aql
@@ -56,7 +56,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index title_index on DBLP(nested.title:string) enforced;
+create index title_index on DBLP(nested.title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multipred.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_01.aql
index fca3294..1306f66 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_01.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index title_index on DBLP(nested.title: string) enforced;
+create index title_index on DBLP(nested.title: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_02.aql
index 3706a38..bf3fdb3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_02.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index title_index on CSX(nested.title: string) enforced;
+create index title_index on CSX(nested.title: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_03.aql
index ebf2a45..6447343 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_03.aql
@@ -53,9 +53,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index title_index_DBLP on DBLP(nested.title: string) enforced;
+create index title_index_DBLP on DBLP(nested.title: string?) enforced;
 
-create index title_index_CSX on CSX(nested.title: string) enforced;
+create index title_index_CSX on CSX(nested.title: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_04.aql
index bccab0d..5b77bb4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_04.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index title_index on DBLP(nested.title: string) enforced;
+create index title_index on DBLP(nested.title: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_05.aql
index 88dd85a..83ed7b0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index-join/secondary-equi-join_05.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index title_index on DBLP(nested.title: string) enforced;
+create index title_index on DBLP(nested.title: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_05.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-33.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-33.aql
index e0d0c21..a73ec15 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-33.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-33.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string,nested.lname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?,nested.lname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Roger"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-34.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-34.aql
index 4da27c0..351b6f3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-34.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-34.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Susan"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-35.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-35.aql
index 5733c4d..d20add6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-35.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-35.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname < "Isa"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-36.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-36.aql
index 75e3002..447d73a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-36.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-36.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname <= "Vanpatten"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-37.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-37.aql
index 65e07c9..9ca4ae4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-37.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-37.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname != "Max"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-38.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-38.aql
index 19b9cea..2ace4f2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-38.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-38.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname = "Julio"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-39.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-39.aql
index bb57176..a183169 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-39.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-39.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.lname = "Kim"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-40.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-40.aql
index 2371e31..78e672d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-40.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-40.aql
@@ -39,7 +39,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname = "Young Seok" and $emp.nested.lname = "Kim"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-41.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-41.aql
index 3d2ac68..bc4c70e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-41.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-41.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname = "Julio" or $emp.nested.lname = "Malaika"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-42.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-42.aql
index be31e8f..47c86fd 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-42.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-42.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Alex" and $emp.nested.lname < "Zach"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-43.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-43.aql
index e1cdd77..8b0d920 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-43.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-43.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Allan" and $emp.nested.lname < "Zubi"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-44.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-44.aql
index c2abe05..c5a2ed6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-44.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-44.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Allan" and $emp.nested.lname = "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-45.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-45.aql
index 427e2ca..68fe56c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-45.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-45.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname = "Julio" and $emp.nested.lname < "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-46.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-46.aql
index a55c438..bd52b20 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-46.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-46.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Michael" and $emp.nested.lname <= "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-47.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-47.aql
index a216edb..d611ab5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-47.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-47.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Craig" and $emp.nested.lname > "Kevin" and $emp.nested.fname < "Mary" and $emp.nested.lname < "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-48.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-48.aql
index 1cdf5e6..2e95662 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-48.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-48.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Craig" and $emp.nested.lname >= "Kevin" and $emp.nested.fname <= "Mary" and $emp.nested.lname <= "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-49.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-49.aql
index f92d499..49ebe6e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-49.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-49.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname <= "Craig" and $emp.nested.lname > "Kevin"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-50.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-50.aql
index c69aa20..0aa3e55 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-50.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-50.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname != "Michael" and $emp.nested.lname != "Carey"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-51.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-51.aql
index fa5fc2a..1beb7a1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-51.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-51.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Craig" and $emp.nested.lname > "Kevin" and $emp.nested.fname <= "Mary" and $emp.nested.lname <= "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-52.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-52.aql
index d90feea..a923d50 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-52.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-52.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Craig" and $emp.nested.lname >= "Kevin" and $emp.nested.fname < "Mary" and $emp.nested.lname < "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-53.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-53.aql
index 94b9e8a..d688ca0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-53.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-53.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname:string,nested.lname:string) enforced;
+create index sec_Idx on testdst(nested.fname:string?,nested.lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Craig" and $emp.nested.lname <= "Kevin" and $emp.nested.fname <= "Mary" and $emp.nested.lname >= "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-54.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-54.aql
index bc5bf26..ec20642 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-54.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-54.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Max"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-55.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-55.aql
index 2d1631b..f06f66b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-55.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-55.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Sofia"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-56.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-56.aql
index 66eea91..7767eae 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-56.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-56.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname < "Chen"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-57.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-57.aql
index 706e382..ad37e48 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-57.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-57.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname <= "Julio"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-58.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-58.aql
index 9963a02..54d5620 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-58.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-58.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Neil" and $emp.nested.fname < "Roger"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-59.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-59.aql
index d30562d..31de2dc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-59.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-59.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname >= "Max" and $emp.nested.fname <= "Roger"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-60.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-60.aql
index 842bb8a..90ac78d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-60.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-60.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname = "Max"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-61.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-61.aql
index 81035ef..468ff65 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-61.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-61.aql
@@ -40,7 +40,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string,nested.lname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?,nested.lname: string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.nested.fname > "Craig" and $emp.nested.lname > "Kevin" and $emp.nested.fname <= "Mary" and $emp.nested.lname < "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-62.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-62.aql
index e65d5e1..9d4747a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-62.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-62.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string,nested.lname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?,nested.lname: string?) enforced;
 
 for $emp in dataset('testdst') 
 where $emp.nested.fname = "Julio" and $emp.nested.lname > "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-63.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-63.aql
index a29c26d..3d7f09d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-63.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/btree-index/btree-secondary-63.aql
@@ -42,7 +42,7 @@
 
 create dataset testdst(TestType) primary key nested.id;
 
-create index sec_Idx on testdst(nested.fname: string,nested.lname: string) enforced;
+create index sec_Idx on testdst(nested.fname: string?,nested.lname: string?) enforced;
 
 for $emp in dataset('testdst') 
 where $emp.nested.fname < "Julio" and $emp.nested.lname = "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains-panic.aql
index b6cb204..5deef93 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains-panic.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains.aql
index 50ccf7d..91dea54 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-contains.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.aql
index 88c4f54..a777e3b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check.aql
index 8038d49..601b5d4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-check.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.aql
index 5d1f6d0..7955abb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance.aql
index e70bcaf..98aca8b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-edit-distance.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
index a21cfd9..c73d0cf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-edit-distance.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
index f91ef84..02740e0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard-check.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard-check.aql
index 4df7adb..36a1ecf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard-check.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard-check.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard-check.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard.aql
index 2bb5114..5c3ec7e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/ngram-jaccard.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-contains.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-contains.aql
index 81ce645..229ee52 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-contains.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-contains.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-contains.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.aql
index 927926d..3dd9b51 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-fuzzyeq-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard-check.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard-check.aql
index 32b4f11..f5d9a78 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard-check.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard-check.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard-check.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard.aql
index 1445e51..fafbf71 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-basic/word-jaccard.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
index 27ed5e0..71381ee 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
@@ -41,7 +41,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
index 71008d8..cf14fd7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
@@ -41,7 +41,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
index 74a7443..d34e8b4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.aql
index 2168991..b54f365 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.aql
index e97d651..7fd8079 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-substring.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql
index 7f9767f..f839c2e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-word-tokens.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.aql
index 4a6692c..8c70a1c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.aql
@@ -41,7 +41,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.aql
index 8a67454..cfa6247 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.aql
@@ -41,7 +41,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-multi-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-let.aql
index 5c21b49..82b1cd5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-let.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.aql
index 28027e8..26b42ed 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-multi-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql
index 47bc358..d24c284 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql
@@ -53,7 +53,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index msgNgramIx on TweetMessages(nested.message-text: string) type ngram(3) enforced;
+create index msgNgramIx on TweetMessages(nested.message-text: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_leftouterjoin-probe-pidx-with-join-edit-distance-check_idx_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_01.aql
index 30b7078..38bbdb3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_01.aql
@@ -44,7 +44,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_02.aql
index 7f48b7a..577d415 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_02.aql
@@ -44,7 +44,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(title: string) type ngram(3) enforced;
+create index ngram_index on CSX(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_03.aql
index c4f255b..5721955 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_03.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_04.aql
index cb552fd..b4daaa8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-contains_04.aql
@@ -43,9 +43,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(title: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(title: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.aql
index ae3f431..f7a6eb5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.aql
index b916550..5fc32d5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.aql
index 935a609..9758b48 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.aql
index 18b4bde..3291f52 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.aql
@@ -52,9 +52,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index_DBLP on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(nested.authors: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.aql
index 74ba6ff..e1eb262 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.aql
@@ -52,7 +52,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-contains.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-contains.aql
index 62a20f5..2d3f392 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-contains.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-contains.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-contains.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-inline.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-inline.aql
index acefe72..b7ffdd4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-inline.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance-inline.aql
@@ -41,7 +41,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_01.aql
index c7e0b7e..b6546e7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_01.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_02.aql
index cd8dc85..4d1010a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_02.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_03.aql
index b03b019..eb55bb1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_03.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_04.aql
index c0aabd5..e546740 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_04.aql
@@ -52,9 +52,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index_DBLP on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(nested.authors: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_05.aql
index e658e24..5e2f4c0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-edit-distance_05.aql
@@ -52,7 +52,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
index fba60ad..081f022 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
index e89dd53..2ba5e18 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
index 424d186..cd29e65 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql
index 5ec9368..830fb8e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql
@@ -52,9 +52,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index_DBLP on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(nested.authors: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql
index dcdac82..8fb8287 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql
@@ -52,7 +52,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
index 8cf3373..24dab1c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
index 2de6fb3..2f7c560 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.title: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
index 2a3eb8f..5e12569 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql
index 757dcd3..cc2f6cc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql
@@ -53,9 +53,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index_DBLP on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(nested.title: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(nested.title: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_01.aql
index f26b0e9..da4d914 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_01.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_02.aql
index 2a834ce..5576768 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_02.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.title: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_03.aql
index 498d925..32829fb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_03.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_04.aql
index 224a7d5..dc4c210 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-check_04.aql
@@ -53,9 +53,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index_DBLP on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(nested.title: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(nested.title: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-inline.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-inline.aql
index 92346dc..bd599b4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-inline.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard-inline.aql
@@ -42,7 +42,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_01.aql
index 14cb1ff..0106176 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_01.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_02.aql
index e85c997..e9f491b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_02.aql
@@ -54,7 +54,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index on CSX(nested.title: string) type ngram(3) enforced;
+create index ngram_index on CSX(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_03.aql
index bfc9b3b..e064c03 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_03.aql
@@ -40,7 +40,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_04.aql
index 2b67ebf..b08eabf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/ngram-jaccard_04.aql
@@ -53,9 +53,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index ngram_index_DBLP on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(nested.title: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(nested.title: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(nested.title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.aql
index 37ee1b4..287b338 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.aql
index 7939ca2..e19b4af 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on CSX(nested.title: string) type keyword enforced;
+create index keyword_index on CSX(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.aql
index eb4c84c..5fd64c9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.aql
@@ -38,7 +38,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.aql
index adbca83..cad00d1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.aql
@@ -52,9 +52,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index_DBLP on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index_DBLP on DBLP(nested.title: string?) type keyword enforced;
 
-create index keyword_index_CSX on CSX(nested.title: string) type keyword enforced;
+create index keyword_index_CSX on CSX(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.aql
index c09ca89..9ef8bb2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.aql
@@ -57,7 +57,7 @@
 create index twmSndLocIx on TweetMessages(nested.sender-location) type rtree;
 create index msgCountAIx on TweetMessages(nested.countA) type btree;
 create index msgCountBIx on TweetMessages(nested.countB) type btree;
-create index msgTextIx on TweetMessages(nested.message-text: string) type keyword enforced;
+create index msgTextIx on TweetMessages(nested.message-text: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check-after-btree-access.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_01.aql
index 8bca7b3..682a754 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_01.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_02.aql
index 803d4db..583dda6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_02.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on CSX(nested.title: string) type keyword enforced;
+create index keyword_index on CSX(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_03.aql
index 54f6065..2cff649 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_03.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index_DBLP on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index_DBLP on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_04.aql
index 24ed006..fe7b2f9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-check_04.aql
@@ -52,9 +52,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
-create index keyword_index on CSX(nested.title: string) type keyword enforced;
+create index keyword_index on CSX(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-inline.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-inline.aql
index 7219d51..2ec1846 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-inline.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard-inline.aql
@@ -41,7 +41,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_01.aql
index aeef474..c255829 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_01.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_02.aql
index 15a88ca..2d52ae9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_02.aql
@@ -53,7 +53,7 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on CSX(nested.title: string) type keyword enforced;
+create index keyword_index on CSX(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_03.aql
index 045e3b4..456ad8c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_03.aql
@@ -39,7 +39,7 @@
 
 create dataset DBLP(DBLPType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_04.aql
index 63ad895..8812d81 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/inverted-index-join/word-jaccard_04.aql
@@ -52,9 +52,9 @@
 
 create dataset CSX(CSXType) primary key nested.id;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
-create index keyword_index on CSX(nested.title: string) type keyword enforced;
+create index keyword_index on CSX(nested.title: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql
index c07ad40..8fa81da 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql
@@ -53,7 +53,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index twmSndLocIx on TweetMessages(nested.sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(nested.sender-location: point?) type rtree enforced;
 create index msgCountAIx on TweetMessages(nested.countA) type btree;
 create index msgCountBIx on TweetMessages(nested.countB) type btree;
 create index msgTextIx on TweetMessages(nested.message-text) type keyword;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql
index 2456a17..8499c9a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql
@@ -53,7 +53,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key nested.tweetid;
 
-create index twmSndLocIx on TweetMessages(nested.sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(nested.sender-location: point?) type rtree enforced;
 create index msgCountAIx on TweetMessages(nested.countA) type btree;
 create index msgCountBIx on TweetMessages(nested.countB) type btree;
 create index msgTextIx on TweetMessages(nested.message-text) type keyword;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_01.aql
index b5f36e7..1812b3b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData1' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_02.aql
index 76eb7c9..bed6626 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData2' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData2' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_03.aql
index 5d0b806..e991ee8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Self-joins a dataset on the intersection of its point attribute.
- *                  The dataset has an enforced open RTree index, and we expect the
+ *                  The dataset has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_04.aql
index 8010f89..06a30b4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index, and we expect the
+ *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -44,9 +44,9 @@
 create dataset MyData1(MyRecordOpen) primary key nested.id;
 create dataset MyData2(MyRecordOpen) primary key nested.id;
 
-create index rtree_index on MyData1(nested.point:point) type rtree enforced;
+create index rtree_index on MyData1(nested.point:point?) type rtree enforced;
 
-create index rtree_index2 on MyData2(nested.point:point) type rtree enforced;
+create index rtree_index2 on MyData2(nested.point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_05.aql
index 0a99784..22a3905 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/nested-open-index/rtree-index-join/spatial-intersect-point_05.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Only dataset 'MyData1' has an enforced open RTree index, hence we
+ *                  Only dataset 'MyData1' has an enforced open RTree index?, hence we
  *                  *do not* expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -44,7 +44,7 @@
 create dataset MyData1(MyRecordOpen) primary key nested.id;
 create dataset MyData2(MyRecordOpen) primary key nested.id;
 
-create index rtree_index on MyData1(nested.point:point) type rtree enforced;
+create index rtree_index on MyData1(nested.point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/disjunction-to-join.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/disjunction-to-join.aql
index fe75193..1c95319 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/disjunction-to-join.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/disjunction-to-join.aql
@@ -32,7 +32,7 @@
 };
 
 create dataset TestSet(TestType) primary key "id";
-create index TestSetIndex on TestSet(idx: string) enforced;
+create index TestSetIndex on TestSet(idx: string?) enforced;
 
 for $x in dataset TestSet 
 where $x.idx = "one" or $x.idx = "two"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql
index a096c8b..325063b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.aql
@@ -49,7 +49,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index msgCountBIx on TweetMessages(countB: int32) type btree enforced;
+create index msgCountBIx on TweetMessages(countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql
index 96849fe..bb1552a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.aql
@@ -48,8 +48,8 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index msgCountAIx on TweetMessages(countA: int32) type btree enforced;
-create index msgCountBIx on TweetMessages(countB: int32) type btree enforced;
+create index msgCountAIx on TweetMessages(countA: int32?) type btree enforced;
+create index msgCountBIx on TweetMessages(countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql
index 1ff785e..78673c3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.aql
@@ -49,7 +49,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index msgCountBIx on TweetMessages(countB: int32) type btree enforced;
+create index msgCountBIx on TweetMessages(countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql
index f386e00..07f4a07 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.aql
@@ -48,8 +48,8 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index msgCountAIx on TweetMessages(countA: int32) type btree enforced;
-create index msgCountBIx on TweetMessages(countB: int32) type btree enforced;
+create index msgCountAIx on TweetMessages(countA: int32?) type btree enforced;
+create index msgCountBIx on TweetMessages(countB: int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_01.aql
index ea51434..9e07c8d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_01.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_02.aql
index 938f9f0..50963e2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_02.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_03.aql
index 82d71ab..52d113e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-join_03.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.aql
index 2ee9098..05f4d74 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.aql
index b62b48f..b41c3b0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.aql
index b58ef1c..196347a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.aql
index 5b4b18e..559650e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.aql
index 5d0eb2f..15fc889 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_05.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.aql
index a0df2f5..551fdb7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.aql
@@ -32,7 +32,7 @@
 }
 
 create dataset Names(Name) primary key id;
-create index Name_idx on Names(fname: string,lname: string) enforced;
+create index Name_idx on Names(fname: string?,lname: string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_06.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.aql
index 3a0e289..af51a69 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.aql
@@ -61,7 +61,7 @@
 create dataset FacebookMessages(FacebookMessageType)
 primary key message-id;
 
-create index fbmIdxAutId if not exists on FacebookMessages(author-id-copy:int32) enforced;
+create index fbmIdxAutId if not exists on FacebookMessages(author-id-copy:int32?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multiindex.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multipred.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multipred.aql
index 4cad8e3..046d664 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multipred.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join-multipred.aql
@@ -48,7 +48,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index title_index on DBLP(title:string) enforced;
+create index title_index on DBLP(title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multipred.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_01.aql
index b9a9f59..5170257 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_01.aql
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index title_index on DBLP(title:string) enforced;
+create index title_index on DBLP(title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_02.aql
index d24522d..247b5e0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_02.aql
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index title_index on CSX(title:string) enforced;
+create index title_index on CSX(title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_03.aql
index e39a320..a414ba3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_03.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index title_index on DBLP(title:string) enforced;
+create index title_index on DBLP(title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_04.aql
index 5a988ff..8b78831 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_04.aql
@@ -45,9 +45,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index title_index_DBLP on DBLP(title:string) enforced;
+create index title_index_DBLP on DBLP(title:string?) enforced;
 
-create index title_index on CSX(title:string) enforced;
+create index title_index on CSX(title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_05.aql
index 714bbf8..85a4495 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index-join/secondary-equi-join_05.aql
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index title_index on DBLP(title:string) enforced;
+create index title_index on DBLP(title:string?) enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-33.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-33.aql
index b4d7e8b..4c5c2b8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-33.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-33.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Roger"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-34.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-34.aql
index 8fc5bf3..4aee42a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-34.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-34.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Susan"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-35.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-35.aql
index 4db04c4..549db84 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-35.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-35.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname < "Isa"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-36.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-36.aql
index 072e8df..5d181fc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-36.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-36.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname <= "Vanpatten"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-37.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-37.aql
index 03f90e3..75804ea 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-37.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-37.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname != "Max"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-38.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-38.aql
index f73425d..711e68f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-38.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-38.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname = "Julio"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-39.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-39.aql
index 63a69af..fb3b93d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-39.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-39.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.lname = "Kim"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-40.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-40.aql
index 4de4012..0f42145 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-40.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-40.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname = "Young Seok" and $emp.lname = "Kim"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-41.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-41.aql
index 262b729..d05ac9f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-41.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-41.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname = "Julio" or $emp.lname = "Malaika"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-42.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-42.aql
index 8a10529..63daef0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-42.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-42.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Alex" and $emp.lname < "Zach"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-43.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-43.aql
index e136d17..b584eee 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-43.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-43.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Allan" and $emp.lname < "Zubi"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-44.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-44.aql
index 499daf1..05b92c0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-44.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-44.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Allan" and $emp.lname = "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-45.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-45.aql
index 0cd5b62..a732af4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-45.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-45.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname = "Julio" and $emp.lname < "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-46.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-46.aql
index 75247b7..efdae0a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-46.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-46.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Michael" and $emp.lname <= "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-47.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-47.aql
index 6dbbb33..4cd35eb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-47.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-47.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-48.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-48.aql
index 785f605..83ab8e6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-48.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-48.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-49.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-49.aql
index d695b53..b255913 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-49.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-49.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname <= "Craig" and $emp.lname > "Kevin"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-50.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-50.aql
index ce20a9d..427e29a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-50.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-50.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname != "Michael" and $emp.lname != "Carey"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-51.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-51.aql
index a48a641..99baf52 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-51.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-51.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-52.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-52.aql
index f07897d..9d9f6f8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-52.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-52.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-53.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-53.aql
index 57144e9..9c70884 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-53.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-53.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Craig" and $emp.lname <= "Kevin" and $emp.fname <= "Mary" and $emp.lname >= "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-54.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-54.aql
index 8ee16ee..c8c9ae2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-54.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-54.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Max"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-55.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-55.aql
index d948560..1497453 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-55.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-55.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Sofia"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-56.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-56.aql
index 25e5506..bfb9b8b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-56.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-56.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname < "Chen"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-57.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-57.aql
index d0d3e27..bca543b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-57.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-57.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname <= "Julio"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-58.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-58.aql
index 9d80143..0a0b69f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-58.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-58.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Neil" and $emp.fname < "Roger"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-59.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-59.aql
index 9ef324f..c7e41e5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-59.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-59.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname >= "Max" and $emp.fname <= "Roger"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-60.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-60.aql
index ab1ba1f..38c265c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-60.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-60.aql
@@ -35,7 +35,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string) enforced;
+create index sec_Idx on testdst(fname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname = "Max"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-61.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-61.aql
index 42df854..840c227 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-61.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-61.aql
@@ -36,7 +36,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst')
 where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname <= "Mary" and $emp.lname < "Tomes"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-62.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-62.aql
index 76c912f..cf06de7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-62.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-62.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst') 
 where $emp.fname = "Julio" and $emp.lname > "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-63.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-63.aql
index e42b5f3..c34770b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-63.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/btree-index/btree-secondary-63.aql
@@ -38,7 +38,7 @@
 
 create dataset testdst(TestType) primary key id;
 
-create index sec_Idx on testdst(fname:string,lname:string) enforced;
+create index sec_Idx on testdst(fname:string?,lname:string?) enforced;
 
 for $emp in dataset('testdst') 
 where $emp.fname < "Julio" and $emp.lname = "Xu"
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains-panic.aql
index fea5075..842f7af 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains-panic.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains.aql
index 7b8e32b8..f5aa09f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-contains.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.aql
index 4b7c8ee..233375d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.aql
index bbdda47..78ab408 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.aql
index ae6d915..b090de0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance.aql
index 88a01d3..e88bdc8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-edit-distance.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
index d8782b3..5392b22 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-edit-distance.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
index e887d65..fe8b831 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard-check.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard-check.aql
index 8799838..fe471d9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard-check.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard-check.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard-check.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard.aql
index 30c203e..60b95d5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/ngram-jaccard.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-contains.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-contains.aql
index 1d96f5a..24844f8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-contains.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-contains.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-contains.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.aql
index c38e20c..f83c315 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-fuzzyeq-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard-check.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard-check.aql
index ea738f0..90d11be 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard-check.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard-check.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard-check.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard.aql
index 7a4db03..2f29131 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-basic/word-jaccard.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
index 2ff5661..2d89001 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
@@ -37,7 +37,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
index c9eaac6..361f722 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
@@ -37,7 +37,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
index 39aa28d..a59182d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.aql
index fca9938..a438fe6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.aql
index 23f5e52..0693557 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-substring.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql
index 8969d05..33e4021 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-word-tokens.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.aql
index ed1bd7d..e9ab5af 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.aql
@@ -37,7 +37,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.aql
index 2ee9192..0d1e304 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.aql
@@ -37,7 +37,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-multi-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-let.aql
index fad2cf9..bc1fe5d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-let.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.aql
index b1e7dac..47ffce4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.aql
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-multi-let.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql
index 8bf3b48..b482b48 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.aql
@@ -49,7 +49,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index msgNgramIx on TweetMessages(message-text: string) type ngram(3) enforced;
+create index msgNgramIx on TweetMessages(message-text: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_leftouterjoin-probe-pidx-with-join-edit-distance-check_idx_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_01.aql
index 30b7078..38bbdb3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_01.aql
@@ -44,7 +44,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_02.aql
index a6e66ec..1dcd503 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_02.aql
@@ -44,7 +44,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(title: string) type ngram(3) enforced;
+create index ngram_index on CSX(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_03.aql
index c4f255b..5721955 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_03.aql
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_04.aql
index cb552fd..b4daaa8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-contains_04.aql
@@ -43,9 +43,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(title: string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(title: string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(title: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.aql
index a2a4ba3..0f0a673 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.aql
index 32a53c1..a5cb417 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  CSX has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(authors:string) type ngram(3) enforced;
+create index ngram_index on CSX(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.aql
index 82ef357..c689120 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance-check function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.aql
index ab03701..68c255e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  DBLP and CSX both have a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -44,9 +44,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(authors:string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(authors:string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.aql
index e8acecb..1980bce 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.aql
@@ -18,8 +18,8 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we *do not* expect the join to be transformed
- *                  into an indexed nested-loop join, because CSX does not declare an enforced open index on field authors.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we *do not* expect the join to be transformed
+ *                  into an indexed nested-loop join?, because CSX does not declare an enforced open index on field authors.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.aql
index 3c50388..72027fe 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance-check function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.aql
index 466fb71..49baed1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.aql
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors: string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-contains.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_01.aql
index d3ad9e2..ec6378b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_02.aql
index dd32f49..860461d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  CSX has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(authors:string) type ngram(3) enforced;
+create index ngram_index on CSX(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_03.aql
index d58b13d..19a2cfa 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_04.aql
index 3fb4dc4..b2bf9cf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  DBLP and CSX both have a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -44,9 +44,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(authors:string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(authors:string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_05.aql
index 4d93fe2..d884025 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_05.aql
@@ -18,8 +18,8 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we *do not* expect the join to be transformed
- *                  into an indexed nested-loop join, because CSX does not declare an enforced open index on field authors.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we *do not* expect the join to be transformed
+ *                  into an indexed nested-loop join?, because CSX does not declare an enforced open index on field authors.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.aql
index d23a2fd..050b507 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
index 83976fd..7cc50d1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(authors:string) type ngram(3) enforced;
+create index ngram_index on CSX(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
index afa9a18..7c7322c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  CSX has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
index e9cb241..956913d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on ~= using edit distance of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 drop dataverse test if exists;
@@ -34,7 +34,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql
index 0a37012..6ddb3ef 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  DBLP and CSX both have a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -44,9 +44,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(authors:string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(authors:string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql
index 87ed0a3..1680143 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.aql
@@ -18,8 +18,8 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we *do not* expect the join to be transformed
- *                  into an indexed nested-loop join, because CSX does not declare an enforced open index on field authors.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we *do not* expect the join to be transformed
+ *                  into an indexed nested-loop join?, because CSX does not declare an enforced open index on field authors.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLP(authors:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
index c7e57af..114167e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, open DBLP and closed CSX, based on ~= using Jaccard of their titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
index 6ed468c..237ac57 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, closed DBLP and open CSX, based on ~= using Jaccard their titles' 3-gram tokens.
- *                  CSX has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(title:string) type ngram(3) enforced;
+create index ngram_index on CSX(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
index c1dd084..6ef70de 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on ~= using Jaccard of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql
index 9c1572c..4ddb71f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' 3-gram tokens.
- *                  DBLP and CSX both have a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,9 +45,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(title:string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(title:string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.aql
index 06d1a7b..1277050 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, open DBLP and closed CSX, based on the similarity-jaccard-check function of their titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.aql
index bb74356..bbaa284 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, closed DBLP and open CSX, based the similarity-jaccard-check function of their titles' 3-gram tokens.
- *                  CSX has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(title:string) type ngram(3) enforced;
+create index ngram_index on CSX(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.aql
index c431b6f..a0f8683 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins an open dataset DBLP, based on the similarity-jaccard-check function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.aql
index 46314fa..26e2504 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based the similarity-jaccard-check function of their titles' 3-gram tokens.
- *                  DBLP and CSX both have a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,9 +45,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(title:string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(title:string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.aql
index 9dc2650..f061fcf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -37,7 +37,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_01.aql
index 07773fa..9f4bd45 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_02.aql
index 3d8c8f5..82b31c3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based the similarity-jaccard function of their titles' 3-gram tokens.
- *                  CSX has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -46,7 +46,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index on CSX(title:string) type ngram(3) enforced;
+create index ngram_index on CSX(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_03.aql
index 278e391..e702d56 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_04.aql
index 0becd07..e1a9164 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based the similarity-jaccard function of their titles' 3-gram tokens.
- *                  DBLP and CSX both have a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,9 +45,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index ngram_index_DBLP on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index_DBLP on DBLP(title:string?) type ngram(3) enforced;
 
-create index ngram_index_CSX on CSX(title:string) type ngram(3) enforced;
+create index ngram_index_CSX on CSX(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.aql
index db2a334..b634cbf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -37,7 +37,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.aql
index dd19d4e..3361405 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.aql
index c06d903..3990354 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
- *                  CSX has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index on CSX(title:string) type keyword enforced;
+create index keyword_index on CSX(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.aql
index 416701b..9cccbf0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on ~= using Jaccard of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.aql
index d931490..0a0eb66 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
- *                  DBLP and CSX both have an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -44,9 +44,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index_DBLP on DBLP(title:string) type keyword enforced;
+create index keyword_index_DBLP on DBLP(title:string?) type keyword enforced;
 
-create index keyword_index_CSX on CSX(title:string) type keyword enforced;
+create index keyword_index_CSX on CSX(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.aql
index 0e71a24..d090e0b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.aql
@@ -53,7 +53,7 @@
 create index twmSndLocIx on TweetMessages(sender-location) type rtree;
 create index msgCountAIx on TweetMessages(countA) type btree;
 create index msgCountBIx on TweetMessages(countB) type btree;
-create index msgTextIx on TweetMessages(message-text: string) type keyword enforced;
+create index msgTextIx on TweetMessages(message-text: string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check-after-btree-access.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_01.aql
index c2f5903..e784002 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard-check function of their titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_02.aql
index db99e57..27a170d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard-check function of their titles' word tokens.
- *                  CSX has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index on CSX(title:string) type keyword enforced;
+create index keyword_index on CSX(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_03.aql
index 1a260e3..7fca777 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_04.aql
index 89bca10..294732f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard-check function of their titles' word tokens.
- *                  DBLP and CSX both have an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -44,9 +44,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index_DBLP on DBLP(title:string) type keyword enforced;
+create index keyword_index_DBLP on DBLP(title:string?) type keyword enforced;
 
-create index keyword_index_CSX on CSX(title:string) type keyword enforced;
+create index keyword_index_CSX on CSX(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.aql
index 4e94d09..e2f32f3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_01.aql
index 6b449b1..7f2ac1c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_02.aql
index 534aec0..a143cff 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- *                  CSX has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -45,7 +45,7 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index on CSX(title:string) type keyword enforced;
+create index keyword_index on CSX(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_03.aql
index 2047f8d..744505b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -35,7 +35,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_04.aql
index 65734a1..f49113a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- *                  DBLP and CSX both have an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -44,9 +44,9 @@
 
 create dataset CSX(CSXType) primary key id;
 
-create index keyword_index_DBLP on DBLP(title:string) type keyword enforced;
+create index keyword_index_DBLP on DBLP(title:string?) type keyword enforced;
 
-create index keyword_index_CSX on CSX(title:string) type keyword enforced;
+create index keyword_index_CSX on CSX(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_inline_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_inline_03.aql
index 451f03a..81f0a77 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_inline_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/inverted-index-join/word-jaccard_inline_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -36,7 +36,7 @@
 
 create dataset DBLP(DBLPType) primary key id;
 
-create index keyword_index on DBLP(title:string) type keyword enforced;
+create index keyword_index on DBLP(title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_04.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql
index 3be6b83..090783e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.aql
@@ -49,7 +49,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index twmSndLocIx on TweetMessages(sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(sender-location: point?) type rtree enforced;
 create index msgCountAIx on TweetMessages(countA) type btree;
 create index msgCountBIx on TweetMessages(countB) type btree;
 create index msgTextIx on TweetMessages(message-text) type keyword;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql
index a3d0aca..eaab1cb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.aql
@@ -49,7 +49,7 @@
 create dataset TweetMessages(TweetMessageType)
 primary key tweetid;
 
-create index twmSndLocIx on TweetMessages(sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(sender-location: point?) type rtree enforced;
 create index msgCountAIx on TweetMessages(countA) type btree;
 create index msgCountBIx on TweetMessages(countB) type btree;
 create index msgTextIx on TweetMessages(message-text) type keyword;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_01.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_01.aql
index fd2fce1..112ece4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_01.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_01.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData1' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -51,7 +51,7 @@
 create dataset MyData1(MyRecordOpen) primary key id;
 create dataset MyData2(MyRecord) primary key id;
 
-create index rtree_index on MyData1(point:point) type rtree enforced;
+create index rtree_index on MyData1(point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/index-join_rtree-spatial-intersect-point.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_02.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_02.aql
index bf57535..50ef2b0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_02.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_02.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData2' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData2' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -51,7 +51,7 @@
 create dataset MyData1(MyRecord) primary key id;
 create dataset MyData2(MyRecordOpen) primary key id;
 
-create index rtree_index on MyData2(point:point) type rtree enforced;
+create index rtree_index on MyData2(point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_03.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_03.aql
index 4d73907..fe80eaa 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_03.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_03.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Self-joins a dataset on the intersection of its point attribute.
- *                  The dataset has an enforced open RTree index, and we expect the
+ *                  The dataset has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -39,7 +39,7 @@
 
 create dataset MyData(MyRecord) primary key id;
 
-create index rtree_index on MyData(point:point) type rtree enforced;
+create index rtree_index on MyData(point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_03.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_04.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_04.aql
index a72f77e..7bcd06d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_04.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_04.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index, and we expect the
+ *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -40,9 +40,9 @@
 create dataset MyData1(MyRecord) primary key id;
 create dataset MyData2(MyRecord) primary key id;
 
-create index rtree_index on MyData1(point:point) type rtree enforced;
+create index rtree_index on MyData1(point:point?) type rtree enforced;
 
-create index rtree_index2 on MyData2(point:point) type rtree enforced;
+create index rtree_index2 on MyData2(point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_05.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_05.aql
index dd49d93..c5b839a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_05.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/open-index-enforced/rtree-index-join/spatial-intersect-point_05.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Only dataset 'MyData1' has an enforced open RTree index, hence we
+ *                  Only dataset 'MyData1' has an enforced open RTree index?, hence we
  *                  *do not* expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -40,7 +40,7 @@
 create dataset MyData1(MyRecord) primary key id;
 create dataset MyData2(MyRecord) primary key id;
 
-create index rtree_index on MyData1(point:point) type rtree enforced;
+create index rtree_index on MyData1(point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm";
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_01.sqlpp
index 5666788..69dfb0a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData1' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_02.sqlpp
index 88e4988..bd6797e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData2' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData2' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_03.sqlpp
index a2aa990..a6e4cbb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-index/rtree-index-join/spatial-intersect-point_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Self-joins a dataset on the intersection of its point attribute.
- *                  The dataset has an enforced open RTree index, and we expect the
+ *                  The dataset has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/disjunction-to-join.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/disjunction-to-join.sqlpp
index 5e065ef..819bdc7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/disjunction-to-join.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/disjunction-to-join.sqlpp
@@ -42,7 +42,7 @@
 
 create  dataset TestSet(TestType) primary key id;
 
-create  index TestSetIndex  on TestSet (nested.idx:string) type btree enforced;
+create  index TestSetIndex  on TestSet (nested.idx:string?) type btree enforced;
 
 select element x
 from  TestSet as x
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp
index 4ac971f..d8aa9f5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp
@@ -57,7 +57,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm"
 select element {'tweetid1':t1.nested.tweetid,'count1':t1.nested.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp
index a05970d..7913c72 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp
@@ -56,9 +56,9 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index msgCountAIx  on TweetMessages (nested.countA:int32) type btree enforced;
+create  index msgCountAIx  on TweetMessages (nested.countA:int32?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm"
 select element {'tweetid1':t1.nested.tweetid,'count1':t1.nested.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp
index bcd1821..45fc530 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp
@@ -57,7 +57,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm"
 select element {'tweetid1':t1.nested.tweetid,'count1':t1.nested.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp
index 11fcb03..8ee9a0c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp
@@ -56,9 +56,9 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index msgCountAIx  on TweetMessages (nested.countA:int32) type btree enforced;
+create  index msgCountAIx  on TweetMessages (nested.countA:int32?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm"
 select element {'tweetid1':t1.nested.tweetid,'count1':t1.nested.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_01.sqlpp
index f635b4a..bd8c859 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_01.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_01.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_02.sqlpp
index ab99978..1179a49 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_02.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_02.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_03.sqlpp
index c82af37..3944ddb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-join_03.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_03.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp
index 3e8dab8..7877f16 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_01.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp
index dfc53d8..0652525 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_02.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp
index fc627ea..e7bcff2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_03.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp
index 5b93395..30686bf 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_04.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp
index d859b31..8bca8a8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_05.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp
index e9a795d..aca1616 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset Names(NameType) primary key nested.id;
 
-create  index Name_idx  on Names (nested.fname:string,lnested.name:string) type btree enforced;
+create  index Name_idx  on Names (nested.fname:string?,lnested.name:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_06.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multiindex.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multiindex.sqlpp
index 2f15778..fc0e178 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multiindex.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multiindex.sqlpp
@@ -74,7 +74,7 @@
 
 create  dataset FacebookMessages(FacebookMessageType) primary key nested.`message-id`;
 
-create  index fbmIdxAutId  if not exists  on FacebookMessages (nested.`author-id-copy`:int32) type btree enforced;
+create  index fbmIdxAutId  if not exists  on FacebookMessages (nested.`author-id-copy`:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multiindex.adm"
 select element {'fbu-ID':user.nested.id,'fbm-auth-ID':message.nested.`author-id`,'uname':user.nested.name,'message':message.nested.message}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multipred.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multipred.sqlpp
index f12f017..657a743 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multipred.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join-multipred.sqlpp
@@ -62,7 +62,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index title_index  on DBLP (nested.title:string) type btree enforced;
+create  index title_index  on DBLP (nested.title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multipred.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_01.sqlpp
index d4db160..d032c62 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_01.sqlpp
@@ -60,7 +60,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index title_index  on DBLP (nested.title:string) type btree enforced;
+create  index title_index  on DBLP (nested.title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_02.sqlpp
index f86ab33..ddb5821 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_02.sqlpp
@@ -60,7 +60,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index title_index  on CSX (nested.title:string) type btree enforced;
+create  index title_index  on CSX (nested.title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_03.sqlpp
index dabfbaf..d7a6e57 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_03.sqlpp
@@ -59,9 +59,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index title_index_DBLP  on DBLP (nested.title:string) type btree enforced;
+create  index title_index_DBLP  on DBLP (nested.title:string?) type btree enforced;
 
-create  index title_index_CSX  on CSX (nested.title:string) type btree enforced;
+create  index title_index_CSX  on CSX (nested.title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_04.sqlpp
index 7d50d8a..45d149b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_04.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index title_index  on DBLP (nested.title:string) type btree enforced;
+create  index title_index  on DBLP (nested.title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_04.adm"
 select element {'arec':a,'arec2':a2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_05.sqlpp
index 3fb5ae0..7bd9317 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index-join/secondary-equi-join_05.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index title_index  on DBLP (nested.title:string) type btree enforced;
+create  index title_index  on DBLP (nested.title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_05.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-33.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-33.sqlpp
index 94aa215..3a2f8f4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-33.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-33.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-34.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-34.sqlpp
index 87c2bfc..dc2cacc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-34.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-34.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-35.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-35.sqlpp
index 472410d..4f35f40 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-35.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-35.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-36.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-36.sqlpp
index 027a361..4ca2b67 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-36.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-36.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-37.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-37.sqlpp
index c252629..fb3c31e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-37.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-37.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-38.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-38.sqlpp
index e9acf6c..bba83d1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-38.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-38.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-39.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-39.sqlpp
index ac4fa15..0cf3120 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-39.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-39.sqlpp
@@ -42,7 +42,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-40.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-40.sqlpp
index 24e0522..45756b8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-40.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-40.sqlpp
@@ -42,7 +42,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-41.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-41.sqlpp
index 41d1bec..5667fa9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-41.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-41.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-42.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-42.sqlpp
index 69237b1..fb283ba 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-42.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-42.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-43.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-43.sqlpp
index 7b6e85f..3921673 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-43.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-43.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-44.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-44.sqlpp
index e88bceb..79d26cd 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-44.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-44.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-45.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-45.sqlpp
index f073308..e2e4116 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-45.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-45.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-46.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-46.sqlpp
index d2af5c7..004cce0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-46.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-46.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-47.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-47.sqlpp
index fac87f6..a03b708 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-47.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-47.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-48.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-48.sqlpp
index 98bd274..2a857fa 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-48.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-48.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-49.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-49.sqlpp
index ace34cf..25e7fd6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-49.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-49.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-50.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-50.sqlpp
index 318044a..e2c2b15 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-50.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-50.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-51.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-51.sqlpp
index c7046e9..ec1029c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-51.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-51.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-52.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-52.sqlpp
index 988c330..0c829f8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-52.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-52.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-53.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-53.sqlpp
index 1f95edd..b0be2e0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-53.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-53.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-54.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-54.sqlpp
index 272cc15..63afe8d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-54.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-54.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-55.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-55.sqlpp
index c580d77..941e7a4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-55.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-55.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-56.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-56.sqlpp
index d08f870..925bc4f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-56.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-56.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-57.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-57.sqlpp
index dce7afc..b128851 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-57.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-57.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-58.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-58.sqlpp
index 76f4cf0..fec063a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-58.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-58.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-59.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-59.sqlpp
index 4ec453e..4b72506 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-59.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-59.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-60.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-60.sqlpp
index e956b7c..ca5b7ce 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-60.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-60.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-61.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-61.sqlpp
index 5b30ebe..32f6ece 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-61.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-61.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-62.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-62.sqlpp
index 18ebd8e..1b0b719 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-62.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-62.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-63.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-63.sqlpp
index 38cb160..3211337 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-63.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/btree-index/btree-secondary-63.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset testdst(TestType) primary key nested.id;
 
-create  index sec_Idx  on testdst (nested.fname:string,nested.lname:string) type btree enforced;
+create  index sec_Idx  on testdst (nested.fname:string?,nested.lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains-panic.sqlpp
index a32d6b3..6b3cf6e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains-panic.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains.sqlpp
index 5c11a27..049fdac 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-contains.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp
index e8ccfd7..b8cefc7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.sqlpp
index 653b656..1b8daa2a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-check.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.sqlpp
index 637e95f..96edceb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance-panic.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance.sqlpp
index 0f1d628..aa33913 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-edit-distance.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp
index f009b64..4960908 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-edit-distance.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp
index 0444d2b..b381f79 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-jaccard.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.sqlpp
index 4889fda..8d44828 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard-check.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard-check.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard.sqlpp
index 7917bdd..05635dc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/ngram-jaccard.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-contains.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-contains.sqlpp
index f487a2c..513fa11 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-contains.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-contains.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-contains.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp
index 8e2f80e..0ffb68e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-fuzzyeq-jaccard.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.sqlpp
index 27e593c..f4f05f1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard-check.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard-check.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard.sqlpp
index e402507..b762005 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-basic/word-jaccard.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp
index 9f4d64c..54b7622 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp
index 129eaae..d867783 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp
index 41b00ad..6911870 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.sqlpp
index 463056d..2ffc131 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-let.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp
index f8160f7..b1fb61d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-substring.adm"
 select element {'id':paper.nested.id,'title':paper.nested.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp
index 8945313..cc6ab03 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-word-tokens.adm"
 select element {'id':paper.nested.id,'title':paper.nested.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.sqlpp
index 724f7fa..199dc24 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-let.sqlpp
@@ -46,7 +46,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-let.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp
index a6831bd..c415b83 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp
@@ -46,7 +46,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-multi-let.adm"
 select element {'Paper':paper_tokens,'Query':query_tokens}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.sqlpp
index a6bc338..d1630e7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-let.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-let.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.sqlpp
index b396348..1db6a14 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-complex/word-jaccard-check-multi-let.sqlpp
@@ -44,7 +44,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-multi-let.adm"
 select element {'Paper':paper_tokens,'Query':query_tokens}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp
index fd02bb4..3794e9b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp
@@ -57,7 +57,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index msgNgramIx  on TweetMessages (nested.`message-text`:string) type ngram (3) enforced;
+create  index msgNgramIx  on TweetMessages (nested.`message-text`:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_leftouterjoin-probe-pidx-with-join-edit-distance-check_idx_01.adm"
 select element {'tweet':{'id':t1.nested.tweetid,'topics':t1.nested.`message-text`},'similar-tweets':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_01.sqlpp
index 75de2d0..5f7784a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_01.sqlpp
@@ -48,7 +48,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-01.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_02.sqlpp
index 7ff4602..cb0d2b9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_02.sqlpp
@@ -48,7 +48,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-02.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_03.sqlpp
index a0450f0..4e0304f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_03.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-03.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_04.sqlpp
index b7943cb..71493d2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-contains_04.sqlpp
@@ -47,9 +47,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-04.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.sqlpp
index 3c93519..ab49a9f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_01.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.sqlpp
index 333a250..77e9f52 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_02.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.sqlpp
index 825df9e..542a890 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_03.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.sqlpp
index 6fcd88d..664aa8f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_04.sqlpp
@@ -58,9 +58,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index_DBLP  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.sqlpp
index dcb8181..033f5c2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-check_05.sqlpp
@@ -58,7 +58,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.sqlpp
index 1b7ed3c..665a859 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-contains.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-contains.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-inline.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-inline.sqlpp
index 5d43612..7efb5c4 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-inline.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance-inline.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join-noeqjoin_ngram-edit-distance-inline.adm"
 select element {'aauthors':a.nested.authors,'bauthors':b.nested.authors,'ed':ed}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_01.sqlpp
index a00a1e9..0c1e231 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_01.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_02.sqlpp
index 91edfeb..216f208 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_02.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_03.sqlpp
index cb8eb11..b1be960 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_03.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_04.sqlpp
index a958b0f..3c84505 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_04.sqlpp
@@ -58,9 +58,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index_DBLP  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_05.sqlpp
index 37e50a4..da13fd5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-edit-distance_05.sqlpp
@@ -58,7 +58,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp
index 81f855a..3d310d5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp
index 4a24d87..0570fad 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp
index 2a45cbe..774ea99 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp
index c064298..1d368740 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp
@@ -58,9 +58,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index_DBLP  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp
index e98b8e7..5da6d79 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp
@@ -58,7 +58,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp
index 6f95947..d036270 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp
@@ -61,7 +61,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp
index 3deffe3..dcfeff8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp
@@ -61,7 +61,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp
index 1d2fdf0..7735290 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp
index ca4ab6d..049a6c9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp
@@ -60,9 +60,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index_DBLP  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (nested.title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (nested.title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.sqlpp
index 49b53db..2f89621 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_01.sqlpp
@@ -61,7 +61,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.sqlpp
index 823fc18..991c751 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_02.sqlpp
@@ -61,7 +61,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.sqlpp
index 0c105e0..ee9be08 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_03.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.sqlpp
index 0e640ea..105cd51 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-check_04.sqlpp
@@ -60,9 +60,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index_DBLP  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (nested.title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (nested.title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.sqlpp
index 25f9fea..da2f066 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard-inline.sqlpp
@@ -47,7 +47,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join-noeqjoin_ngram-jaccard-inline.adm"
 select element {'atitle':a.nested.title,'btitle':b.nested.title,'jacc':jacc}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.sqlpp
index c81ffb4..cb53734 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_01.sqlpp
@@ -61,7 +61,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.sqlpp
index efd021d..f2ee2c9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_02.sqlpp
@@ -61,7 +61,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index  on CSX (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.sqlpp
index 2cc4f25..d71aac6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_03.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.sqlpp
index cc8ac09..7d543b5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/ngram-jaccard_04.sqlpp
@@ -60,9 +60,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index ngram_index_DBLP  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (nested.title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (nested.title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (nested.title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp
index 6401b85..5ae9fee 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp
index 2629d6a..82d00e8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on CSX (nested.title:string) type keyword enforced;
+create  index keyword_index  on CSX (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp
index f47b02f..5f46785 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp
index c1a2b39..4608aa1 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp
@@ -58,9 +58,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index_DBLP  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index_DBLP  on DBLP (nested.title:string?) type keyword enforced;
 
-create  index keyword_index_CSX  on CSX (nested.title:string) type keyword enforced;
+create  index keyword_index_CSX  on CSX (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp
index ab68ad0..d564cc5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp
@@ -64,7 +64,7 @@
 
 create  index msgCountBIx  on TweetMessages (nested.countB) type btree;
 
-create  index msgTextIx  on TweetMessages (nested.`message-text`:string) type keyword enforced;
+create  index msgTextIx  on TweetMessages (nested.`message-text`:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check-after-btree-access.adm"
 select element {'t1':t1.nested.tweetid,'t2':t2.nested.tweetid,'sim':sim[1]}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.sqlpp
index ef3448a..f7405a6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_01.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.sqlpp
index 87e0f28..b0bc9ab 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_02.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on CSX (nested.title:string) type keyword enforced;
+create  index keyword_index  on CSX (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.sqlpp
index 5d93502..69c75a5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_03.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index_DBLP  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index_DBLP  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.sqlpp
index 0ee99d7..a567aca 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-check_04.sqlpp
@@ -58,9 +58,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
-create  index keyword_index  on CSX (nested.title:string) type keyword enforced;
+create  index keyword_index  on CSX (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.sqlpp
index 0b39666..9e0c4b7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard-inline.sqlpp
@@ -45,7 +45,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join-noeqjoin_word-jaccard-inline.adm"
 select element {'atitle':a.nested.title,'btitle':b.nested.title,'jacc':jacc}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.sqlpp
index 3e07b97..41bac97 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_01.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.sqlpp
index 8e97b96..a4613cd 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_02.sqlpp
@@ -59,7 +59,7 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on CSX (nested.title:string) type keyword enforced;
+create  index keyword_index  on CSX (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.sqlpp
index a5f28bf..c78763e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_03.sqlpp
@@ -43,7 +43,7 @@
 
 create  dataset DBLP(DBLPType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.sqlpp
index 1b7847d..13e92d7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/inverted-index-join/word-jaccard_04.sqlpp
@@ -58,9 +58,9 @@
 
 create  dataset CSX(CSXType) primary key nested.id;
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
-create  index keyword_index  on CSX (nested.title:string) type keyword enforced;
+create  index keyword_index  on CSX (nested.title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp
index 646407d..0f6afda 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp
@@ -57,7 +57,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point?) type rtree enforced;
 
 create  index msgCountAIx  on TweetMessages (nested.countA) type btree;
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp
index 6c6364f..611ba39 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp
@@ -57,7 +57,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key nested.tweetid;
 
-create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point?) type rtree enforced;
 
 create  index msgCountAIx  on TweetMessages (nested.countA) type btree;
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.sqlpp
index 5666788..69dfb0a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData1' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.sqlpp
index 88e4988..bd6797e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData2' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData2' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.sqlpp
index a2aa990..a6e4cbb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Self-joins a dataset on the intersection of its point attribute.
- *                  The dataset has an enforced open RTree index, and we expect the
+ *                  The dataset has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.sqlpp
index 3f57077..942edfa 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index, and we expect the
+ *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -49,9 +49,9 @@
 
 create  dataset MyData2(MyRecordOpen) primary key nested.id;
 
-create  index rtree_index  on MyData1 (nested.point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (nested.point:point?) type rtree enforced;
 
-create  index rtree_index2  on MyData2 (nested.point:point) type rtree enforced;
+create  index rtree_index2  on MyData2 (nested.point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.sqlpp
index 71f46d0..6241800 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nested-open-index/rtree-index-join/spatial-intersect-point_05.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Only dataset 'MyData1' has an enforced open RTree index, hence we
+ *                  Only dataset 'MyData1' has an enforced open RTree index?, hence we
  *                  *do not* expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -49,7 +49,7 @@
 
 create  dataset MyData2(MyRecordOpen) primary key nested.id;
 
-create  index rtree_index  on MyData1 (nested.point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (nested.point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.sqlpp
index e48585b..895e94a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/disjunction-to-join.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset TestSet(TestType) primary key id;
 
-create  index TestSetIndex  on TestSet (idx:string) type btree enforced;
+create  index TestSetIndex  on TestSet (idx:string?) type btree enforced;
 
 select element x
 from  TestSet as x
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp
index 05e8967..d5f8b57 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_1.sqlpp
@@ -52,7 +52,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index msgCountBIx  on TweetMessages (countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm"
 select element {'tweetid1':t1.tweetid,'count1':t1.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp
index 930d72c..e1e7dbc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_01_2.sqlpp
@@ -51,9 +51,9 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index msgCountAIx  on TweetMessages (countA:int32) type btree enforced;
+create  index msgCountAIx  on TweetMessages (countA:int32?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_01.adm"
 select element {'tweetid1':t1.tweetid,'count1':t1.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp
index 00022fa..55a2eef 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_1.sqlpp
@@ -52,7 +52,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index msgCountBIx  on TweetMessages (countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm"
 select element {'tweetid1':t1.tweetid,'count1':t1.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp
index 765cea6..19dfce8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/leftouterjoin-probe-pidx-with-join-btree-sidx_02_2.sqlpp
@@ -51,9 +51,9 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index msgCountAIx  on TweetMessages (countA:int32) type btree enforced;
+create  index msgCountAIx  on TweetMessages (countA:int32?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (countB:int32) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_leftouterjoin-probe-pidx-with-join-btree-sidx_02.adm"
 select element {'tweetid1':t1.tweetid,'count1':t1.countA,'t2info':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_01.sqlpp
index 56b226b..95ea3be 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_01.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_01.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_02.sqlpp
index e4973bc..a4a75c3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_02.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_02.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_03.sqlpp
index 68273b6..5b8bf85 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-join_03.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-join_03.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp
index 47387b0..01a1ff0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_01.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_01.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp
index 6e03e30..a2be61f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_02.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_02.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp
index 7e3a467..d24e480 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_03.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_03.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp
index 0e89f2b..aab9fc5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_04.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_04.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp
index e743639..911b100 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_05.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_05.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp
index a6295e7..f8a12a7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-composite-key-prefix-join_06.sqlpp
@@ -36,7 +36,7 @@
 
 create  dataset Names(Name) primary key id;
 
-create  index Name_idx  on Names (fname:string,lname:string) type btree enforced;
+create  index Name_idx  on Names (fname:string?,lname:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_secondary-composite-key-prefix-prefix-join_06.adm"
 select element {'emp1':emp1,'emp2':emp2}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.sqlpp
index 0c48303..cb39151 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multiindex.sqlpp
@@ -64,7 +64,7 @@
 
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 
-create  index fbmIdxAutId  if not exists  on FacebookMessages (`author-id-copy`:int32) type btree enforced;
+create  index fbmIdxAutId  if not exists  on FacebookMessages (`author-id-copy`:int32?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multiindex.adm"
 select element {'fbu-ID':user.id,'fbm-auth-ID':message.`author-id`,'uname':user.name,'message':message.message}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multipred.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multipred.sqlpp
index 2d77362..66cb93c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multipred.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join-multipred.sqlpp
@@ -52,7 +52,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index title_index  on DBLP (title:string) type btree enforced;
+create  index title_index  on DBLP (title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join-multipred.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_01.sqlpp
index e7b1633..cb5c68f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_01.sqlpp
@@ -50,7 +50,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index title_index  on DBLP (title:string) type btree enforced;
+create  index title_index  on DBLP (title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_02.sqlpp
index 5f3e4ba..42a936e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_02.sqlpp
@@ -50,7 +50,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index title_index  on CSX (title:string) type btree enforced;
+create  index title_index  on CSX (title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_03.sqlpp
index dc53cdb..8192d3b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_03.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index title_index  on DBLP (title:string) type btree enforced;
+create  index title_index  on DBLP (title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_04.sqlpp
index 2e37aef..38433b3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_04.sqlpp
@@ -49,9 +49,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index title_index_DBLP  on DBLP (title:string) type btree enforced;
+create  index title_index_DBLP  on DBLP (title:string?) type btree enforced;
 
-create  index title_index  on CSX (title:string) type btree enforced;
+create  index title_index  on CSX (title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_05.sqlpp
index e9efb14..2de47db 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index-join/secondary-equi-join_05.sqlpp
@@ -50,7 +50,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index title_index  on DBLP (title:string) type btree enforced;
+create  index title_index  on DBLP (title:string?) type btree enforced;
 
 write output to asterix_nc1:"rttest/btree-index-join_title-secondary-equi-join_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-33.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-33.sqlpp
index 60c5537..779c692 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-33.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-33.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-34.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-34.sqlpp
index f08701c..6fa7129 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-34.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-34.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-35.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-35.sqlpp
index 8be617e..8d70329 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-35.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-35.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-36.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-36.sqlpp
index c5568e8..f8d9d42 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-36.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-36.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-37.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-37.sqlpp
index fc12344..0d42542 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-37.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-37.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-38.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-38.sqlpp
index 3b51449..6c1484f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-38.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-38.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-39.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-39.sqlpp
index b8664ba..470371d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-39.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-39.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-40.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-40.sqlpp
index aaa2cae..53e28b2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-40.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-40.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-41.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-41.sqlpp
index 857747b..a61472e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-41.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-41.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-42.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-42.sqlpp
index 44350fb..bf5d991 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-42.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-42.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-43.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-43.sqlpp
index af919aa..9cafc3d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-43.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-43.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-44.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-44.sqlpp
index 336afb9..a22e584 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-44.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-44.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-45.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-45.sqlpp
index 69807a3..559eae7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-45.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-45.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-46.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-46.sqlpp
index 5ae186c..a99dd51 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-46.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-46.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-47.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-47.sqlpp
index 3070b14..4acdaec 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-47.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-47.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-48.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-48.sqlpp
index 594e2c6..fc4c337 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-48.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-48.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-49.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-49.sqlpp
index 2e2c324..bdd2f4f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-49.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-49.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-50.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-50.sqlpp
index 5ff6031..98c77d0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-50.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-50.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-51.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-51.sqlpp
index f1c7bc8..4f044d5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-51.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-51.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-52.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-52.sqlpp
index d29a989..ac6204e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-52.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-52.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-53.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-53.sqlpp
index 6bb07a7..9a33de7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-53.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-53.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-54.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-54.sqlpp
index eb12a20..ace6571 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-54.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-54.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-55.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-55.sqlpp
index 2d1188c..05474eb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-55.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-55.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-56.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-56.sqlpp
index ec7550d..e25c194 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-56.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-56.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-57.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-57.sqlpp
index 24bc22b..00b051a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-57.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-57.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-58.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-58.sqlpp
index 43d58a8..25d73b7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-58.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-58.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-59.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-59.sqlpp
index d240860..8191f0f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-59.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-59.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-60.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-60.sqlpp
index 8f9a70d..9f36714 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-60.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-60.sqlpp
@@ -37,7 +37,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-61.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-61.sqlpp
index 1dce202..d93d050 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-61.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-61.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-62.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-62.sqlpp
index e619a40..bd9dbde 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-62.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-62.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-63.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-63.sqlpp
index af67888..ff21c62 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-63.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/btree-index/btree-secondary-63.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset testdst(TestType) primary key id;
 
-create  index sec_Idx  on testdst (fname:string,lname:string) type btree enforced;
+create  index sec_Idx  on testdst (fname:string?,lname:string?) type btree enforced;
 
 select element emp
 from  testdst as emp
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains-panic.sqlpp
index 1e15b91..5d68915 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains-panic.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains.sqlpp
index 3322208..d38ef2b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-contains.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-contains.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp
index 87f21c5..9b64cc7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check-panic.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.sqlpp
index ea669aa..699dc8d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-check.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-check.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.sqlpp
index b72c6fb..1511d64 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance-panic.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance.sqlpp
index a9847ed..a7a30db 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-edit-distance.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-edit-distance.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp
index 2bd2898..8d432a9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-edit-distance.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-edit-distance.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp
index d6feec3..854bc96 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-fuzzyeq-jaccard.sqlpp
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-fuzzyeq-jaccard.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.sqlpp
index c6befb8..f328d01 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard-check.sqlpp
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard-check.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard.sqlpp
index 5a05d5c..517114d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/ngram-jaccard.sqlpp
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_ngram-jaccard.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-contains.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-contains.sqlpp
index a8e018e..3e00096 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-contains.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-contains.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-contains.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp
index ceed5e8..18ae26f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-fuzzyeq-jaccard.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-fuzzyeq-jaccard.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.sqlpp
index 442879a..b58e497 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard-check.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard-check.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard.sqlpp
index 60c8f9b..4a89048 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-basic/word-jaccard.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-basic_word-jaccard.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp
index 29cac05..4fdab8e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.sqlpp
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp
index 8b31c20..6171717 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.sqlpp
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic-nopanic_01.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp
index 90ed452..b4d2177 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let-panic.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let-panic.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.sqlpp
index efefde8..b5d282a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-let.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp
index 2d7603b..7b28866 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-substring.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-substring.adm"
 select element {'id':paper.id,'title':paper.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp
index 8e9cea3..852054b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-edit-distance-check-word-tokens.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-word-tokens.adm"
 select element {'id':paper.id,'title':paper.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.sqlpp
index 9a7984b..21ad762 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-let.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-let.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp
index a619410..2a6586f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/ngram-jaccard-check-multi-let.sqlpp
@@ -41,7 +41,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_ngram-jaccard-check-multi-let.adm"
 select element {'Paper':paper_tokens,'Query':query_tokens}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.sqlpp
index 359c6e3..2944116 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-let.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-let.adm"
 select element o
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.sqlpp
index 5c6bed0..c243de3 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-complex/word-jaccard-check-multi-let.sqlpp
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-complex_word-jaccard-check-multi-let.adm"
 select element {'Paper':paper_tokens,'Query':query_tokens}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp
index 205dcca..6b0ddcb 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/leftouterjoin-probe-pidx-with-join-edit-distance-check-idx_01.sqlpp
@@ -52,7 +52,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index msgNgramIx  on TweetMessages (`message-text`:string) type ngram (3) enforced;
+create  index msgNgramIx  on TweetMessages (`message-text`:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_leftouterjoin-probe-pidx-with-join-edit-distance-check_idx_01.adm"
 select element {'tweet':{'id':t1.tweetid,'topics':t1.`message-text`},'similar-tweets':(
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_01.sqlpp
index 75de2d0..5f7784a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_01.sqlpp
@@ -48,7 +48,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-01.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_02.sqlpp
index 1f8cb64..4395090 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_02.sqlpp
@@ -48,7 +48,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-02.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_03.sqlpp
index a0450f0..4e0304f 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_03.sqlpp
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-03.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_04.sqlpp
index b7943cb..71493d2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-contains_04.sqlpp
@@ -47,9 +47,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-contains-04.adm"
 select element {'title1':o1.title,'title2':o2.title}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.sqlpp
index b40d706..92f20c0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.sqlpp
index 7c0949b..a23cd60 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  CSX has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.sqlpp
index 121818f..686eb4e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance-check function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.sqlpp
index 218b885..6efa6e5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  DBLP and CSX both have a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -48,9 +48,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (authors:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (authors:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.sqlpp
index 665edb3..4548442 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_05.sqlpp
@@ -18,8 +18,8 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance-check function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we *do not* expect the join to be transformed
- *                  into an indexed nested-loop join, because CSX does not declare an enforced open index on field authors.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we *do not* expect the join to be transformed
+ *                  into an indexed nested-loop join?, because CSX does not declare an enforced open index on field authors.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.sqlpp
index 0585b75..7af7b74 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-check_inline_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance-check function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-check_04.adm"
 select element {'arec':a,'brec':b,'ed':ed[1]}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.sqlpp
index ae188a5..19e9103 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance-contains.sqlpp
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance-contains.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_01.sqlpp
index 04c6dc5..f1f44fc 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_02.sqlpp
index 630c5d8..3d2cfe9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  CSX has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_03.sqlpp
index 4d06996..0c3e0fd 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_04.sqlpp
index 277f7d0..3384697 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  DBLP and CSX both have a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -48,9 +48,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (authors:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (authors:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_05.sqlpp
index 7317b62..74bbff0 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_05.sqlpp
@@ -18,8 +18,8 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the edit-distance function of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we *do not* expect the join to be transformed
- *                  into an indexed nested-loop join, because CSX does not declare an enforced open index on field authors.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we *do not* expect the join to be transformed
+ *                  into an indexed nested-loop join?, because CSX does not declare an enforced open index on field authors.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.sqlpp
index 493436b..20b0538 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-edit-distance_inline_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the edit-distance function of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-edit-distance_03.adm"
 select element {'arec':a,'brec':b,'ed':ed}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp
index 53e9b0c..9acbd12 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (authors:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp
index 28a5e16..3100d09 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  CSX has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp
index a928b12..99c408a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on ~= using edit distance of its authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_03.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp
index 5856ece..14dd5d9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  DBLP and CSX both have a 3-gram enforced open index on authors, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on authors?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -48,9 +48,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (authors:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (authors:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp
index ea1c90d..c0aff9a 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-edit-distance_05.sqlpp
@@ -18,8 +18,8 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using edit distance of their authors.
- *                  DBLP has a 3-gram enforced open index on authors, and we *do not* expect the join to be transformed
- *                  into an indexed nested-loop join, because CSX does not declare an enforced open index on field authors.
+ *                  DBLP has a 3-gram enforced open index on authors?, and we *do not* expect the join to be transformed
+ *                  into an indexed nested-loop join?, because CSX does not declare an enforced open index on field authors.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (authors:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-edit-distance_01.adm"
 set `simfunction` `edit-distance`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp
index 0da6ef3..067e6ec 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, open DBLP and closed CSX, based on ~= using Jaccard of their titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -51,7 +51,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp
index 0a0dd69..6b0383e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, closed DBLP and open CSX, based on ~= using Jaccard their titles' 3-gram tokens.
- *                  CSX has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -51,7 +51,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_02.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp
index 4e45b92..9ec39b5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on ~= using Jaccard of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_03.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp
index a0d57aa..f6067a2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-fuzzyeq-jaccard_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' 3-gram tokens.
- *                  DBLP and CSX both have a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -50,9 +50,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.sqlpp
index c390e53..5501396 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, open DBLP and closed CSX, based on the similarity-jaccard-check function of their titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -51,7 +51,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.sqlpp
index 9a78b36..be7cbe6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, closed DBLP and open CSX, based the similarity-jaccard-check function of their titles' 3-gram tokens.
- *                  CSX has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -51,7 +51,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.sqlpp
index 65ef1c4..6eb317c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins an open dataset DBLP, based on the similarity-jaccard-check function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.sqlpp
index 44ca5c8..e60a740 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based the similarity-jaccard-check function of their titles' 3-gram tokens.
- *                  DBLP and CSX both have a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -50,9 +50,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.sqlpp
index 7d6a926..d143688 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard-check_inline_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -41,7 +41,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard-check_04.adm"
 select element {'arec':a,'brec':b,'jacc':jacc[1]}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_01.sqlpp
index b76807b..da0394b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -51,7 +51,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_02.sqlpp
index 949be8b..e119237 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based the similarity-jaccard function of their titles' 3-gram tokens.
- *                  CSX has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -51,7 +51,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_03.sqlpp
index bea4b07..bad8e2e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -40,7 +40,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_04.sqlpp
index 1608286..63f42fa 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based the similarity-jaccard function of their titles' 3-gram tokens.
- *                  DBLP and CSX both have a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -50,9 +50,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index ngram_index_DBLP  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index_DBLP  on DBLP (title:string?) type ngram (3) enforced;
 
-create  index ngram_index_CSX  on CSX (title:string) type ngram (3) enforced;
+create  index ngram_index_CSX  on CSX (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.sqlpp
index 5823019..977f9f6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/ngram-jaccard_inline_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' 3-gram tokens.
- *                  DBLP has a 3-gram enforced open index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has a 3-gram enforced open index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -41,7 +41,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_ngram-jaccard_04.adm"
 select element {'arec':a,'brec':b,'jacc':jacc}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp
index c618a32..76c7f87 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp
index 2614272..51ba227 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
- *                  CSX has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index  on CSX (title:string) type keyword enforced;
+create  index keyword_index  on CSX (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_02.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp
index abf363c..9c9597b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on ~= using Jaccard of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_03.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp
index c02fd09..3874ec6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-fuzzyeq-jaccard_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on ~= using Jaccard of their titles' word tokens.
- *                  DBLP and CSX both have an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -48,9 +48,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index_DBLP  on DBLP (title:string) type keyword enforced;
+create  index keyword_index_DBLP  on DBLP (title:string?) type keyword enforced;
 
-create  index keyword_index_CSX  on CSX (title:string) type keyword enforced;
+create  index keyword_index_CSX  on CSX (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-fuzzyeq-jaccard_01.adm"
 set `simfunction` `jaccard`;
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp
index 4309d3d..81bce6b 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check-after-btree-access.sqlpp
@@ -59,7 +59,7 @@
 
 create  index msgCountBIx  on TweetMessages (countB) type btree;
 
-create  index msgTextIx  on TweetMessages (`message-text`:string) type keyword enforced;
+create  index msgTextIx  on TweetMessages (`message-text`:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check-after-btree-access.adm"
 select element {'t1':t1.tweetid,'t2':t2.tweetid,'sim':sim[1]}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.sqlpp
index f9f08ab..a8a2b79 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard-check function of their titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.sqlpp
index 1e636ec..bb70c14 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard-check function of their titles' word tokens.
- *                  CSX has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index  on CSX (title:string) type keyword enforced;
+create  index keyword_index  on CSX (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.sqlpp
index 2a7f110..818cef6 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.sqlpp
index 9385354..2dc7c71 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard-check function of their titles' word tokens.
- *                  DBLP and CSX both have an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -48,9 +48,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index_DBLP  on DBLP (title:string) type keyword enforced;
+create  index keyword_index_DBLP  on DBLP (title:string?) type keyword enforced;
 
-create  index keyword_index_CSX  on CSX (title:string) type keyword enforced;
+create  index keyword_index_CSX  on CSX (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.sqlpp
index 3bd1707..aefcbfe 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard-check_inline_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard-check function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard-check_04.adm"
 select element {'arec':a,'brec':b,'jacc':jacc[1]}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_01.sqlpp
index 54f8e39..8050164 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_02.sqlpp
index 7ce3e0a..b343255 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- *                  CSX has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  CSX has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -49,7 +49,7 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index  on CSX (title:string) type keyword enforced;
+create  index keyword_index  on CSX (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_02.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_03.sqlpp
index b3a79ad..3396a88 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -38,7 +38,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_03.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_04.sqlpp
index 978f754..9ec32c8 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy joins two datasets, DBLP and CSX, based on the similarity-jaccard function of their titles' word tokens.
- *                  DBLP and CSX both have an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP and CSX both have an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
@@ -48,9 +48,9 @@
 
 create  dataset CSX(CSXType) primary key id;
 
-create  index keyword_index_DBLP  on DBLP (title:string) type keyword enforced;
+create  index keyword_index_DBLP  on DBLP (title:string?) type keyword enforced;
 
-create  index keyword_index_CSX  on CSX (title:string) type keyword enforced;
+create  index keyword_index_CSX  on CSX (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_01.adm"
 select element {'arec':a,'brec':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_inline_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_inline_03.sqlpp
index 30f9835..36cbcea 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_inline_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/inverted-index-join/word-jaccard_inline_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Fuzzy self joins a dataset, DBLP, based on the similarity-jaccard function of its titles' word tokens.
- *                  DBLP has an enforced open keyword index on title, and we expect the join to be transformed into an indexed nested-loop join.
+ *                  DBLP has an enforced open keyword index on title?, and we expect the join to be transformed into an indexed nested-loop join.
  *                  We test the inlining of variables that enable the select to be pushed into the join for subsequent optimization with an index.
  * Success        : Yes
  */
@@ -39,7 +39,7 @@
 
 create  dataset DBLP(DBLPType) primary key id;
 
-create  index keyword_index  on DBLP (title:string) type keyword enforced;
+create  index keyword_index  on DBLP (title:string?) type keyword enforced;
 
 write output to asterix_nc1:"rttest/inverted-index-join_word-jaccard_04.adm"
 select element {'arec':a,'brec':b,'jacc':jacc}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp
index 8698195..9bf6da7 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_01.sqlpp
@@ -52,7 +52,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index twmSndLocIx  on TweetMessages (`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (`sender-location`:point?) type rtree enforced;
 
 create  index msgCountAIx  on TweetMessages (countA) type btree;
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp
index 40b2a53..07b14fd 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/leftouterjoin-probe-pidx-with-join-rtree-sidx_02.sqlpp
@@ -52,7 +52,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid;
 
-create  index twmSndLocIx  on TweetMessages (`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (`sender-location`:point?) type rtree enforced;
 
 create  index msgCountAIx  on TweetMessages (countA) type btree;
 
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_01.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_01.sqlpp
index 81e6945d..d073c92 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_01.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_01.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData1' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -56,7 +56,7 @@
 
 create  dataset MyData2(MyRecord) primary key id;
 
-create  index rtree_index  on MyData1 (point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/index-join_rtree-spatial-intersect-point.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_02.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_02.sqlpp
index dcb9eb7..254b252 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_02.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_02.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData2' has an enforced open RTree index, and we expect the
+ *                  The dataset 'MyData2' has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -56,7 +56,7 @@
 
 create  dataset MyData2(MyRecordOpen) primary key id;
 
-create  index rtree_index  on MyData2 (point:point) type rtree enforced;
+create  index rtree_index  on MyData2 (point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_03.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_03.sqlpp
index 2f6a2ba..3741459 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_03.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_03.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Self-joins a dataset on the intersection of its point attribute.
- *                  The dataset has an enforced open RTree index, and we expect the
+ *                  The dataset has an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -42,7 +42,7 @@
 
 create  dataset MyData(MyRecord) primary key id;
 
-create  index rtree_index  on MyData (point:point) type rtree enforced;
+create  index rtree_index  on MyData (point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_03.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_04.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_04.sqlpp
index 947c57f..ef5f0ae 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_04.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_04.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index, and we expect the
+ *                  Both datasets 'MyData' and 'MyData2' have an enforced open RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -44,9 +44,9 @@
 
 create  dataset MyData2(MyRecord) primary key id;
 
-create  index rtree_index  on MyData1 (point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (point:point?) type rtree enforced;
 
-create  index rtree_index2  on MyData2 (point:point) type rtree enforced;
+create  index rtree_index2  on MyData2 (point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_05.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_05.sqlpp
index 8f5b2a7..d58b8f5 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_05.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries_sqlpp/open-index-enforced/rtree-index-join/spatial-intersect-point_05.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  Only dataset 'MyData1' has an enforced open RTree index, hence we
+ *                  Only dataset 'MyData1' has an enforced open RTree index?, hence we
  *                  *do not* expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -44,7 +44,7 @@
 
 create  dataset MyData2(MyRecord) primary key id;
 
-create  index rtree_index  on MyData1 (point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (point:point?) type rtree enforced;
 
 write output to asterix_nc1:"rttest/rtree-index-join_spatial-intersect-point_02.adm"
 select element {'a':a,'b':b}
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
index 76e8892..e5c25e4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
@@ -48,17 +48,17 @@
 
 create index rtree_index_point on t1(locn) type rtree;
 
-create index rtree_index_point_open on t1(open_locn:point) type rtree enforced;
+create index rtree_index_point_open on t1(open_locn:point?) type rtree enforced;
 
 create index keyWD_indx on t1(name) type keyword;
 
-create index keyWD_indx_open on t1(nickname:string) type keyword enforced;
+create index keyWD_indx_open on t1(nickname:string?) type keyword enforced;
 
 create index secndIndx on t1(zip);
 
 create index nested on t1(person.name.first);
 
-create index secndIndx_open on t1(address:string) enforced;
+create index secndIndx_open on t1(address:string?) enforced;
 
 drop index t1.rtree_index_point;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.aql
index 4dfcef7..3540a77 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.aql
@@ -45,4 +45,4 @@
 create dataset test.employee(Emp) primary key id;
 create dataset test.employeeClosed(EmpClosed) primary key id;
 
-create index idx_employee_first_name on test.employee(fname:string) enforced;
+create index idx_employee_first_name on test.employee(fname:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.1.ddl.aql
index d834ef3..85b9326 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.1.ddl.aql
@@ -64,5 +64,5 @@
 create dataset LineItem(LineItemType)
   primary key l_orderkey, l_linenumber;
 
-create index idx_partkey_open on LineItemOpen(l_partkey:int64) enforced;
+create index idx_partkey_open on LineItemOpen(l_partkey:int64?) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open_02/load-with-index-open_02.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open_02/load-with-index-open_02.1.ddl.aql
index f736ebc..eb0db81 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open_02/load-with-index-open_02.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open_02/load-with-index-open_02.1.ddl.aql
@@ -25,6 +25,6 @@
 
 create dataset FacebookMessages(FacebookMessageType)
 primary key message-id;
-create index fbAuthorIdx on FacebookMessages(author-id: int64) type btree enforced;
-create index fbSenderLocIndex on FacebookMessages(sender-location: point) type rtree enforced;
-create index fbMessageIdx on FacebookMessages(message: string) type keyword enforced;
+create index fbAuthorIdx on FacebookMessages(author-id: int64?) type btree enforced;
+create index fbSenderLocIndex on FacebookMessages(sender-location: point?) type rtree enforced;
+create index fbMessageIdx on FacebookMessages(message: string?) type keyword enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.aql
index ba4e975..52eb1d9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.aql
@@ -40,4 +40,4 @@
 
 create dataset DBLPOpen(DBLPTypeOpen) primary key id;
 
-create index ngram_index_open on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index_open on DBLPOpen(title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.aql
index b46bc13..b93cb12 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.aql
@@ -50,5 +50,5 @@
 create dataset MyDataOpen(MyRecordOpen)
   primary key id;
 
-create index rtree_index_point on MyDataOpen(point:point) type rtree enforced;
+create index rtree_index_point on MyDataOpen(point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.aql
index bde54cc..c08c61c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.aql
@@ -40,4 +40,4 @@
 
 create dataset DBLPOpen(DBLPTypeOpen) primary key id;
 
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.aql
index c800877..38baed5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.aql
@@ -18,5 +18,5 @@
  */
 use dataverse test;
 
-create index age_index on CustomersOpen(age:int32) enforced;
+create index age_index on CustomersOpen(age:int32?) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.aql
index d7c2af5..1b26fcf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.aql
@@ -25,4 +25,4 @@
 
 use dataverse test;
 
-create index ngram_index on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.aql
index 865189d..0f776ba 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.aql
@@ -25,4 +25,4 @@
 
 use dataverse test;
 
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.aql
index 590818c..aa0ec0f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index rtree_index_point on MyDataOpen(point:point) type rtree enforced;
+create index rtree_index_point on MyDataOpen(point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.aql
index c800877..38baed5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.aql
@@ -18,5 +18,5 @@
  */
 use dataverse test;
 
-create index age_index on CustomersOpen(age:int32) enforced;
+create index age_index on CustomersOpen(age:int32?) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.aql
index 6bfe35c..064c1d3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.aql
@@ -26,4 +26,4 @@
 use dataverse test;
 
 create index ngram_index on DBLP(title) type ngram(3);
-create index ngram_index1 on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index1 on DBLPOpen(title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.aql
index 4f0fe96..f7b84fc 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.aql
@@ -26,4 +26,4 @@
 use dataverse test;
 
 create index keyword_index on DBLP(title) type keyword;
-create index keyword_index1 on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index1 on DBLPOpen(title:string?) type keyword enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.aql
index 4ff97e2..b03edfb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.aql
@@ -26,5 +26,5 @@
 use dataverse test;
 
 create index rtree_index_point_0 on MyData(point) type rtree;
-create index rtree_index_point on MyOpenData(point:point) type rtree enforced;
+create index rtree_index_point on MyOpenData(point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-open-index-in-meta/change-feed-with-meta-open-index-in-meta.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-open-index-in-meta/change-feed-with-meta-open-index-in-meta.1.ddl.aql
index 3289999..8d923c5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-open-index-in-meta/change-feed-with-meta-open-index-in-meta.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-open-index-in-meta/change-feed-with-meta-open-index-in-meta.1.ddl.aql
@@ -56,4 +56,4 @@
     ("num-of-records"="1000")
 );
 
-create index OpenIndex on KVStore(meta().id:int32) enforced;
\ No newline at end of file
+create index OpenIndex on KVStore(meta().id:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest.3.ddl.aql
index 5bfc09b..e0965b9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest/change-feed-with-meta-pk-in-meta-index-with-missing-after-ingest.3.ddl.aql
@@ -24,4 +24,4 @@
  */
 use dataverse KeyVerse;
 
-create index VBucketIndex on KVStore(exp:int32) enforced;
\ No newline at end of file
+create index VBucketIndex on KVStore(exp:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-in-value/change-feed-with-meta-pk-in-meta-open-index-in-value.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-in-value/change-feed-with-meta-pk-in-meta-open-index-in-value.1.ddl.aql
index 0ae91fa..3ef8603 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-in-value/change-feed-with-meta-pk-in-meta-open-index-in-value.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-in-value/change-feed-with-meta-pk-in-meta-open-index-in-value.1.ddl.aql
@@ -56,4 +56,4 @@
     ("num-of-records"="1000")
 );
 
-create index OpenIndex on KVStore(id:int32) enforced;
\ No newline at end of file
+create index OpenIndex on KVStore(id:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-with-missing/change-feed-with-meta-pk-in-meta-open-index-with-missing.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-with-missing/change-feed-with-meta-pk-in-meta-open-index-with-missing.1.ddl.aql
index 3cf9374..8689c91 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-with-missing/change-feed-with-meta-pk-in-meta-open-index-with-missing.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/change-feed-with-meta-pk-in-meta-open-index-with-missing/change-feed-with-meta-pk-in-meta-open-index-with-missing.1.ddl.aql
@@ -56,4 +56,4 @@
     ("num-of-records"="1000")
 );
 
-create index OpenIndex on KVStore(exp:int32) enforced;
\ No newline at end of file
+create index OpenIndex on KVStore(exp:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-open-index/feed-with-external-parser-with-open-index.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-open-index/feed-with-external-parser-with-open-index.3.ddl.aql
index 16d3ba4..df82fd0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-open-index/feed-with-external-parser-with-open-index.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-open-index/feed-with-external-parser-with-open-index.3.ddl.aql
@@ -25,7 +25,7 @@
  */
 use dataverse externallibtest;
 create dataset Condor(Classad) primary key GlobalJobId;
-create index BlockWritesIndex on Condor(BlockWrites:int64) enforced;
+create index BlockWritesIndex on Condor(BlockWrites:int64?) enforced;
 
 create feed CondorFeed using push_localfs(
 ("path"="asterix_nc1://data/external-parser/dropbox/jobads1.txt,asterix_nc1://data/external-parser/dropbox/jobads2.txt, asterix_nc1://data/external-parser/dropbox2/jobads3.txt"),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-two-open-indexes/feed-with-external-parser-with-two-open-indexes.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-two-open-indexes/feed-with-external-parser-with-two-open-indexes.3.ddl.aql
index 10a4117..fa9b833 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-two-open-indexes/feed-with-external-parser-with-two-open-indexes.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-external-parser-with-two-open-indexes/feed-with-external-parser-with-two-open-indexes.3.ddl.aql
@@ -25,8 +25,8 @@
  */
 use dataverse externallibtest;
 create dataset Condor(Classad) primary key GlobalJobId;
-create index BlockWritesIndex on Condor(BlockWrites:int64) enforced;
-create index JobStartDateIndex on Condor(JobStartDate:int64) enforced;
+create index BlockWritesIndex on Condor(BlockWrites:int64?) enforced;
+create index JobStartDateIndex on Condor(JobStartDate:int64?) enforced;
 
 create feed CondorFeed using push_localfs(
 ("path"="asterix_nc1://data/external-parser/dropbox/jobads1.txt,asterix_nc1://data/external-parser/dropbox/jobads2.txt, asterix_nc1://data/external-parser/dropbox2/jobads3.txt"),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-multiple-indexes/feed-with-multiple-indexes.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-multiple-indexes/feed-with-multiple-indexes.1.ddl.aql
index 0a8509b..b27692d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-multiple-indexes/feed-with-multiple-indexes.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/feeds/feed-with-multiple-indexes/feed-with-multiple-indexes.1.ddl.aql
@@ -42,8 +42,8 @@
  };
 
 create dataset Condor(Classad) primary key GlobalJobId;
-create index caRequestCpusIdx on Condor(RequestCpus:int64) type btree enforced;
+create index caRequestCpusIdx on Condor(RequestCpus:int64?) type btree enforced;
 create index caRemoteWallClockTimeIdx on Condor(RemoteWallClockTime) type btree;
-create index caUserIdx on Condor(User:string) type btree enforced;
-create index caScheddIdx on Condor(Schedd:string) type btree enforced;
-create index caRemoteHostIdx on Condor(RemoteHost:string) type btree enforced;
+create index caUserIdx on Condor(User:string?) type btree enforced;
+create index caScheddIdx on Condor(Schedd:string?) type btree enforced;
+create index caRemoteHostIdx on Condor(RemoteHost:string?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.aql
index 5ab7ba6..325f0a3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.aql
@@ -47,4 +47,4 @@
 using hdfs
 (("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/spatialDataNested.json"),("input-format"="text-input-format"),("input-format"="text-input-format"),("format"="adm"));
 
-create index idx on MyData(nested.id:int32) enforced;
+create index idx on MyData(nested.id:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
index c62b90d..5010e18 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
@@ -49,8 +49,8 @@
 
 create external dataset TweetMessages(TweetMessageType) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/tw_for_indexleftouterjoin_nested.adm"),("input-format"="text-input-format"),("format"="adm"));
 
-create index IdIx on TweetMessages(nested.tweetid:int64) type btree enforced;
-create index msgCountAIx on TweetMessages(nested.countA:int64) type btree enforced;
-create index msgCountBIx on TweetMessages(nested.countB:int64) type btree enforced;
-create index twmSndLocIx on TweetMessages(nested.sender-location:point) type rtree enforced;
+create index IdIx on TweetMessages(nested.tweetid:int64?) type btree enforced;
+create index msgCountAIx on TweetMessages(nested.countA:int64?) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB:int64?) type btree enforced;
+create index twmSndLocIx on TweetMessages(nested.sender-location:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
index 887f564..9095472 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
@@ -50,6 +50,6 @@
 
 create external dataset TweetMessages(TweetMessageType) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/tw_for_indexleftouterjoin_nested.adm"),("input-format"="text-input-format"),("format"="adm"));
 
-create index IdIx on TweetMessages(nested.tweetid:int64) type btree enforced;
-create index msgCountAIx on TweetMessages(nested.countA:int64) type btree enforced;
-create index msgCountBIx on TweetMessages(nested.countB:int64) type btree enforced;
+create index IdIx on TweetMessages(nested.tweetid:int64?) type btree enforced;
+create index msgCountAIx on TweetMessages(nested.countA:int64?) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB:int64?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.aql
index 639e4cb..5ee5d58 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.aql
@@ -37,4 +37,4 @@
 
 create external dataset MyData(MyRecord) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/spatialDataNested.json"),("input-format"="text-input-format"),("format"="adm"));
 
-create index rtree_index_point on MyData(nested.point:point) type rtree enforced;
+create index rtree_index_point on MyData(nested.point:point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.aql
index e729f74..bdb56d1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.aql
@@ -110,16 +110,16 @@
 
 create index genus on GSs(lower.Species);
 
-create index family on FGSs(lower.lower.Species:string) enforced;
+create index family on FGSs(lower.lower.Species:string?) enforced;
 
-create index orda on OFGSs(lower.lower.lower.Species:string) enforced;
+create index orda on OFGSs(lower.lower.lower.Species:string?) enforced;
 
-create index classy on COFGSs(lower.lower.lower.lower.Species:string) enforced;
+create index classy on COFGSs(lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.aql
index dbc09c9..ff4072f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.aql
@@ -109,16 +109,16 @@
 
 create index genus on GSs(lower.Species);
 
-create index family on FGSs(lower.lower.Species:string) enforced;
+create index family on FGSs(lower.lower.Species:string?) enforced;
 
-create index orda on OFGSs(lower.lower.lower.Species:string) enforced;
+create index orda on OFGSs(lower.lower.lower.Species:string?) enforced;
 
-create index classy on COFGSs(lower.lower.lower.lower.Species:string) enforced;
+create index classy on COFGSs(lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.aql
index 2b373f5..09faf1e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.aql
@@ -105,20 +105,20 @@
 create dataset PCOFGSs(PCOFGS)
 primary key id;
 
-create index species on Ss(Species:string) enforced;
+create index species on Ss(Species:string?) enforced;
 
-create index genus on GSs(lower.Species:string) enforced;
+create index genus on GSs(lower.Species:string?) enforced;
 
-create index family on FGSs(lower.lower.Species:string) enforced;
+create index family on FGSs(lower.lower.Species:string?) enforced;
 
-create index orda on OFGSs(lower.lower.lower.Species:string) enforced;
+create index orda on OFGSs(lower.lower.lower.Species:string?) enforced;
 
-create index classy on COFGSs(lower.lower.lower.lower.Species:string) enforced;
+create index classy on COFGSs(lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.aql
index 0c95714..a4f949c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.aql
@@ -104,20 +104,20 @@
 create dataset PCOFGSs(PCOFGS)
 primary key id;
 
-create index species on Ss(Species:string) enforced;
+create index species on Ss(Species:string?) enforced;
 
-create index genus on GSs(lower.Species:string) enforced;
+create index genus on GSs(lower.Species:string?) enforced;
 
-create index family on FGSs(lower.lower.Species:string) enforced;
+create index family on FGSs(lower.lower.Species:string?) enforced;
 
-create index orda on OFGSs(lower.lower.lower.Species:string) enforced;
+create index orda on OFGSs(lower.lower.lower.Species:string?) enforced;
 
-create index classy on COFGSs(lower.lower.lower.lower.Species:string) enforced;
+create index classy on COFGSs(lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on PCOFGSs(lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index phylum on KPCOFGSs(lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index class on Classifications(fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
 
-create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) enforced;
+create index anim on Animals(class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
index 9865109..194ee70 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
index ec6aaf8..cea9a38 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
index 3f0cece..e70acf1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
@@ -18,11 +18,11 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, 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 authors_index on DBLP(nested.authors:string) enforced;
+create index authors_index on DBLP(nested.authors:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
index c0b0514..13fa98c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
index 70f48da..ab49b08 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index ngram_index on Customers(nested.name:string) type ngram(3) enforced;
+create index ngram_index on Customers(nested.name:string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
index f9c8bc0..2b7ba31 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
@@ -24,5 +24,5 @@
 
 use dataverse test;
 
-create index ngram_index on Customers(nested.name:string) type ngram(3) enforced;
+create index ngram_index on Customers(nested.name:string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
index 967c617..30476db 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
index 80acf91..9691508 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
@@ -24,5 +24,5 @@
 
 use dataverse test;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3)  enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3)  enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
index 248e135..515fdf5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
index 16d3105..8b43821 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
index 5272f4c..1b0a50a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
@@ -18,12 +18,12 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
 use dataverse test;
 
-create index rtree_index on MyData1(nested.point:point) type rtree enforced;
+create index rtree_index on MyData1(nested.point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
index a0dc2b9..4fba781 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an  open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an  open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
index 1d32524..3331386 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql
index 4ca19a8..54b117a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.aql
@@ -24,5 +24,5 @@
 
 use dataverse test;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
index b33de4d..66d3924 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
@@ -56,5 +56,5 @@
 create dataset TweetMessagesTmp(TweetMessageNestedType)
 primary key tweetid;
 
-create index msgCountBIx on TweetMessages(nested.countB: int64) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB: int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
index 9b0f229..2ccd297 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
@@ -56,4 +56,4 @@
 create dataset TweetMessagesTmp(TweetMessageNestedType)
 primary key tweetid;
 
-create index msgCountBIx on TweetMessages(nested.countB: int64) type btree enforced;
+create index msgCountBIx on TweetMessages(nested.countB: int64?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
index aa89b93..6b37dc0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
@@ -56,4 +56,4 @@
 create dataset TweetMessagesTmp(TweetMessageNestedType)
 primary key tweetid;
 
-create index msgNgramIx on TweetMessages(nested.message-text: string) type ngram(3) enforced;
+create index msgNgramIx on TweetMessages(nested.message-text: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
index 8399068..2ca2796 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
@@ -56,4 +56,4 @@
 create dataset TweetMessagesTmp(TweetMessageNestedType)
 primary key tweetid;
 
-create index twmSndLocIx on TweetMessages(nested.sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(nested.sender-location: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
index 8399068..2ca2796 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
@@ -56,4 +56,4 @@
 create dataset TweetMessagesTmp(TweetMessageNestedType)
 primary key tweetid;
 
-create index twmSndLocIx on TweetMessages(nested.sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(nested.sender-location: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
index b4e1a6b..dc8c024 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
@@ -28,4 +28,4 @@
 
 use dataverse test;
 
-create index idx_employee_f_l_name on employee(nested.fname:string,nested.lname:string) enforced;
+create index idx_employee_f_l_name on employee(nested.fname:string?,nested.lname:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
index 186817a..29de380 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
@@ -27,4 +27,4 @@
 
 use dataverse test;
 
-create index idx_employee_f_l_name on employee(nested.fname:string,nested.lname:string) enforced;
+create index idx_employee_f_l_name on employee(nested.fname:string?,nested.lname:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
index c5658cc..0ea4e49 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
@@ -21,4 +21,4 @@
 
 // create secondary index on Orders(o_custkey)
 
-create index idx_Orders_Custkey on Orders(nested.o_custkey: int32) enforced;
+create index idx_Orders_Custkey on Orders(nested.o_custkey: int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
index 99bdc28..fdea2cf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
@@ -21,4 +21,4 @@
 
 // create secondary index of type ngram on DBLP(title)
 
-create index ngram_index on DBLP(nested.title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
index 89122a2..ecc5cae 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
index 2232eea..faf099e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
@@ -19,4 +19,4 @@
 
 use dataverse test;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql
index a159456..69423f9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLP(nested.title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
index ba1b4a9..0aee408 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLP(nested.authors: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.authors: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
index 89122a2..ecc5cae 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLP(nested.title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(nested.title: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
index 3f932a3..658aa57 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
@@ -18,5 +18,5 @@
  */
 use dataverse test;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
index 7fcc91f..a76781f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index keyword_index on DBLP(nested.title: string) type keyword enforced;
+create index keyword_index on DBLP(nested.title: string?) type keyword enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
index 59846d2..c6ae517 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse tpch;
 
-create index idx_Orders_Custkey on Orders(nested.o_custkey: int32) enforced;
+create index idx_Orders_Custkey on Orders(nested.o_custkey: int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
index 59846d2..c6ae517 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse tpch;
 
-create index idx_Orders_Custkey on Orders(nested.o_custkey: int32) enforced;
+create index idx_Orders_Custkey on Orders(nested.o_custkey: int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/range-search/range-search.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/range-search/range-search.3.ddl.aql
index 38809ab..cd65f04 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/range-search/range-search.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/range-search/range-search.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index idx_LineItem_suppkey on LineItem(nested.l_suppkey: int32) enforced;
+create index idx_LineItem_suppkey on LineItem(nested.l_suppkey: int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
index 4f32c63..535a543 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index rtree_index_point on MyData(nested.point: point) type rtree enforced;
+create index rtree_index_point on MyData(nested.point: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.aql
index 6ba083d..b3e76f5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.aql
@@ -25,4 +25,4 @@
 }
 
 create dataset testDS(testType) primary key id;
-create index testIdx on testDS(value: string) enforced;
+create index testIdx on testDS(value: string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-collision/index-type-collision.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-collision/index-type-collision.1.ddl.aql
index 84d35b7..782a424 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-collision/index-type-collision.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-collision/index-type-collision.1.ddl.aql
@@ -25,5 +25,5 @@
 }
 
 create dataset testDS(testType) primary key id;
-create index testIdx1 on testDS(value: int32) enforced;
-create index testIdx2 on testDS(value: string) enforced;
+create index testIdx1 on testDS(value: int32?) enforced;
+create index testIdx2 on testDS(value: string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-promotion-collision/index-type-promotion-collision.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-promotion-collision/index-type-promotion-collision.1.ddl.aql
index 6c47032..a8564ab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-promotion-collision/index-type-promotion-collision.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/index-type-promotion-collision/index-type-promotion-collision.1.ddl.aql
@@ -25,5 +25,5 @@
 }
 
 create dataset testDS(testType) primary key id;
-create index testIdx1 on testDS(value: int64) enforced;
-create index testIdx2 on testDS(value: int32) enforced;
+create index testIdx1 on testDS(value: int64?) enforced;
+create index testIdx2 on testDS(value: int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.aql
index 9a6936f..9e6ed67 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.aql
@@ -25,4 +25,4 @@
 }
 
 create dataset testDS(testType) primary key id;
-create index testIdx on testDS(value: string);
+create index testIdx on testDS(value: string?);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-optionality/missing-optionality.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-optionality/missing-optionality.1.ddl.aql
new file mode 100644
index 0000000..7656db6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/missing-optionality/missing-optionality.1.ddl.aql
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+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;
+create index testIdx on testDS(value: string) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/record-type-collision/record-collision.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/record-type-collision/record-collision.1.ddl.aql
index b59dfae..1c88a1c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/record-type-collision/record-collision.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/error-checking/record-type-collision/record-collision.1.ddl.aql
@@ -26,4 +26,4 @@
 }
 
 create dataset testDS(testType) primary key id;
-create index testIdx on testDS(value: int32) enforced;
+create index testIdx on testDS(value: int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.aql
index 4b43a18..4517a63 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.aql
@@ -43,4 +43,4 @@
 using hdfs
 (("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/spatialData.json"),("input-format"="text-input-format"),("format"="adm"));
 
-create index idx on MyData(id:int64) enforced;
+create index idx on MyData(id:int64?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
index 3122a8f..a355b20 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.aql
@@ -45,8 +45,8 @@
 
 create external dataset TweetMessages(TweetMessageType) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/tw_for_indexleftouterjoin.adm"),("input-format"="text-input-format"),("format"="adm"));
 
-create index IdIx on TweetMessages(tweetid:int64) type btree enforced;
-create index msgCountAIx on TweetMessages(countA:int64) type btree enforced;
-create index msgCountBIx on TweetMessages(countB:int64) type btree enforced;
-create index twmSndLocIx on TweetMessages(sender-location:point) type rtree enforced;
+create index IdIx on TweetMessages(tweetid:int64?) type btree enforced;
+create index msgCountAIx on TweetMessages(countA:int64?) type btree enforced;
+create index msgCountBIx on TweetMessages(countB:int64?) type btree enforced;
+create index twmSndLocIx on TweetMessages(sender-location:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
index 535ee52..1a6d283 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.aql
@@ -46,6 +46,6 @@
 
 create external dataset TweetMessages(TweetMessageType) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/tw_for_indexleftouterjoin.adm"),("input-format"="text-input-format"),("format"="adm"));
 
-create index IdIx on TweetMessages(tweetid:int64) type btree enforced;
-create index msgCountAIx on TweetMessages(countA:int64) type btree enforced;
-create index msgCountBIx on TweetMessages(countB:int64) type btree enforced;
+create index IdIx on TweetMessages(tweetid:int64?) type btree enforced;
+create index msgCountAIx on TweetMessages(countA:int64?) type btree enforced;
+create index msgCountBIx on TweetMessages(countB:int64?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.aql
index 34b9c3e..3e313f1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.aql
@@ -33,4 +33,4 @@
 
 create external dataset MyData(MyRecord) using hdfs(("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/spatialData.json"),("input-format"="text-input-format"),("format"="adm"));
 
-create index rtree_index_point on MyData(point:point) type rtree enforced;
+create index rtree_index_point on MyData(point:point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
index 81949f4..5248c55 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
index 37f4f41..86fb52c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
index 1db9a87..5ece4be 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.aql
@@ -18,12 +18,12 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, 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 authors_index on DBLPOpen(authors:string) enforced;
+create index authors_index on DBLPOpen(authors:string?) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
index 8106ffe..fbafb5e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
index 196afce..9490ee5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index ngram_index on Customers(name:string) type ngram(3) enforced;
+create index ngram_index on Customers(name:string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
index 9d7610c..9a5467b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.aql
@@ -24,5 +24,5 @@
 
 use dataverse test;
 
-create index ngram_index on Customers(name:string) type ngram(3) enforced;
+create index ngram_index on Customers(name:string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
index fc82b8d..5951576 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index ngram_index on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
index e2a34fa..3802aca 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.aql
@@ -24,5 +24,5 @@
 
 use dataverse test;
 
-create index ngram_index on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
index 2e3604a..f4bc771 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
index 41d2d86..e3df03c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
index 6c28aec..5e8df03 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.aql
@@ -18,12 +18,12 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
 
 use dataverse test;
 
-create index rtree_index on MyData1(point:point) type rtree enforced;
+create index rtree_index on MyData1(point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
index 4ff6999..1fd4c98 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an  open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an  open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
index c2f694d..b2e5bde 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.aql
@@ -25,5 +25,5 @@
 
 use dataverse test;
 
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.aql
index 2e20d37..0c030f9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.aql
@@ -24,5 +24,5 @@
 
 use dataverse test;
 
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
index 8d42545..611422c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.aql
@@ -52,4 +52,4 @@
 create dataset TweetMessagesTmp(TweetMessageType)
 primary key tweetid;
 
-create index msgCountBIx on TweetMessages(countB: int64) type btree enforced;
+create index msgCountBIx on TweetMessages(countB: int64?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
index 8d42545..611422c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.aql
@@ -52,4 +52,4 @@
 create dataset TweetMessagesTmp(TweetMessageType)
 primary key tweetid;
 
-create index msgCountBIx on TweetMessages(countB: int64) type btree enforced;
+create index msgCountBIx on TweetMessages(countB: int64?) type btree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
index e68d4d7..bf426bf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.aql
@@ -53,4 +53,4 @@
 primary key tweetid;
 
 
-create index msgNgramIx on TweetMessages(message-text: string) type ngram(3) enforced;
+create index msgNgramIx on TweetMessages(message-text: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
index 8ea607d..5185c06 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.aql
@@ -53,4 +53,4 @@
 primary key tweetid;
 
 
-create index twmSndLocIx on TweetMessages(sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(sender-location: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
index 8ea607d..5185c06 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.aql
@@ -53,4 +53,4 @@
 primary key tweetid;
 
 
-create index twmSndLocIx on TweetMessages(sender-location: point) type rtree enforced;
+create index twmSndLocIx on TweetMessages(sender-location: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql
index 96c1bfe..54da86f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql
index 2330b61..09127b1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
index 55c8cd7..64649c2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
@@ -28,4 +28,4 @@
 
 use dataverse test;
 
-create index idx_employee_f_l_name on employeeOpen(fname:string,lname:string) enforced;
+create index idx_employee_f_l_name on employeeOpen(fname:string?,lname:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql
index ac09b33..1ad615e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
index ff70569..711837a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
index 291e6b5..593ad2e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
@@ -29,4 +29,4 @@
 
 // create secondary index
 
-create index idx_employee_f_l_name on employeeOpen(fname:string,lname:string) enforced;
+create index idx_employee_f_l_name on employeeOpen(fname:string?,lname:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
index bc26752..1c7ae06 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
index 00d93e8..22e396f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.aql
@@ -21,4 +21,4 @@
 
 // create secondary index on OrdersOpen(o_custkey)
 
-create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32) enforced;
+create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
index f8257db..a450caf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.aql
@@ -21,4 +21,4 @@
 
 // create secondary index of type ngram on DBLPOpen(title)
 
-create index ngram_index on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
index 878e11f..cc12561 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLP(title: string) type ngram(3) enforced;
+create index ngram_index on DBLP(title: string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
index f506f55..9fcee83 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.aql
@@ -19,4 +19,4 @@
 
 use dataverse test;
 
-create index ngram_index on DBLPOpen(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(authors:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql
index e68a423..ae1f82e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLP(title:string) type ngram(3) enforced;
+create index ngram_index on DBLP(title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
index f506f55..9fcee83 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.aql
@@ -19,4 +19,4 @@
 
 use dataverse test;
 
-create index ngram_index on DBLPOpen(authors:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(authors:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
index a39d6f4..0a6b950 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index ngram_index on DBLPOpen(title:string) type ngram(3) enforced;
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
index 33c4fd5..ab072db 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.aql
@@ -18,5 +18,5 @@
  */
 use dataverse test;
 
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
index 354d1a7..3e52583 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.2.update.aql
index 50b2269..dde8420 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.2.update.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.3.ddl.aql
index 11b0baa..21ca681 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.3.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
@@ -29,5 +29,5 @@
 
 // create secondary index
 
-create index idx_employee_f_l_name on employeeOpen(fname,lname:string) enforced;
-create index idx_employee_l_f_name on employeeOpen(lname:string, fname) enforced;
+create index idx_employee_f_l_name on employeeOpen(fname, lname:string?) enforced;
+create index idx_employee_l_f_name on employeeOpen(lname:string?, fname) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.4.query.aql
index b1f2adf..97aed9a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.4.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.5.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.5.ddl.aql
index 4eaf8e8..21a679a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.5.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.5.ddl.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.6.query.aql
index b1f2adf..97aed9a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.6.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index-composite-key/multi-index-composite-key.6.query.aql
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index/multi-index.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index/multi-index.3.ddl.aql
index 98338b2..e225368 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index/multi-index.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/multi-index/multi-index.3.ddl.aql
@@ -19,6 +19,6 @@
 
 use dataverse test;
 
-create index ngram_index on DBLPOpen(title:string) type ngram(3) enforced;
-create index keyword_index on DBLPOpen(title:string) type keyword enforced;
-create index btree_index on DBLPOpen(title:string) enforced;
\ No newline at end of file
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;
+create index keyword_index on DBLPOpen(title:string?) type keyword enforced;
+create index btree_index on DBLPOpen(title:string?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
index fb86f8d..74947ab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse tpch;
 
-create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32) enforced;
+create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
index fb86f8d..74947ab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse tpch;
 
-create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32) enforced;
+create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/range-search/range-search.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/range-search/range-search.3.ddl.aql
index b6e77a1..46f6625 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/range-search/range-search.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/range-search/range-search.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index idx_LineItem_suppkey on LineItemOpen(l_suppkey:int32) enforced;
+create index idx_LineItem_suppkey on LineItemOpen(l_suppkey:int32?) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
index 940863c..21e8190 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.aql
@@ -18,4 +18,4 @@
  */
 use dataverse test;
 
-create index rtree_index_point on MyDataOpen(point: point) type rtree enforced;
+create index rtree_index_point on MyDataOpen(point: point?) type rtree enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
index 43ec9d2..3b6c965 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.aql
@@ -48,17 +48,17 @@
 
 create index rtree_index_point on t1(locn) type rtree;
 
-create index rtree_index_point_open on t1(open_locn:point) type rtree enforced;
+create index rtree_index_point_open on t1(open_locn:point?) type rtree enforced;
 
 create index keyWD_indx on t1(name) type keyword;
 
-create index keyWD_indx_open on t1(nickname:string) type keyword enforced;
+create index keyWD_indx_open on t1(nickname:string?) type keyword enforced;
 
 create index secndIndx on t1(zip);
 
 create index nested on t1(person.name.first);
 
-create index secndIndx_open on t1(address:string) enforced;
+create index secndIndx_open on t1(address:string?) enforced;
 
 drop index t1.rtree_index_point;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/open-index/open-index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/open-index/open-index.1.ddl.aql
index a1755ce..66ce1f8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/open-index/open-index.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/upsert/open-index/open-index.1.ddl.aql
@@ -52,5 +52,5 @@
 create dataset OrdersOpen(OrderOpenType)
 primary key o_orderkey;
 
-create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32) enforced;
+create index idx_Orders_Custkey on OrdersOpen(o_custkey:int32?) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp
index 820ddd2..91830f4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp
@@ -53,17 +53,17 @@
 
 create  index rtree_index_point  on t1 (locn) type rtree;
 
-create  index rtree_index_point_open  on t1 (open_locn:point) type rtree enforced;
+create  index rtree_index_point_open  on t1 (open_locn:point?) type rtree enforced;
 
 create  index keyWD_indx  on t1 (name) type keyword;
 
-create  index keyWD_indx_open  on t1 (nickname:string) type keyword enforced;
+create  index keyWD_indx_open  on t1 (nickname:string?) type keyword enforced;
 
 create  index secndIndx  on t1 (zip) type btree;
 
 create  index nested  on t1 (person.name.first) type btree;
 
-create  index secndIndx_open  on t1 (address:string) type btree enforced;
+create  index secndIndx_open  on t1 (address:string?) type btree enforced;
 
 drop index t1.rtree_index_point;
 drop index t1.rtree_index_point_open;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.sqlpp
index a867fae..9e911e0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/insert-and-scan-dataset-with-index-on-open-field/insert-and-scan-dataset-with-index-on-open-field.1.ddl.sqlpp
@@ -48,5 +48,5 @@
 
 create  dataset test.employeeClosed(EmpClosed) primary key id;
 
-create  index idx_employee_first_name  on test.employee (fname:string) type btree enforced;
+create  index idx_employee_first_name  on test.employee (fname:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-index-open/load-with-index-open.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-index-open/load-with-index-open.1.ddl.sqlpp
index ca3bef1..8df3377 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-index-open/load-with-index-open.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-index-open/load-with-index-open.1.ddl.sqlpp
@@ -66,5 +66,5 @@
 
 create  dataset LineItem(LineItemType) primary key l_orderkey,l_linenumber;
 
-create  index idx_partkey_open  on LineItemOpen (l_partkey:int64) type btree enforced;
+create  index idx_partkey_open  on LineItemOpen (l_partkey:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.sqlpp
index 9d60cc6..8c6fd92 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.sqlpp
@@ -44,5 +44,5 @@
 
 create  dataset DBLPOpen(DBLPTypeOpen) primary key id;
 
-create  index ngram_index_open  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index_open  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.sqlpp
index 45506ef..876926e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.sqlpp
@@ -52,5 +52,5 @@
 
 create  dataset MyDataOpen(MyRecordOpen) primary key id;
 
-create  index rtree_index_point  on MyDataOpen (point:point) type rtree enforced;
+create  index rtree_index_point  on MyDataOpen (point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.sqlpp
index fadb63d..04ba426 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/load-with-word-index-open/load-with-word-index-open.1.ddl.sqlpp
@@ -44,5 +44,5 @@
 
 create  dataset DBLPOpen(DBLPTypeOpen) primary key id;
 
-create  index keyword_index  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.sqlpp
index 7f3e371..8d5f3ea 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index age_index  on CustomersOpen (age:int32) type btree enforced;
+create  index age_index  on CustomersOpen (age:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp
index c708608..8f7f02d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-ngram-secondary-index-open/scan-delete-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.sqlpp
index e8d46d8..44611e4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-inverted-index-word-secondary-index-open/scan-delete-inverted-index-word-secondary-index-open.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index keyword_index  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.sqlpp
index 13d1312..d60a493 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-delete-rtree-secondary-index-open/scan-delete-rtree-secondary-index-open.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index rtree_index_point  on MyDataOpen (point:point) type rtree enforced;
+create  index rtree_index_point  on MyDataOpen (point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.sqlpp
index 7f3e371..8d5f3ea 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-btree-secondary-index-open/scan-insert-btree-secondary-index-open.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index age_index  on CustomersOpen (age:int32) type btree enforced;
+create  index age_index  on CustomersOpen (age:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp
index 9a87a57..766fb58 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-ngram-secondary-index-open/scan-insert-inverted-index-ngram-secondary-index-open.3.ddl.sqlpp
@@ -28,5 +28,5 @@
 
 create  index ngram_index  on DBLP (title) type ngram (3);
 
-create  index ngram_index1  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index1  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.sqlpp
index 8ce9d0f..6d1bbef 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-inverted-index-word-secondary-index-open/scan-insert-inverted-index-word-secondary-index-open.3.ddl.sqlpp
@@ -28,5 +28,5 @@
 
 create  index keyword_index  on DBLP (title) type keyword;
 
-create  index keyword_index1  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index1  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.sqlpp
index 077cf51..c990215 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/dml/scan-insert-rtree-secondary-index-open/scan-insert-rtree-secondary-index-open.3.ddl.sqlpp
@@ -28,5 +28,5 @@
 
 create  index rtree_index_point_0  on MyData (point) type rtree;
 
-create  index rtree_index_point  on MyOpenData (point:point) type rtree enforced;
+create  index rtree_index_point  on MyOpenData (point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q01/q01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q01/q01.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q01/q01.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q01/q01.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q02/q02.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q02/q02.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q02/q02.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q02/q02.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q03/q03.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q03/q03.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q03/q03.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q03/q03.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q04/q04.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q04/q04.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q04/q04.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q04/q04.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q05_error/q05_error.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q05_error/q05_error.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q05_error/q05_error.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q05_error/q05_error.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q06_error/q06_error.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q06_error/q06_error.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q06_error/q06_error.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q06_error/q06_error.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q07_error/q07_error.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q07_error/q07_error.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q07_error/q07_error.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q07_error/q07_error.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q08/q08.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q08/q08.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q08/q08.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q08/q08.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q09/q09.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q09/q09.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q09/q09.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q09/q09.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.1.ddl.sqlpp
index f78afef..04af998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/global-aggregate/q10/q10.1.ddl.sqlpp
@@ -46,6 +46,6 @@
 create  dataset FacebookMessages(FacebookMessageType) primary key `message-id`;
 create  dataset TwitterUsers(TwitterUserType) primary key `screen-name`;
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.sqlpp
index 32325c9..1546363 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/adm-format/adm-format.1.ddl.sqlpp
@@ -48,5 +48,5 @@
 
 create external  dataset MyData(MyRecord) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/spatialDataNested.json`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index idx  on MyData (nested.id:int32) type btree enforced;
+create  index idx  on MyData (nested.id:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp
index a7d11e1..b5d7ed1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp
@@ -54,11 +54,11 @@
 
 create external  dataset TweetMessages(TweetMessageType) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/tw_for_indexleftouterjoin_nested.adm`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index IdIx  on TweetMessages (nested.tweetid:int64) type btree enforced;
+create  index IdIx  on TweetMessages (nested.tweetid:int64?) type btree enforced;
 
-create  index msgCountAIx  on TweetMessages (nested.countA:int64) type btree enforced;
+create  index msgCountAIx  on TweetMessages (nested.countA:int64?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int64?) type btree enforced;
 
-create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp
index 4b6c084..b663dd7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp
@@ -55,9 +55,9 @@
 
 create external  dataset TweetMessages(TweetMessageType) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/tw_for_indexleftouterjoin_nested.adm`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index IdIx  on TweetMessages (nested.tweetid:int64) type btree enforced;
+create  index IdIx  on TweetMessages (nested.tweetid:int64?) type btree enforced;
 
-create  index msgCountAIx  on TweetMessages (nested.countA:int64) type btree enforced;
+create  index msgCountAIx  on TweetMessages (nested.countA:int64?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp
index 05f7b18..260bf63 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp
@@ -42,5 +42,5 @@
 
 create external  dataset MyData(MyRecord) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/spatialDataNested.json`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index rtree_index_point  on MyData (nested.point:point) type rtree enforced;
+create  index rtree_index_point  on MyData (nested.point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.sqlpp
index ff18880..00ff41d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-closed/bottom-closed-top-closed.1.ddl.sqlpp
@@ -111,17 +111,17 @@
 
 create  index genus  on GSs (lower.Species) type btree;
 
-create  index family  on FGSs (lower.lower.Species:string) type btree enforced;
+create  index family  on FGSs (lower.lower.Species:string?) type btree enforced;
 
-create  index orda  on OFGSs (lower.lower.lower.Species:string) type btree enforced;
+create  index orda  on OFGSs (lower.lower.lower.Species:string?) type btree enforced;
 
-create  index classy  on COFGSs (lower.lower.lower.lower.Species:string) type btree enforced;
+create  index classy  on COFGSs (lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.sqlpp
index c6220be..d4d8a31 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-closed-top-open/bottom-closed-top-open.1.ddl.sqlpp
@@ -110,17 +110,17 @@
 
 create  index genus  on GSs (lower.Species) type btree;
 
-create  index family  on FGSs (lower.lower.Species:string) type btree enforced;
+create  index family  on FGSs (lower.lower.Species:string?) type btree enforced;
 
-create  index orda  on OFGSs (lower.lower.lower.Species:string) type btree enforced;
+create  index orda  on OFGSs (lower.lower.lower.Species:string?) type btree enforced;
 
-create  index classy  on COFGSs (lower.lower.lower.lower.Species:string) type btree enforced;
+create  index classy  on COFGSs (lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.sqlpp
index 56fb29d..fa279fb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-closed/bottom-open-top-closed.1.ddl.sqlpp
@@ -106,21 +106,21 @@
 
 create  dataset PCOFGSs(PCOFGS) primary key id;
 
-create  index species  on Ss (Species:string) type btree enforced;
+create  index species  on Ss (Species:string?) type btree enforced;
 
-create  index genus  on GSs (lower.Species:string) type btree enforced;
+create  index genus  on GSs (lower.Species:string?) type btree enforced;
 
-create  index family  on FGSs (lower.lower.Species:string) type btree enforced;
+create  index family  on FGSs (lower.lower.Species:string?) type btree enforced;
 
-create  index orda  on OFGSs (lower.lower.lower.Species:string) type btree enforced;
+create  index orda  on OFGSs (lower.lower.lower.Species:string?) type btree enforced;
 
-create  index classy  on COFGSs (lower.lower.lower.lower.Species:string) type btree enforced;
+create  index classy  on COFGSs (lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.sqlpp
index b57e46a..ef3c02d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/highly-open-highly-nested/bottom-open-top-open/bottom-open-top-open.1.ddl.sqlpp
@@ -105,21 +105,21 @@
 
 create  dataset PCOFGSs(PCOFGS) primary key id;
 
-create  index species  on Ss (Species:string) type btree enforced;
+create  index species  on Ss (Species:string?) type btree enforced;
 
-create  index genus  on GSs (lower.Species:string) type btree enforced;
+create  index genus  on GSs (lower.Species:string?) type btree enforced;
 
-create  index family  on FGSs (lower.lower.Species:string) type btree enforced;
+create  index family  on FGSs (lower.lower.Species:string?) type btree enforced;
 
-create  index orda  on OFGSs (lower.lower.lower.Species:string) type btree enforced;
+create  index orda  on OFGSs (lower.lower.lower.Species:string?) type btree enforced;
 
-create  index classy  on COFGSs (lower.lower.lower.lower.Species:string) type btree enforced;
+create  index classy  on COFGSs (lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on PCOFGSs (lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index phylum  on KPCOFGSs (lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index class  on Classifications (fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
-create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string) type btree enforced;
+create  index anim  on Animals (class.fullClassification.lower.lower.lower.lower.lower.lower.Species:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp
index e169483..65c49a6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp
index 9db5ee6..ab451c3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp
Binary files differ
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp
index 6dedea1..e25647b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index authors_index  on DBLP (nested.authors:string) type btree enforced;
+create  index authors_index  on DBLP (nested.authors:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp
index a50d480..b8e8055 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp
index b90b899..9a037f3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index ngram_index  on Customers (nested.name:string) type ngram (3) enforced;
+create  index ngram_index  on Customers (nested.name:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp
index 7ba9a95..29e67cc 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp
@@ -25,5 +25,5 @@
 use test;
 
 
-create  index ngram_index  on Customers (nested.name:string) type ngram (3) enforced;
+create  index ngram_index  on Customers (nested.name:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp
index ac8d8f4..c7e96b0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp
index 41c42ed..e2af26d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp
@@ -25,5 +25,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp
index 44ac29b..728bb02 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp
index 9b94e56..4d59ba6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp
index cdd168b..cb93b55 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index rtree_index  on MyData1 (nested.point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (nested.point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp
index 7d979b4..547ac16 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an  open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an  open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp
index 05449a9..4efd6f6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp
index e38a83f..cccd5e8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp
@@ -25,5 +25,5 @@
 use test;
 
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp
index 4593449..6125619 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp
@@ -59,5 +59,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageNestedType) primary key tweetid;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp
index 4593449..6125619 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp
@@ -59,5 +59,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageNestedType) primary key tweetid;
 
-create  index msgCountBIx  on TweetMessages (nested.countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (nested.countB:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp
index aa0881a..a3cc5f4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp
@@ -59,5 +59,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageNestedType) primary key tweetid;
 
-create  index msgNgramIx  on TweetMessages (nested.`message-text`:string) type ngram (3) enforced;
+create  index msgNgramIx  on TweetMessages (nested.`message-text`:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp
index b15b855..3bf8522 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp
@@ -59,5 +59,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageNestedType) primary key tweetid;
 
-create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp
index b15b855..3bf8522 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp
@@ -59,5 +59,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageNestedType) primary key tweetid;
 
-create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (nested.`sender-location`:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp
index 93c831d..e20ec56 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp
@@ -29,5 +29,5 @@
 use test;
 
 
-create  index idx_employee_f_l_name  on employee (nested.fname:string,nested.lname:string) type btree enforced;
+create  index idx_employee_f_l_name  on employee (nested.fname:string?,nested.lname:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp
index fb2d828..e537733 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp
@@ -28,5 +28,5 @@
 use test;
 
 
-create  index idx_employee_f_l_name  on employee (nested.fname:string,nested.lname:string) type btree enforced;
+create  index idx_employee_f_l_name  on employee (nested.fname:string?,nested.lname:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp
index 4615a44..f73984b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use tpch;
 
 
-create  index idx_Orders_Custkey  on Orders (nested.o_custkey:int32) type btree enforced;
+create  index idx_Orders_Custkey  on Orders (nested.o_custkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp
index 8f00a22..601fe80 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp
index 8f00a22..601fe80 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp
index a550a9d..078aeae 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp
index 8f00a22..601fe80 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp
index a550a9d..078aeae 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.authors:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp
index 8f00a22..601fe80 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (nested.title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (nested.title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp
index 875b6b5..ad007e1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp
index 875b6b5..ad007e1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index keyword_index  on DBLP (nested.title:string) type keyword enforced;
+create  index keyword_index  on DBLP (nested.title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp
index 4615a44..f73984b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use tpch;
 
 
-create  index idx_Orders_Custkey  on Orders (nested.o_custkey:int32) type btree enforced;
+create  index idx_Orders_Custkey  on Orders (nested.o_custkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp
index 4615a44..f73984b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use tpch;
 
 
-create  index idx_Orders_Custkey  on Orders (nested.o_custkey:int32) type btree enforced;
+create  index idx_Orders_Custkey  on Orders (nested.o_custkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/range-search/range-search.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/range-search/range-search.3.ddl.sqlpp
index ced3342..55e28cf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/range-search/range-search.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/range-search/range-search.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index idx_LineItem_suppkey  on LineItem (nested.l_suppkey:int32) type btree enforced;
+create  index idx_LineItem_suppkey  on LineItem (nested.l_suppkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp
index 5eaa3f5..1069cbb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/nested-open-index/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index rtree_index_point  on MyData (nested.point:point) type rtree enforced;
+create  index rtree_index_point  on MyData (nested.point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-name-collision/enforced-field-name-collision.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-name-collision/enforced-field-name-collision.1.ddl.sqlpp
index 0ee1872..735412f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-name-collision/enforced-field-name-collision.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-name-collision/enforced-field-name-collision.1.ddl.sqlpp
@@ -31,5 +31,5 @@
 
 create  dataset testDS(testType) primary key id;
 
-create  index testIdx  on testDS (`value`:string) type btree enforced;
+create  index testIdx  on testDS (`value`:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-type-collision/enforced-field-name-collision.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-type-collision/enforced-field-name-collision.1.ddl.sqlpp
index cd1dbc0..381c726 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-type-collision/enforced-field-name-collision.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/enforced-field-type-collision/enforced-field-name-collision.1.ddl.sqlpp
@@ -31,5 +31,5 @@
 
 create  dataset testDS(testType) primary key id;
 
-create  index testIdx  on testDS (`value`:int32) type btree enforced;
+create  index testIdx  on testDS (`value`:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.sqlpp
index b1ba9e4..c9eca9a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/index-on-closed-type/index-on-closed-type.1.ddl.sqlpp
@@ -30,5 +30,5 @@
 
 create  dataset testDS(testType) primary key id;
 
-create  index testIdx  on testDS (`value`:string) type btree enforced;
+create  index testIdx  on testDS (`value`:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.sqlpp
index a3e8dc9..278a08d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-enforce-statement/missing-enforce-statement.1.ddl.sqlpp
@@ -30,5 +30,5 @@
 
 create  dataset testDS(testType) primary key id;
 
-create  index testIdx  on testDS (`value`:string) type btree;
+create  index testIdx  on testDS (`value`:string?) type btree;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-optionality/missing-optionality.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-optionality/missing-optionality.1.ddl.sqlpp
new file mode 100644
index 0000000..ef0285f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/error-checking/missing-optionality/missing-optionality.1.ddl.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;
+use test;
+
+create type testType as open {
+   `id`: int32
+}
+
+create dataset testDS(testType) primary key id;
+create index testIdx on testDS(`value`: string) enforced;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.sqlpp
index 73039d8..f504c35 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/adm-format/adm-format.1.ddl.sqlpp
@@ -44,5 +44,5 @@
 
 create external  dataset MyData(MyRecord) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/spatialData.json`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index idx  on MyData (id:int64) type btree enforced;
+create  index idx  on MyData (id:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp
index 3f7ea3b..4dbce7c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin-rtree/leftouterjoin-rtree.1.ddl.sqlpp
@@ -49,11 +49,11 @@
 
 create external  dataset TweetMessages(TweetMessageType) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/tw_for_indexleftouterjoin.adm`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index IdIx  on TweetMessages (tweetid:int64) type btree enforced;
+create  index IdIx  on TweetMessages (tweetid:int64?) type btree enforced;
 
-create  index msgCountAIx  on TweetMessages (countA:int64) type btree enforced;
+create  index msgCountAIx  on TweetMessages (countA:int64?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int64?) type btree enforced;
 
-create  index twmSndLocIx  on TweetMessages (`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (`sender-location`:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp
index af917ab..eabc35b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/leftouterjoin/leftouterjoin.1.ddl.sqlpp
@@ -50,9 +50,9 @@
 
 create external  dataset TweetMessages(TweetMessageType) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/tw_for_indexleftouterjoin.adm`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index IdIx  on TweetMessages (tweetid:int64) type btree enforced;
+create  index IdIx  on TweetMessages (tweetid:int64?) type btree enforced;
 
-create  index msgCountAIx  on TweetMessages (countA:int64) type btree enforced;
+create  index msgCountAIx  on TweetMessages (countA:int64?) type btree enforced;
 
-create  index msgCountBIx  on TweetMessages (countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp
index cf3ca74..8737627 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/external-indexing/rtree-index/rtree-index.1.ddl.sqlpp
@@ -37,5 +37,5 @@
 
 create external  dataset MyData(MyRecord) using `hdfs`((`hdfs`=`hdfs://127.0.0.1:31888`),(`path`=`/asterix/spatialData.json`),(`input-format`=`text-input-format`),(`format`=`adm`));
 
-create  index rtree_index_point  on MyData (point:point) type rtree enforced;
+create  index rtree_index_point  on MyData (point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp
index 7b3d733..32b2fc5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.1.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp
index 193eed8..3418e7e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.2.update.sqlpp
Binary files differ
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp
index fb859e3..422f1124 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.3.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index authors_index  on DBLPOpen (authors:string) type btree enforced;
+create  index authors_index  on DBLPOpen (authors:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp
index 4ea3ae7..0c01024 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/btree-secondary-equi-join/btree-secondary-equi-join.4.query.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Equi joins two datasets, DBLP and CSX, based on their title.
- *                  DBLP has a secondary btree open enforced index on authors, and given the 'indexnl' hint
+ *                  DBLP has a secondary btree open enforced index on authors?, and given the 'indexnl' hint
  *                  we expect the join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp
index 20fa31a..1c91a40 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance-inline/ngram-edit-distance-inline.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index ngram_index  on Customers (name:string) type ngram (3) enforced;
+create  index ngram_index  on Customers (name:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp
index 06e7b0a..f24bbb4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-edit-distance/ngram-edit-distance.3.ddl.sqlpp
@@ -25,5 +25,5 @@
 use test;
 
 
-create  index ngram_index  on Customers (name:string) type ngram (3) enforced;
+create  index ngram_index  on Customers (name:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp
index 9849d25..2536f16 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard-inline/ngram-jaccard-inline.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp
index 4f8822d..d9f5985 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/ngram-jaccard/ngram-jaccard.3.ddl.sqlpp
@@ -25,5 +25,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp
index a093b94..ee49170 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.1.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp
index 99e7d6e..6f930e0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.2.update.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp
index 0a13d88..8a58430 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.3.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index rtree_index  on MyData1 (point:point) type rtree enforced;
+create  index rtree_index  on MyData1 (point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp
index 7cb807b..fc120e6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/rtree-spatial-intersect-point/rtree-spatial-intersect-point.4.query.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description    : Joins two datasets on the intersection of their point attributes.
- *                  The dataset 'MyData1' has an  open enforced RTree index, and we expect the
+ *                  The dataset 'MyData1' has an  open enforced RTree index?, and we expect the
  *                  join to be transformed into an indexed nested-loop join.
  * Success        : Yes
  */
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp
index 96f9671..092221c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard-inline/word-jaccard-inline.3.ddl.sqlpp
@@ -26,5 +26,5 @@
 use test;
 
 
-create  index keyword_index  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp
index bfcf5cb..2538d82 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-join/word-jaccard/word-jaccard.3.ddl.sqlpp
@@ -25,5 +25,5 @@
 use test;
 
 
-create  index keyword_index  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp
index a77ec59..7ed7fbf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx1/probe-pidx-with-join-btree-sidx1.1.ddl.sqlpp
@@ -54,5 +54,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageType) primary key tweetid;
 
-create  index msgCountBIx  on TweetMessages (countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp
index a77ec59..7ed7fbf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-btree-sidx2/probe-pidx-with-join-btree-sidx2.1.ddl.sqlpp
@@ -54,5 +54,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageType) primary key tweetid;
 
-create  index msgCountBIx  on TweetMessages (countB:int64) type btree enforced;
+create  index msgCountBIx  on TweetMessages (countB:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp
index 5484aea..f84f6fa 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-invidx-sidx2/probe-pidx-with-join-invidx-sidx2.1.ddl.sqlpp
@@ -54,5 +54,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageType) primary key tweetid;
 
-create  index msgNgramIx  on TweetMessages (`message-text`:string) type ngram (3) enforced;
+create  index msgNgramIx  on TweetMessages (`message-text`:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp
index e3abb22..447fd04 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx1/probe-pidx-with-join-rtree-sidx1.1.ddl.sqlpp
@@ -54,5 +54,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageType) primary key tweetid;
 
-create  index twmSndLocIx  on TweetMessages (`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (`sender-location`:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp
index e3abb22..447fd04 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-leftouterjoin/probe-pidx-with-join-rtree-sidx2/probe-pidx-with-join-rtree-sidx2.1.ddl.sqlpp
@@ -54,5 +54,5 @@
 
 create  dataset TweetMessagesTmp(TweetMessageType) primary key tweetid;
 
-create  index twmSndLocIx  on TweetMessages (`sender-location`:point) type rtree enforced;
+create  index twmSndLocIx  on TweetMessages (`sender-location`:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.sqlpp
index 4a56278..f3eeeb8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.1.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.sqlpp
index 15a84d9..98e56d9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.2.update.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp
index f6f2e41..9bec586 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.3.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
@@ -29,5 +29,5 @@
 use test;
 
 
-create  index idx_employee_f_l_name  on employeeOpen (fname:string,lname:string) type btree enforced;
+create  index idx_employee_f_l_name  on employeeOpen (fname:string?,lname:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.sqlpp
index 537e7c4..fdec763 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key-mixed-intervals/btree-index-composite-key-mixed-intervals.4.query.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and
  *                     $l.fname <= "Micco" and $l.lname < "Vangieson"
  * Expected Result : Success
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.sqlpp
index c8c6056..4eaac17 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.2.update.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp
index d62486b..0349ad6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.3.ddl.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
@@ -28,5 +28,5 @@
 use test;
 
 
-create  index idx_employee_f_l_name  on employeeOpen (fname:string,lname:string) type btree enforced;
+create  index idx_employee_f_l_name  on employeeOpen (fname:string?,lname:string?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.sqlpp
index b144730..9549417 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-composite-key/btree-index-composite-key.4.query.sqlpp
@@ -18,7 +18,7 @@
  */
 /*
  * Description     : Test that BTree enforced open index is used in query plan
- *                 : define the BTree enforced open index on a composite key (fname,lanme)
+ *                 : define the BTree enforced open index on a composite key (fname?,lanme?)
  *                 : predicate => where $l.fname="Julio" and $l.lname="Isa"
  * Expected Result : Success
  * Issue           : Issue 162
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp
index fd2dd2e..8e14d52 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/btree-index-rewrite-multiple/btree-index-rewrite-multiple.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use tpch;
 
 
-create  index idx_Orders_Custkey  on OrdersOpen (o_custkey:int32) type btree enforced;
+create  index idx_Orders_Custkey  on OrdersOpen (o_custkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp
index 8ef6aab..fca2740 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-contains/inverted-index-ngram-contains.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp
index fa22139..369113a9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-contains/inverted-index-ngram-edit-distance-contains.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp
index 88b0e8b..f19641e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-panic/inverted-index-ngram-edit-distance-panic.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (authors:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp
index fa22139..369113a9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance-word-tokens/inverted-index-ngram-edit-distance-word-tokens.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLP (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLP (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp
index 88b0e8b..f19641e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-edit-distance/inverted-index-ngram-edit-distance.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (authors:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (authors:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp
index 8ef6aab..fca2740 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-ngram-jaccard/inverted-index-ngram-jaccard.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index ngram_index  on DBLPOpen (title:string) type ngram (3) enforced;
+create  index ngram_index  on DBLPOpen (title:string?) type ngram (3) enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp
index f52d874..1b26ca6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-contains/inverted-index-word-contains.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index keyword_index  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp
index f52d874..1b26ca6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/inverted-index-word-jaccard/inverted-index-word-jaccard.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index keyword_index  on DBLPOpen (title:string) type keyword enforced;
+create  index keyword_index  on DBLPOpen (title:string?) type keyword enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp
index fd2dd2e..8e14d52 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey-conjunctive/orders-index-custkey-conjunctive.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use tpch;
 
 
-create  index idx_Orders_Custkey  on OrdersOpen (o_custkey:int32) type btree enforced;
+create  index idx_Orders_Custkey  on OrdersOpen (o_custkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp
index fd2dd2e..8e14d52 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/orders-index-custkey/orders-index-custkey.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use tpch;
 
 
-create  index idx_Orders_Custkey  on OrdersOpen (o_custkey:int32) type btree enforced;
+create  index idx_Orders_Custkey  on OrdersOpen (o_custkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/range-search/range-search.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/range-search/range-search.3.ddl.sqlpp
index ff1f76d..8d73797 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/range-search/range-search.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/range-search/range-search.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index idx_LineItem_suppkey  on LineItemOpen (l_suppkey:int32) type btree enforced;
+create  index idx_LineItem_suppkey  on LineItemOpen (l_suppkey:int32?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp
index 281a06e..83625e6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/open-index-enforced/index-selection/rtree-secondary-index/rtree-secondary-index.3.ddl.sqlpp
@@ -20,5 +20,5 @@
 use test;
 
 
-create  index rtree_index_point  on MyDataOpen (point:point) type rtree enforced;
+create  index rtree_index_point  on MyDataOpen (point:point?) type rtree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp
index 56fdaab..b007f7a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/temp-dataset/drop-empty-secondary-indexes/drop-empty-secondary-indexes.1.ddl.sqlpp
@@ -53,17 +53,17 @@
 
 create  index rtree_index_point  on t1 (locn) type rtree;
 
-create  index rtree_index_point_open  on t1 (open_locn:point) type rtree enforced;
+create  index rtree_index_point_open  on t1 (open_locn:point?) type rtree enforced;
 
 create  index keyWD_indx  on t1 (name) type keyword;
 
-create  index keyWD_indx_open  on t1 (nickname:string) type keyword enforced;
+create  index keyWD_indx_open  on t1 (nickname:string?) type keyword enforced;
 
 create  index secndIndx  on t1 (zip) type btree;
 
 create  index nested  on t1 (person.name.first) type btree;
 
-create  index secndIndx_open  on t1 (address:string) type btree enforced;
+create  index secndIndx_open  on t1 (address:string?) type btree enforced;
 
 drop index t1.rtree_index_point;
 drop index t1.rtree_index_point_open;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ddl.sqlpp
index e95fbfa..2c41b64 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ddl.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tinysocial/tinysocial-suite-open/tinysocial-suite.2.ddl.sqlpp
@@ -28,7 +28,7 @@
 
 create  dataset TweetMessages(TweetMessageType) primary key tweetid hints (`CARDINALITY`=`100`);
 
-create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime) type btree enforced;
+create  index fbUserSinceIdx  on FacebookUsers (`user-since`:datetime?) type btree enforced;
 
-create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64) type btree enforced;
+create  index fbAuthorIdx  on FacebookMessages (`author-id`:int64?) type btree enforced;
 
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
index bf1893a..cd54be8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -3311,6 +3311,12 @@
         </compilation-unit>
       </test-case>
       <test-case FilePath="open-index-enforced/error-checking">
+        <compilation-unit name="missing-optionality">
+          <output-dir compare="Text">missing-optionality</output-dir>
+          <expected-error>"?"</expected-error>
+        </compilation-unit>
+      </test-case>
+      <test-case FilePath="open-index-enforced/error-checking">
         <compilation-unit name="record-type-collision">
           <output-dir compare="Text">record-type-collision</output-dir>
           <expected-error>org.apache.asterix.common.exceptions.AsterixException: A field "[value]" is already defined with the type "STRING"</expected-error>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index e3f67f4..c5c6a89 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -3104,6 +3104,12 @@
         </compilation-unit>
       </test-case>
       <test-case FilePath="open-index-enforced/error-checking">
+        <compilation-unit name="missing-optionality">
+          <output-dir compare="Text">missing-optionality</output-dir>
+          <expected-error>"?"</expected-error>
+        </compilation-unit>
+      </test-case>
+      <test-case FilePath="open-index-enforced/error-checking">
         <compilation-unit name="index-on-closed-type">
           <output-dir compare="Text">index-on-closed-type</output-dir>
           <expected-error>org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Typed index on "[value]" field could be created only for open datatype</expected-error>
diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
index f46f13d..17d0909 100644
--- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
+++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
@@ -1415,7 +1415,7 @@
 }
 {
   fieldList = NestedField()
-  ( <COLON> fieldType =  IndexedTypeExpr() )?
+  ( <COLON> fieldType =  IndexedTypeExpr() <QUES>)?
   {
     return new Pair<Integer, Pair<List<String>, TypeExpression>>
            (fieldList.first, new Pair<List<String>, TypeExpression>(fieldList.second, fieldType));
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index 15104bd..1597156 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -1454,7 +1454,7 @@
 }
 {
   fieldList = NestedField()
-  ( <COLON> fieldType =  IndexedTypeExpr() )?
+  ( <COLON> fieldType =  IndexedTypeExpr() <QUES>)?
   {
     return new Pair<Integer, Pair<List<String>, TypeExpression>>
           (fieldList.first, new Pair<List<String>, TypeExpression>(fieldList.second, fieldType));