You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by im...@apache.org on 2018/10/19 16:17:54 UTC

[22/51] [partial] asterixdb git commit: Revert "[ASTERIXDB-2454] Remove non-unique AQL tests"

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-issue433/query-issue433.3.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-issue433/query-issue433.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-issue433/query-issue433.3.query.aql
new file mode 100644
index 0000000..17c09ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/query-issue433/query-issue433.3.query.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/*
+ * Description  : This test case is to verify the fix for issue433
+                 : https://code.google.com/p/asterixdb/issues/detail?id=433
+ * Expected Res : Success
+ * Date         : 3th April 2013
+ */
+
+use dataverse insertIssue;
+
+for $d in dataset myDataset
+order by $d.id
+return $d;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..6de0041
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from correlated secondary btree indexes that
+ * are built on nullable fields
+ * Expected Result : Success
+ * Date            : June 8 2017
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int64,
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int64,
+  name: string,
+  age: int64?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+create dataset Customers(CustomerType) primary key cid
+with {
+  "merge-policy": {
+    "name": "correlated-prefix",
+    "parameters": { "max-mergable-component-size": 16384, "max-tolerance-component-count": 3 }
+  }
+};
+
+create feed CustomerFeed with {
+ "adapter-name" : "localfs",
+ "path" : "asterix_nc1://data/semistructured/co1k/customer.adm",
+ "format" : "adm",
+ "type-name" : "CustomerType",
+ "tuple-interval" : "10"
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..4fcc858
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.2.update.aql
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from correlated secondary btree indexes
+ * that are built on nullable fields
+ * Expected Result : Success
+ * Date            : June 8 2017
+ */
+
+use dataverse test;
+
+set "wait-for-completion-feed" "true";
+
+connect feed CustomerFeed to dataset Customers;
+
+start feed CustomerFeed;
+
+delete $c from dataset Customers where $c.cid>=200;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..c19ef10
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+use dataverse test;
+
+create index age_index on Customers(age);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.4.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.4.query.aql
new file mode 100644
index 0000000..4b8ff9a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-nullable/scan-delete-btree-correlated-secondary-index-nullable.4.query.aql
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from correlated secondary btree indexes
+ * that are built on nullable fields
+ * Expected Result : Success
+ * Date            : June 8 2017
+ */
+
+use dataverse test;
+
+for $c in dataset('Customers')
+where $c.age < 20
+order by $c.cid
+return $c

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.1.ddl.aql
new file mode 100644
index 0000000..352f821
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.1.ddl.aql
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-btree-correlated-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from correlated secondary btree indexes
+ * that are built on open fields
+ * Expected Result : Success
+ * Date            : June 8 2017
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int64,
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int64,
+  name: string,
+  age: int64?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+create type CustomerOpenType as open {
+  cid: int64,
+  name: string,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+create dataset Customers(CustomerType) primary key cid
+with {
+  "merge-policy": {
+    "name": "correlated-prefix",
+    "parameters": { "max-mergable-component-size": 16384, "max-tolerance-component-count": 3 }
+  }
+};
+
+create dataset CustomersOpen(CustomerOpenType) primary key cid
+with {
+  "merge-policy": {
+    "name": "correlated-prefix",
+    "parameters": { "max-mergable-component-size": 16384, "max-tolerance-component-count": 3 }
+  }
+};

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.2.update.aql
new file mode 100644
index 0000000..1c24546
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.2.update.aql
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+use dataverse test;
+
+load dataset Customers
+using localfs
+(("path"="asterix_nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+insert into dataset test.CustomersOpen (
+    for $x in dataset test.Customers
+        return {
+            "cid": $x.cid,
+            "name": $x.name,
+            "age": $x.age,
+            "address": $x.address,
+            "interests": $x.interests,
+            "children": $x.children
+        }
+);
+
+delete $c from dataset CustomersOpen where $c.cid>=200;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.3.ddl.aql
new file mode 100644
index 0000000..7c358d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.3.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+use dataverse test;
+
+create index age_index on CustomersOpen(age:int32?) enforced;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.4.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.4.query.aql
new file mode 100644
index 0000000..33d6039
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-correlated-secondary-index-open/scan-delete-btree-correlated-secondary-index-open.4.query.aql
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+use dataverse test;
+
+for $c in dataset('CustomersOpen')
+where $c.age < 20
+order by $c.cid
+return $c

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..9044aee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary btree indexes that are built on nullable fields
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int64,
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int64,
+  name: string,
+  age: int64?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+create dataset Customers(CustomerType) primary key cid;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..5fec7a1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.2.update.aql
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary btree indexes that are built on nullable fields 
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+use dataverse test;
+
+load dataset Customers 
+using localfs
+(("path"="asterix_nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..5a974c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+use dataverse test;
+
+create index age_index on Customers(age);
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..ba99284
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.4.update.aql
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+use dataverse test;
+
+delete $c from dataset Customers where $c.cid>=200;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..e4c4e57
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable/scan-delete-btree-secondary-index-nullable.5.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-btree-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary btree indexes that are built on nullable fields 
+ * Expected Result : Success
+ * Date            : May 12 2012
+ */
+
+use dataverse test;
+
+for $c in dataset('Customers')
+where $c.age < 20
+order by $c.cid
+return $c

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.1.ddl.aql
new file mode 100644
index 0000000..d3cbc6d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.1.ddl.aql
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-btree-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary btree indexes that are built on open fields 
+ * Expected Result : Success
+ * Date            : Feb 13 2014
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type AddressType as closed {
+  number: int64, 
+  street: string,
+  city: string
+}
+
+create type CustomerType as closed {
+  cid: int64, 
+  name: string,
+  age: int64?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+create type CustomerOpenType as open {
+  cid: int64, 
+  name: string,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ { name: string, age: int64? } ]
+}
+
+create dataset Customers(CustomerType) primary key cid;
+
+create dataset CustomersOpen(CustomerOpenType) primary key cid;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.2.update.aql
new file mode 100644
index 0000000..d37f67d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.2.update.aql
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-btree-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary btree indexes that are built on open fields
+ * Expected Result : Success
+ * Date            : Feb 13 2014
+ */
+
+use dataverse test;
+
+load dataset Customers
+using localfs
+(("path"="asterix_nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
+
+insert into dataset test.CustomersOpen (
+    for $x in dataset test.Customers
+        return {
+            "cid": $x.cid,
+            "name": $x.name,
+            "age": $x.age,
+            "address": $x.address,
+            "interests": $x.interests,
+            "children": $x.children
+        }
+);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.3.ddl.aql
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..38baed5
--- /dev/null
+++ 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
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+use dataverse test;
+
+create index age_index on CustomersOpen(age:int32?) enforced;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.4.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.4.update.aql
new file mode 100644
index 0000000..dc22ce5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.4.update.aql
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+use dataverse test;
+
+delete $c from dataset CustomersOpen where $c.cid>=200;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.5.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.5.query.aql
new file mode 100644
index 0000000..1880f0c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-open/scan-delete-btree-secondary-index-open.5.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-btree-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary btree indexes that are built on open fields 
+ * Expected Result : Success
+ * Date            : Feb 13 2014
+ */
+
+use dataverse test;
+
+for $c in dataset('CustomersOpen')
+where $c.age < 20
+order by $c.cid
+return $c

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..d71874b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int64,
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..79cbca7
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..cd98cd9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..cb0e38b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id>50;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..19f47ca
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/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.1.ddl.aql
----------------------------------------------------------------------
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.1.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.1.ddl.aql
new file mode 100644
index 0000000..e0ee267
--- /dev/null
+++ 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.1.ddl.aql
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that is built on open field.
+ * Expected Result : Success
+ * Date            : March 13 2014
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPOpenType as open {
+  id: int64,
+  dblpid: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+create dataset DBLPOpen(DBLPOpenType) primary key id;
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/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.2.update.aql
----------------------------------------------------------------------
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.2.update.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.2.update.aql
new file mode 100644
index 0000000..5a52697
--- /dev/null
+++ 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.2.update.aql
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that is built on open field.
+ * Expected Result : Success
+ * Date            : March 13 2014
+ */
+
+use dataverse test;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
+insert into dataset test.DBLPOpen (
+    for $x in dataset test.DBLP
+        return $x
+);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/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
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..1b26fcf
--- /dev/null
+++ 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
@@ -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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that is built on open field.
+ * Expected Result : Success
+ * Date            : March 13 2014
+ */
+
+use dataverse test;
+
+create index ngram_index on DBLPOpen(title:string?) type ngram(3) enforced;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/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.4.update.aql
----------------------------------------------------------------------
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.4.update.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.4.update.aql
new file mode 100644
index 0000000..f06ca64
--- /dev/null
+++ 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.4.update.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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that is built on open field.
+ * Expected Result : Success
+ * Date            : March 13 2014
+ */
+
+use dataverse test;
+
+delete $o from dataset DBLPOpen where $o.id>50;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/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.5.query.aql
----------------------------------------------------------------------
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.5.query.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.5.query.aql
new file mode 100644
index 0000000..ea77055
--- /dev/null
+++ 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.5.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that is built on open field.
+ * Expected Result : Success
+ * Date            : March 13 2014
+ */
+
+use dataverse test;
+
+for $o in dataset('DBLPOpen')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..4ef1edf
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql
new file mode 100644
index 0000000..6007290
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..5b998d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.aql
new file mode 100644
index 0000000..7b7bb8b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id>50;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql
new file mode 100644
index 0000000..2fc19d2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..23b1cd5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int64,
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..c91c5d8
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.ddl.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..880114c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..7008678
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id<50;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..d834947
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/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.1.ddl.aql
----------------------------------------------------------------------
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.1.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.1.ddl.aql
new file mode 100644
index 0000000..98cbe41
--- /dev/null
+++ 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.1.ddl.aql
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-open.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that is built on open field.
+ * Expected Result : Success
+ * Date            : March 13 2014
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPOpenType as open {
+  id: int32,
+  dblpid: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLPOpen(DBLPOpenType) primary key id;
+
+