http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
new file mode 100644
index 0000000..2b9b7c6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.1.ddl.aql
@@ -0,0 +1,54 @@
+/*
+ * 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 LineItemType as closed {
+  l_orderkey: int64,
+  l_partkey: int64,
+  l_suppkey: int64,
+  l_linenumber: int64,
+  l_quantity: double,
+  l_extendedprice: double,
+  l_discount: double,
+  l_tax: double,
+  l_returnflag: string,
+  l_linestatus: string,
+  l_shipdate: string,
+  l_commitdate: string,
+  l_receiptdate: string,
+  l_shipinstruct: string,
+  l_shipmode: string,
+  l_comment: string
+}
+
+create type LineIDType as closed {
+  l_orderkey: int64,
+  l_linenumber: int64,
+  l_suppkey: int64
+}
+
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
new file mode 100644
index 0000000..a154888
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.2.update.aql
@@ -0,0 +1,39 @@
+/*
+ * 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 LineItem
+using localfs
+(("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|"))
 pre-sorted;
+
+load dataset LineID
+using localfs
+(("path"="asterix_nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|"))
 pre-sorted;
+
+
+insert into dataset LineID (
+for $l in dataset('LineItem')
+    where $l.l_orderkey<10
+    return {
+        "l_orderkey": $l.l_orderkey,
+        "l_linenumber": $l.l_linenumber,
+        "l_suppkey": $l.l_partkey
+    }
+);
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.3.query.aql
new file mode 100644
index 0000000..5b9295c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert/insert.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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('LineID')
+order by $c.l_orderkey, $c.l_linenumber
+return $c 
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
new file mode 100644
index 0000000..2b9b7c6
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.1.ddl.aql
@@ -0,0 +1,54 @@
+/*
+ * 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 LineItemType as closed {
+  l_orderkey: int64,
+  l_partkey: int64,
+  l_suppkey: int64,
+  l_linenumber: int64,
+  l_quantity: double,
+  l_extendedprice: double,
+  l_discount: double,
+  l_tax: double,
+  l_returnflag: string,
+  l_linestatus: string,
+  l_shipdate: string,
+  l_commitdate: string,
+  l_receiptdate: string,
+  l_shipinstruct: string,
+  l_shipmode: string,
+  l_comment: string
+}
+
+create type LineIDType as closed {
+  l_orderkey: int64,
+  l_linenumber: int64,
+  l_suppkey: int64
+}
+
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineID(LineIDType)
+  primary key l_orderkey, l_linenumber;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.2.update.aql
new file mode 100644
index 0000000..d4cd11b
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.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 LineItem
+using localfs
+(("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|"))
 pre-sorted;
+
+load dataset LineID
+using localfs
+(("path"="asterix_nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|"))
 pre-sorted;
+
+insert into dataset LineID (
+for $l in dataset('LineItem')
+    where $l.l_orderkey<1000
+    return {
+        "l_orderkey": $l.l_orderkey,
+        "l_linenumber": $l.l_linenumber,
+        "l_suppkey": $l.l_partkey
+    }
+);
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.3.query.aql
new file mode 100644
index 0000000..5b9295c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc/insert_less_nc.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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('LineID')
+order by $c.l_orderkey, $c.l_linenumber
+return $c 
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.1.ddl.aql
new file mode 100644
index 0000000..1fc6c9a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.1.ddl.aql
@@ -0,0 +1,44 @@
+/*
+ * 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 LineItemType as closed {
+  l_orderkey: int32, 
+  l_partkey: int32, 
+  l_suppkey: int32, 
+  l_linenumber: int32, 
+  l_quantity: double, 
+  l_extendedprice: double,
+  l_discount: double, 
+  l_tax: double,
+  l_returnflag: string, 
+  l_linestatus: string, 
+  l_shipdate: string,
+  l_commitdate: string, 
+  l_receiptdate: string, 
+  l_shipinstruct: string, 
+  l_shipmode: string, 
+  l_comment: string
+}
+
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.2.update.aql
new file mode 100644
index 0000000..92ad6ab
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.2.update.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;
+
+load dataset LineItem 
+using "org.apache.asterix.external.dataset.adapter.HDFSAdapter"
+(("hdfs"="hdfs://localhost:10009"),("path"="/tpch/lineitem.tbl"),
+("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="|"));
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.3.query.aql
new file mode 100644
index 0000000..d822a06
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs/load-from-hdfs.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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('LineItem')
+order by $c.l_orderkey, $c.l_linenumber
+return $c 
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.1.ddl.aql
new file mode 100644
index 0000000..41033ea
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.1.ddl.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.
+ */
+// Bulk-Load test case: load a ADM file to a dataset that has an 
autogenerated-PK
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: uuid,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id autogenerated;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.2.update.aql
new file mode 100644
index 0000000..ecfd551
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.3.query.aql
new file mode 100644
index 0000000..6d82f41
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_01/load-with-autogenerated-pk_adm_01.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Authorization in Object-Oriented Databases.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.1.ddl.aql
new file mode 100644
index 0000000..8f12ec1
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.1.ddl.aql
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+// Bulk-Load test case: load a ADM file to a dataset that has an 
auto-generated-PK
+// This test should fail since we load every field data including the 
auto-genereated-PK field - id,
+// since Asterix creates random UUID for each record
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: uuid,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id autogenerated;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.2.update.aql
new file mode 100644
index 0000000..1d106fd
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk_including_uuid.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.3.query.aql
new file mode 100644
index 0000000..6d82f41
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_02/load-with-autogenerated-pk_adm_01.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Authorization in Object-Oriented Databases.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.1.ddl.aql
new file mode 100644
index 0000000..b260dae
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.1.ddl.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.
+ */
+// Bulk-Load test case: load a ADM file to a dataset that has an 
auto-generated-PK
+// This test should fail since auto-genereated-PK field is not the first field
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  dblpid: string,
+  id: uuid,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id autogenerated;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.2.update.aql
new file mode 100644
index 0000000..1d106fd
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk_including_uuid.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.3.query.aql
new file mode 100644
index 0000000..6d82f41
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_03/load-with-autogenerated-pk_adm_03.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Authorization in Object-Oriented Databases.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.1.ddl.aql
new file mode 100644
index 0000000..31b9f01
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.1.ddl.aql
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+// Bulk-Load test case: load a ADM file to a dataset that has an 
auto-generated-PK
+// This test should succeed since we load every field data including the PK 
field - id.
+// Note that id field is not an autogenerated field.
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: uuid,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+// not auto-generated at this time
+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/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.2.update.aql
new file mode 100644
index 0000000..1d106fd
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk_including_uuid.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.3.query.aql
new file mode 100644
index 0000000..6d82f41
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_adm_04/load-with-autogenerated-pk_adm_04.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Authorization in Object-Oriented Databases.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.1.ddl.aql
new file mode 100644
index 0000000..fb87d72
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.1.ddl.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.
+ */
+// Bulk-Load test case: load a delimited-text file to a dataset that has an 
autogenerated-PK
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: uuid,
+  title: string,
+  authors: string
+}
+
+create dataset DBLP(DBLPType) primary key id autogenerated;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.2.update.aql
new file mode 100644
index 0000000..c2d0efc
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk.csv"),("format"="delimited-text"),("delimiter"=","));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.3.query.aql
new file mode 100644
index 0000000..6d82f41
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_01/load-with-autogenerated-pk_csv_01.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Authorization in Object-Oriented Databases.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.1.ddl.aql
new file mode 100644
index 0000000..18eef42
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.1.ddl.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.
+ */
+// Bulk-Load test case: load a delimited-text file to a dataset that has an 
autogenerated-PK
+// This test should fail since we load every field data including the 
auto-genereated-PK field - id,
+// since Asterix creates random UUID for each record
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: uuid,
+  title: string,
+  authors: string
+}
+
+create dataset DBLP(DBLPType) primary key id autogenerated;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.2.update.aql
new file mode 100644
index 0000000..7ca2db5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk_including_uuid.csv"),("format"="delimited-text"),("delimiter"=","));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.3.query.aql
new file mode 100644
index 0000000..6d82f41
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_csv_02/load-with-autogenerated-pk_csv_02.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Authorization in Object-Oriented Databases.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.1.ddl.aql
new file mode 100644
index 0000000..fb87d72
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.1.ddl.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.
+ */
+// Bulk-Load test case: load a delimited-text file to a dataset that has an 
autogenerated-PK
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: uuid,
+  title: string,
+  authors: string
+}
+
+create dataset DBLP(DBLPType) primary key id autogenerated;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.2.update.aql
new file mode 100644
index 0000000..2d271fb
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.2.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;
+
+load dataset DBLP using localfs
+(("path"="asterix_nc1://data/pub-small/dblp-small-id-autogenerated-pk.txt"),("format"="delimited-text"),("delimiter"=":"));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.3.query.aql
new file mode 100644
index 0000000..7f301ec
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-autogenerated-pk_txt_01/load-with-autogenerated-pk_txt_01.3.query.aql
@@ -0,0 +1,23 @@
+/*
+ * 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 $o in dataset('DBLP')
+where contains($o.title,"Physical Object Management.")
+return $o.title;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.1.ddl.aql
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..85b9326
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.1.ddl.aql
@@ -0,0 +1,68 @@
+/*
+ * 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 LineItemType as closed {
+  l_orderkey: int64,
+  l_partkey: int64,
+  l_suppkey: int64,
+  l_linenumber: int64,
+  l_quantity: double,
+  l_extendedprice: double,
+  l_discount: double,
+  l_tax: double,
+  l_returnflag: string,
+  l_linestatus: string,
+  l_shipdate: string,
+  l_commitdate: string,
+  l_receiptdate: string,
+  l_shipinstruct: string,
+  l_shipmode: string,
+  l_comment: string
+}
+
+create type LineItemTypeOpen as open {
+  l_orderkey: int64,
+  l_suppkey: int64,
+  l_linenumber: int64,
+  l_quantity: double,
+  l_extendedprice: double,
+  l_discount: double,
+  l_tax: double,
+  l_returnflag: string,
+  l_linestatus: string,
+  l_shipdate: string,
+  l_commitdate: string,
+  l_receiptdate: string,
+  l_shipinstruct: string,
+  l_shipmode: string,
+  l_comment: string
+}
+
+create dataset LineItemOpen(LineItemTypeOpen)
+  primary key l_orderkey, l_linenumber;
+
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create index idx_partkey_open on LineItemOpen(l_partkey:int64?) enforced;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.2.update.aql
new file mode 100644
index 0000000..44edb07
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.2.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.
+ */
+use dataverse test;
+
+load dataset LineItem
+using localfs
+(("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|"))
 pre-sorted;
+
+insert into dataset test.LineItemOpen (
+    for $x in dataset test.LineItem
+        return $x
+);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.3.query.aql
new file mode 100644
index 0000000..09c6f4c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index-open/load-with-index-open.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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('LineItemOpen')
+where $c.l_partkey = 100
+order by $c.l_orderkey, $c.l_linenumber
+return $c 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.1.ddl.aql
new file mode 100644
index 0000000..f623d7b
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.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.
+ */
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type LineItemType as closed {
+  l_orderkey: int64,
+  l_partkey: int64,
+  l_suppkey: int64,
+  l_linenumber: int64,
+  l_quantity: double,
+  l_extendedprice: double,
+  l_discount: double,
+  l_tax: double,
+  l_returnflag: string,
+  l_linestatus: string,
+  l_shipdate: string,
+  l_commitdate: string,
+  l_receiptdate: string,
+  l_shipinstruct: string,
+  l_shipmode: string,
+  l_comment: string
+}
+
+create dataset LineItem(LineItemType)
+  primary key l_orderkey, l_linenumber;
+
+create index idx_partkey on LineItem(l_partkey);
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.2.update.aql
new file mode 100644
index 0000000..7884380
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.2.update.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 LineItem 
+using localfs
+(("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("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/load-with-index/load-with-index.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.3.query.aql
new file mode 100644
index 0000000..46bcd5a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index/load-with-index.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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('LineItem')
+where $c.l_partkey = 100
+order by $c.l_orderkey, $c.l_linenumber
+return $c 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.aql
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..52eb1d9
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.1.ddl.aql
@@ -0,0 +1,43 @@
+/*
+ * 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 DBLPType as closed {
+  id: int64, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create type DBLPTypeOpen as open {
+  id: int64, 
+  dblpid: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+create dataset DBLPOpen(DBLPTypeOpen) primary key id;
+
+create index ngram_index_open 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/load-with-ngram-index-open/load-with-ngram-index-open.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.2.update.aql
new file mode 100644
index 0000000..b174592
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.2.update.aql
@@ -0,0 +1,27 @@
+/*
+ * 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 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/load-with-ngram-index-open/load-with-ngram-index-open.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.3.query.aql
new file mode 100644
index 0000000..71d63f5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index-open/load-with-ngram-index-open.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 $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/load-with-ngram-index/load-with-ngram-index.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.1.ddl.aql
new file mode 100644
index 0000000..8162db2
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.1.ddl.aql
@@ -0,0 +1,36 @@
+/*
+ * 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 DBLPType as closed {
+  id: int64,
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+create index ngram_index on DBLP(title) type ngram(3);
+create index ngram_index1 on DBLP1(title) type ngram(3);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.2.update.aql
new file mode 100644
index 0000000..73b3a94
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.2.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;
+
+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/load-with-ngram-index/load-with-ngram-index.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.3.query.aql
new file mode 100644
index 0000000..76fb892
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-ngram-index/load-with-ngram-index.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 $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/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.aql
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..b93cb12
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.1.ddl.aql
@@ -0,0 +1,54 @@
+/*
+ * 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 MyRecord as closed {
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create type MyRecordOpen as open {
+  id: int64,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create dataset MyData(MyRecord)
+  primary key id;
+  
+create dataset MyDataOpen(MyRecordOpen)
+  primary key id;
+
+create index rtree_index_point on MyDataOpen(point:point?) type rtree enforced;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.2.update.aql
new file mode 100644
index 0000000..97602cb
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.2.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.
+ */
+use dataverse test;
+
+load dataset MyData
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData.json"),("format"="adm")) 
pre-sorted;
+
+insert into dataset test.MyDataOpen (
+    for $x in dataset test.MyData
+        return $x
+);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.3.query.aql
new file mode 100644
index 0000000..56648f1
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index-open/load-with-rtree-index-open.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 $o in dataset('MyDataOpen')
+where spatial-intersect($o.point, 
create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.id
+return {"id":$o.id}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.1.ddl.aql
new file mode 100644
index 0000000..8388105
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.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.
+ */
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type MyRecord as closed {
+  id: int64,
+  point: point,
+  kwds: string,
+  line1: line,
+  line2: line,
+  poly1: polygon,
+  poly2: polygon,
+  rec: rectangle,
+  circle: circle
+}
+
+create dataset MyData(MyRecord)
+  primary key id;
+
+create index rtree_index_point on MyData(point) type rtree;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.2.update.aql
new file mode 100644
index 0000000..2314790
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.2.update.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 MyData 
+using localfs
+(("path"="asterix_nc1://data/spatial/spatialData.json"),("format"="adm")) 
pre-sorted;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.3.query.aql
new file mode 100644
index 0000000..c40783a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/dml/load-with-rtree-index/load-with-rtree-index.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * 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 $o in dataset('MyData')
+where spatial-intersect($o.point, 
create-polygon([0.0,1.0,0.0,4.0,12.0,4.0,12.0,1.0]))
+order by $o.id
+return {"id":$o.id}

Reply via email to