[ASTERIXDB-2785][TEST] Convert MetadataTest to SQL++

- user model changes: no
- storage format changes: no
- interface changes: no

Change-Id: If8435ce0e70874559197aa2ad60600e1f70815c3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/8283
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.2.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.2.query.aql
deleted file mode 100644
index eb73925..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.2.query.aql
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.
- */
-let $count := count(
-for $v in dataset Metadata.Dataset
-where $v.DatasetName = 'GleambookUsers'
-return $v)
-return $count
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.2.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.2.query.sqlpp
index 921b7b1..b8d650f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.2.query.sqlpp
@@ -16,4 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-drop index Cust.ord;
+
+SELECT VALUE COUNT(*) FROM Metadata.`Dataset`
+where DatasetName = 'GleambookUsers';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.3.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.3.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.3.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_default_dataverse_type/dataset_with_default_dataverse_type.3.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.1.ddl.sqlpp
index f2682fa..4f7d0b8 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.1.ddl.sqlpp
@@ -19,16 +19,16 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type AuxiliaryType as open {
     id: string
-}
+};
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType) with meta(AuxiliaryType)
 primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.3.query.aql
deleted file mode 100644
index 079d075..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.3.query.sqlpp
similarity index 91%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.3.query.sqlpp
index bd244d0..6c78eaa 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.3.query.sqlpp
@@ -17,3 +17,6 @@
  * under the License.
  */
 
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.4.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.4.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.4.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.4.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.1.ddl.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.1.ddl.sqlpp
index 2f4f181..2672641 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.1.ddl.sqlpp
@@ -19,20 +19,20 @@
 
 drop dataverse meta if exists;
 create dataverse meta;
-use dataverse meta;
+use meta;
 create type AuxiliaryType as open {
     id: string
-}
+};
 
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType) with meta(meta.AuxiliaryType)
 primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.3.query.aql
deleted file mode 100644
index 079d075..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.3.query.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.3.query.sqlpp
index bd244d0..6c78eaa 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.3.query.sqlpp
@@ -17,3 +17,6 @@
  * under the License.
  */
 
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.4.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.4.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.4.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-2/dataset_with_meta-2.4.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.1.ddl.sqlpp
index 138a211..d62a49d 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.1.ddl.sqlpp
@@ -19,16 +19,16 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type AuxiliaryType as open {
     id: string
-}
+};
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType) with meta(LineType)
 primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.2.update.aql
deleted file mode 100644
index bd244d0..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.2.update.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.3.query.aql
deleted file mode 100644
index 079d075..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.3.query.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.3.query.sqlpp
index bd244d0..ad48535 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-1/dataset_with_meta-1.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.3.query.sqlpp
@@ -17,3 +17,6 @@
  * under the License.
  */
 
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.4.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.4.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.4.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-3/dataset_with_meta-3.4.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.1.ddl.sqlpp
index 869bc1e..e5f19a5 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.1.ddl.sqlpp
@@ -19,13 +19,13 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType) with meta(LineType)
 primary key meta().id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.3.query.aql
deleted file mode 100644
index 079d075..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.3.query.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.3.query.sqlpp
index bd244d0..6c78eaa 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.3.query.sqlpp
@@ -17,3 +17,6 @@
  * under the License.
  */
 
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.4.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.4.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.4.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-4/dataset_with_meta-4.4.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.1.ddl.sqlpp
similarity index 93%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.1.ddl.sqlpp
index 07df579..03feaab 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.1.ddl.sqlpp
@@ -19,18 +19,18 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type AuxiliaryType as open {
-  "key":int32
-}
+  `key`:int32
+};
 
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType) with meta(AuxiliaryType)
-primary key meta()."key";
+primary key meta().`key`;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.3.query.aql
deleted file mode 100644
index 079d075..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.3.query.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.3.query.sqlpp
index bd244d0..6c78eaa 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.3.query.sqlpp
@@ -17,3 +17,6 @@
  * under the License.
  */
 
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.4.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.4.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.4.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/dataset_with_meta-5/dataset_with_meta-5.4.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_1/issue_1419_drop_type_with_collection_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_1/issue_1419_drop_type_with_collection_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_1/issue_1419_drop_type_with_collection_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_1/issue_1419_drop_type_with_collection_1.1.ddl.sqlpp
index 22b4d02..316d00a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_1/issue_1419_drop_type_with_collection_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_1/issue_1419_drop_type_with_collection_1.1.ddl.sqlpp
@@ -25,7 +25,7 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type typeSnapshot if not exists as open {
   countyID: int32,
@@ -34,6 +34,6 @@
   retweetCount: int32,
   users: [int64],
   top50HashTags: [{string:int32}]
-}
+};
 
 drop type typeSnapshot;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_2/issue_1419_drop_type_with_collection_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_2/issue_1419_drop_type_with_collection_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_2/issue_1419_drop_type_with_collection_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_2/issue_1419_drop_type_with_collection_2.1.ddl.sqlpp
index 55691ee..893f788 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_2/issue_1419_drop_type_with_collection_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_1419_drop_type_with_collection_2/issue_1419_drop_type_with_collection_2.1.ddl.sqlpp
@@ -25,16 +25,16 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type subType as {
   id:int32,
   list:[string]
-}
+};
 
 create type superType as {
   superid:int32,
   superlist:[subType]
-}
+};
 
 drop type subType;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.1.ddl.aql
deleted file mode 100644
index f25eee9..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.1.ddl.aql
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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  : create a dataset providing hints but use  whitespace 
- * Expected Res : Success
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type LineType as open {
-  id:int32,
-  text: string
-}
-
-create dataset Book(LineType)
-primary key id
-hints(  cardinality  =   2000);
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.2.update.aql
deleted file mode 100644
index 9ca188e..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.2.update.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : create a dataset providing hints but use  whitespace 
- * Expected Res : Success
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-// no inserts, deletes
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.3.query.aql
deleted file mode 100644
index fd5ec27..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1/issue_251_dataset_hint_1.3.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : create a dataset providing hints but use  whitespace 
- * Expected Res : Success
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.ddl.sqlpp
index 4dcc805..e8961f2 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.ddl.sqlpp
@@ -25,12 +25,12 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType)
 primary key id
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.2.update.aql
deleted file mode 100644
index b5321d8..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.2.update.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : create a dataset providing a valid hint and do not use any whitespace
- * Expected Res : Success
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-// no inserts, deletes
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.3.query.sqlpp
index b509d69..9ccb9d4 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.3.query.sqlpp
@@ -23,6 +23,6 @@
  * Issue        : 251
  */
 
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.ddl.sqlpp
index 739c000..35c6b2c 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.ddl.sqlpp
@@ -25,12 +25,12 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType)
 primary key id
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.3.query.aql
deleted file mode 100644
index fb9775b..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.3.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : create a dataset providing  hint (in upper case)
- * Expected Res : Success
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.3.query.sqlpp
index 24e04cf..797048f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.3.query.sqlpp
@@ -23,4 +23,6 @@
  * Issue        : 251
  */
 
-// no inserts, deletes
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.ddl.sqlpp
index a4d78da..e0b5d10 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.ddl.sqlpp
@@ -25,12 +25,12 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType)
 primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.2.update.aql
deleted file mode 100644
index de63f9b..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.2.update.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : create a dataset without providing any hints.
- * Expected Res : Success
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-// no inserts, deletes
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.3.query.sqlpp
index eb8cba4..80da3cc 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.3.query.sqlpp
@@ -24,6 +24,6 @@
  */
 
 
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.sqlpp
index fa1ac86..a9db5f6 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.sqlpp
@@ -25,11 +25,11 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
-id:year-month-duration,
+id:`year-month-duration`,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.aql
deleted file mode 100644
index 92afed0..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using year-month-duration as the primary key 
- * Expected Res : Success
- * Date         : 7 May 2013
- * Issue        : 363
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":year-month-duration("P16Y"), "name": "John"})
-insert into dataset Employee({"id":year-month-duration("-P37M"), "name": "Alex"})
-insert into dataset Employee({"id":year-month-duration("P2013Y"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.sqlpp
similarity index 79%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.sqlpp
index 43c4bcb..2e6b6ba 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.sqlpp
@@ -23,9 +23,8 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > year-month-duration("P350M")
-return $x
-
+insert into Employee({"id":`year-month-duration`("P16Y"), "name": "John"});
+insert into Employee({"id":`year-month-duration`("-P37M"), "name": "Alex"});
+insert into Employee({"id":`year-month-duration`("P2013Y"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.sqlpp
index 43c4bcb..d911db5 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.sqlpp
@@ -23,9 +23,9 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > year-month-duration("P350M")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.id > `year-month-duration`("P350M");
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.sqlpp
index 7d79afd..6505828 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.sqlpp
@@ -25,11 +25,11 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
 id:datetime,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.aql
deleted file mode 100644
index 6d5cee1..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using datetime as the primary key 
- * Expected Res : Success
- * Date         : 7 May 2013
- * Issue        : 363
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":datetime("1900-01-01T00:00:00"), "name": "John"})
-insert into dataset Employee({"id":datetime("2000-01-01T00:00:00"), "name": "Alex"})
-insert into dataset Employee({"id":datetime("2013-01-01T00:00:00"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.sqlpp
similarity index 79%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.sqlpp
index 768e24c..4e19d82 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > datetime("2007-07-07T07:07:07.777Z")
-return $x
+insert into Employee({"id":datetime("1900-01-01T00:00:00"), "name": "John"});
+insert into Employee({"id":datetime("2000-01-01T00:00:00"), "name": "Alex"});
+insert into Employee({"id":datetime("2013-01-01T00:00:00"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.sqlpp
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.sqlpp
index 768e24c..dce3227 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > datetime("2007-07-07T07:07:07.777Z")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.id > datetime("2007-07-07T07:07:07.777Z");
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.sqlpp
index 870d709..ba45517 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.sqlpp
@@ -25,11 +25,11 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
 id:time,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.aql
deleted file mode 100644
index 11b7d57..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using time as the primary key 
- * Expected Res : Success
- * Date         : 7 May 2013
- * Issue        : 363
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":time("03:10:00.493Z"), "name": "John"})
-insert into dataset Employee({"id":time("20:37:19+08:00"), "name": "Alex"})
-insert into dataset Employee({"id":time("21:39:17.948-04:00"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.sqlpp
index 943353b..7012f08 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > time("07:07:07.777Z")
-return $x
+insert into Employee({"id":time("03:10:00.493Z"), "name": "John"});
+insert into Employee({"id":time("20:37:19+08:00"), "name": "Alex"});
+insert into Employee({"id":time("21:39:17.948-04:00"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.sqlpp
index 943353b..280fff0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > time("07:07:07.777Z")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.id > time("07:07:07.777Z");
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.sqlpp
index 9723bc9..1b80689 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.sqlpp
@@ -25,11 +25,11 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
 id:date,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.aql
deleted file mode 100644
index 98a650d..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using date as the primary key 
- * Expected Res : Success
- * Date         : 7 May 2013
- * Issue        : 363
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":date("2010-01-01"), "name": "John"})
-insert into dataset Employee({"id":date("-1912-10-11"), "name": "Alex"})
-insert into dataset Employee({"id":date("0732-02-02"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.sqlpp
similarity index 82%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.sqlpp
index 9723bc9..9fc2903 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.sqlpp
@@ -23,13 +23,8 @@
  * Issue        : 363
  */
 
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
+use test;
 
-create type Emp as open {
-id:date,
-name:string
-}
-
-create dataset Employee(Emp) primary key id;
+insert into Employee({"id":date("2010-01-01"), "name": "John"});
+insert into Employee({"id":date("-1912-10-11"), "name": "Alex"});
+insert into Employee({"id":date("0732-02-02"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.sqlpp
index 8a000bb..36af1b7 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 363
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > date("2007-07-07")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.id > date("2007-07-07");
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.sqlpp
index ce42561..c0c6b79 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.sqlpp
@@ -25,11 +25,11 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
-id:day-time-duration,
+id:`day-time-duration`,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.aql
deleted file mode 100644
index ee90bf4..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using day-time-duration as the primary key 
- * Expected Res : Success
- * Date         : 7 May 2013
- * Issue        : 363
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":day-time-duration("P380DT983M"), "name": "John"})
-insert into dataset Employee({"id":day-time-duration("-P3829H849.392S"), "name": "Alex"})
-insert into dataset Employee({"id":day-time-duration("PT93847M0.392S"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.sqlpp
similarity index 78%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.sqlpp
index ce42561..6183dbf 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.sqlpp
@@ -23,13 +23,8 @@
  * Issue        : 363
  */
 
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
+use test;
 
-create type Emp as open {
-id:day-time-duration,
-name:string
-}
-
-create dataset Employee(Emp) primary key id;
+insert into Employee({"id":`day-time-duration`("P380DT983M"), "name": "John"});
+insert into Employee({"id":`day-time-duration`("-P3829H849.392S"), "name": "Alex"});
+insert into Employee({"id":`day-time-duration`("PT93847M0.392S"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.sqlpp
index 67f6196..3b99bb6 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 363
  */
  
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.id > day-time-duration("P350D")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.id > `day-time-duration`("P350D");
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.1.ddl.sqlpp
similarity index 93%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.1.ddl.sqlpp
index ef91665..0ae5cc6 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.1.ddl.sqlpp
@@ -25,13 +25,13 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
-id:year-month-duration,
-dur:year-month-duration,
+id:`year-month-duration`,
+dur:`year-month-duration`,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
 create index TestSecondIndex on Employee(dur);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.2.update.aql
deleted file mode 100644
index 3ba7c35..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using year-month-duration for the secondary index 
- * Expected Res : Success
- * Date         : 26 May 2013
- * Issue        : 461
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":year-month-duration("P16Y"), "dur":year-month-duration("-P23Y"), "name": "John"})
-insert into dataset Employee({"id":year-month-duration("-P37M"), "dur":year-month-duration("P1Y48M"), "name": "Alex"})
-insert into dataset Employee({"id":year-month-duration("P2013Y"), "dur":year-month-duration("P7M"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.2.update.sqlpp
similarity index 73%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.2.update.sqlpp
index ad8177a..4118740 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.2.update.sqlpp
@@ -23,9 +23,8 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.dur > year-month-duration("P1Y")
-return $x
-
+insert into Employee({"id":`year-month-duration`("P16Y"), "dur":`year-month-duration`("-P23Y"), "name": "John"});
+insert into Employee({"id":`year-month-duration`("-P37M"), "dur":`year-month-duration`("P1Y48M"), "name": "Alex"});
+insert into Employee({"id":`year-month-duration`("P2013Y"), "dur":`year-month-duration`("P7M"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.sqlpp
index ad8177a..cb83ab4 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_0/issue_363_temporal_sec_key_0.3.query.sqlpp
@@ -23,9 +23,9 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.dur > year-month-duration("P1Y")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.dur > `year-month-duration`("P1Y");
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.1.ddl.sqlpp
index d542239..7ce44b2 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.1.ddl.sqlpp
@@ -25,13 +25,13 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
 id:datetime,
 dt:datetime,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
 create index TestSecondIndex on Employee(dt);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.2.update.aql
deleted file mode 100644
index 2d2d705..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using datetime for the secondary index 
- * Expected Res : Success
- * Date         : 26 May 2013
- * Issue        : 461
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":datetime("1900-01-01T00:00:00"), "dt":datetime("1900-01-01T00:00:00"), "name": "John"})
-insert into dataset Employee({"id":datetime("2000-01-01T00:00:00"), "dt":datetime("2000-01-01T00:00:00"), "name": "Alex"})
-insert into dataset Employee({"id":datetime("2013-01-01T00:00:00"), "dt":datetime("2013-01-01T00:00:00"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.2.update.sqlpp
similarity index 72%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.2.update.sqlpp
index 1efd6ae..e6023b6 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.2.update.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.dt > datetime("2007-07-07T07:07:07.777Z")
-return $x
+insert into Employee({"id":datetime("1900-01-01T00:00:00"), "dt":datetime("1900-01-01T00:00:00"), "name": "John"});
+insert into Employee({"id":datetime("2000-01-01T00:00:00"), "dt":datetime("2000-01-01T00:00:00"), "name": "Alex"});
+insert into Employee({"id":datetime("2013-01-01T00:00:00"), "dt":datetime("2013-01-01T00:00:00"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.sqlpp
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.sqlpp
index 1efd6ae..dbd87f5 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_1/issue_363_temporal_sec_key_1.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.dt > datetime("2007-07-07T07:07:07.777Z")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.dt > datetime("2007-07-07T07:07:07.777Z");
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.1.ddl.sqlpp
index 3a5c1b9..e8c1e2b 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.1.ddl.sqlpp
@@ -25,13 +25,13 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
 id:time,
 tm:time,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
 create index TestSecondIndex on Employee(tm);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.2.update.aql
deleted file mode 100644
index 61d83fe..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using time for the secondary index 
- * Expected Res : Success
- * Date         : 26 May 2013
- * Issue        : 461
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":time("03:10:00.493Z"), "tm":time("03:10:00.493Z"), "name": "John"})
-insert into dataset Employee({"id":time("20:37:19+08:00"), "tm":time("20:37:19+08:00"), "name": "Alex"})
-insert into dataset Employee({"id":time("21:39:17.948-04:00"), "tm":time("21:39:17.948-04:00"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.2.update.sqlpp
similarity index 75%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.2.update.sqlpp
index 97b8ca3..57e7372 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.2.update.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.tm > time("07:07:07.777Z")
-return $x
+insert into Employee({"id":time("03:10:00.493Z"), "tm":time("03:10:00.493Z"), "name": "John"});
+insert into Employee({"id":time("20:37:19+08:00"), "tm":time("20:37:19+08:00"), "name": "Alex"});
+insert into Employee({"id":time("21:39:17.948-04:00"), "tm":time("21:39:17.948-04:00"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.sqlpp
index 97b8ca3..dffccc7 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_2/issue_363_temporal_sec_key_2.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.tm > time("07:07:07.777Z")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.tm > time("07:07:07.777Z");
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.sqlpp
index c99a62c..4c87824 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.sqlpp
@@ -25,13 +25,13 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
 id:date,
 dt:date,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
 create index TestSecondIndex on Employee(dt);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.2.update.aql
deleted file mode 100644
index 77ef157..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using date for the secondary index 
- * Expected Res : Success
- * Date         : 26 May 2013
- * Issue        : 461
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":date("2010-01-01"), "dt":date("2010-01-01"), "name": "John"})
-insert into dataset Employee({"id":date("-1912-10-11"), "dt":date("-1912-10-11"), "name": "Alex"})
-insert into dataset Employee({"id":date("0732-02-02"), "dt":date("0732-02-02"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.2.update.sqlpp
similarity index 77%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.2.update.sqlpp
index c99a62c..2ba3caa 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.2.update.sqlpp
@@ -23,15 +23,8 @@
  * Issue        : 461
  */
 
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
+use test;
 
-create type Emp as open {
-id:date,
-dt:date,
-name:string
-}
-
-create dataset Employee(Emp) primary key id;
-create index TestSecondIndex on Employee(dt);
+insert into Employee({"id":date("2010-01-01"), "dt":date("2010-01-01"), "name": "John"});
+insert into Employee({"id":date("-1912-10-11"), "dt":date("-1912-10-11"), "name": "Alex"});
+insert into Employee({"id":date("0732-02-02"), "dt":date("0732-02-02"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.3.query.sqlpp
index 3dd1565..4ed0517 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_3/issue_363_temporal_sec_key_3.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 461
  */
 
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.dt > date("2007-07-07")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.dt > date("2007-07-07");
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.1.ddl.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.1.ddl.sqlpp
index f9a5d86..68c89d5 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.1.ddl.sqlpp
@@ -25,13 +25,13 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type Emp as open {
-id:day-time-duration,
-dur:day-time-duration,
+id:`day-time-duration`,
+dur:`day-time-duration`,
 name:string
-}
+};
 
 create dataset Employee(Emp) primary key id;
 create index TestSecondIndex on Employee(dur);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.2.update.aql
deleted file mode 100644
index 59cebc7..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.2.update.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : create a dataset using day-time-duration for the secondary index 
- * Expected Res : Success
- * Date         : 26 May 2013
- * Issue        : 461
- */
-
-use dataverse test;
-
-insert into dataset Employee({"id":day-time-duration("P380DT983M"), "dur":day-time-duration("P380DT983M"), "name": "John"})
-insert into dataset Employee({"id":day-time-duration("-P3829H849.392S"), "dur":day-time-duration("-P3829H849.392S"), "name": "Alex"})
-insert into dataset Employee({"id":day-time-duration("PT93847M0.392S"), "dur":day-time-duration("PT93847M0.392S"), "name": "Bob"})
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.2.update.sqlpp
similarity index 71%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.2.update.sqlpp
index d39a2d2..d1ee751 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.2.update.sqlpp
@@ -22,9 +22,9 @@
  * Date         : 26 May 2013
  * Issue        : 461
  */
- 
-use dataverse test;
 
-for $x in dataset('Employee')
-where $x.dur > day-time-duration("P350D")
-return $x
+use test;
+
+insert into Employee({"id":`day-time-duration`("P380DT983M"), "dur":`day-time-duration`("P380DT983M"), "name": "John"});
+insert into Employee({"id":`day-time-duration`("-P3829H849.392S"), "dur":`day-time-duration`("-P3829H849.392S"), "name": "Alex"});
+insert into Employee({"id":`day-time-duration`("PT93847M0.392S"), "dur":`day-time-duration`("PT93847M0.392S"), "name": "Bob"});
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.sqlpp
index d39a2d2..854f66e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_sec_key_4/issue_363_temporal_sec_key_4.3.query.sqlpp
@@ -23,8 +23,8 @@
  * Issue        : 461
  */
  
-use dataverse test;
+use test;
 
-for $x in dataset('Employee')
-where $x.dur > day-time-duration("P350D")
-return $x
+SELECT VALUE ds
+FROM Employee ds
+WHERE ds.dur > `day-time-duration`("P350D");
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.3.query.aql
deleted file mode 100644
index f00285d..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.3.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : Create dataverse & query Metadata dataset Dataverse to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Dataverse')
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.3.query.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.3.query.sqlpp
index a3996e5..9ce9083 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta01/meta01.3.query.sqlpp
@@ -22,4 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
-// no inserts, deletes
+
+SELECT VALUE dv FROM
+Metadata.`Dataverse` dv;
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.1.ddl.sqlpp
index c025348..3c77859 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.1.ddl.sqlpp
@@ -27,7 +27,7 @@
 
 create type testdv.testtype as open {
 id : int32
-}
+};
 
 create dataset testdv.dst01(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.3.query.aql
deleted file mode 100644
index 8965740..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.3.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : Create dataset & query Metadata dataset Dataset to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-for $l in dataset('Metadata.Dataset')
-where $l.DataverseName = 'testdv' and $l.DatasetName = 'dst01'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.3.query.sqlpp
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.3.query.sqlpp
index e4dcffe..c528225 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta02/meta02.3.query.sqlpp
@@ -22,4 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
-// no inserts, deletes
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName = 'testdv' AND ds.DatasetName = 'dst01';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.sqlpp
index 08af3cb..8f50ed1 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.sqlpp
@@ -27,5 +27,5 @@
 
 create type testdv.testtype as closed {
 id : int32
-}
+};
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.2.update.aql
deleted file mode 100644
index a28a245..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.2.update.aql
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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  : Create closed type &  query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.3.query.aql
deleted file mode 100644
index 65d2a04..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create closed type &  query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.3.query.sqlpp
index 08af3cb..b10b523 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type/meta03_builtin_type.3.query.sqlpp
@@ -22,10 +22,6 @@
  * Date         : 15 Sep 2012
  */
 
-drop dataverse testdv if exists;
-create dataverse testdv;
-
-create type testdv.testtype as closed {
-id : int32
-}
-
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.1.ddl.sqlpp
index 5aadc0e..8a30514 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.1.ddl.sqlpp
@@ -27,4 +27,4 @@
 
 create type testdv.testtype as closed {
 id : int32?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.1.ddl.sqlpp
index e0ecb17..d87b7cd 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as closed {
 id : int32,
 list: [ string ]
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list/meta03_ordered_list.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.1.ddl.sqlpp
index bdcc0d8..2305b68 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as closed {
 id : int32,
 list: [ string ]?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/ordered_list_nullable/meta03_ordered_list_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.1.ddl.sqlpp
index f0b6bf7..cb1cb8a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as closed {
 id : int32,
 subtype: { sec_id: int32}
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record/meta03_record.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.1.ddl.sqlpp
index 60202f0..4a2aeb8 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as closed {
 id : int32,
 subtype: { sec_id: int32}?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/record_nullable/meta03_record_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.1.ddl.sqlpp
index c351be4..f03fa2a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as closed {
 id : int32,
 list: {{ string }}
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list/meta04_unordered_list.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.sqlpp
index 94ad64c..d0e8c86 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as closed {
 id : int32,
 list: {{ string }}?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.1.ddl.sqlpp
index 28d6b43..1618163 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.1.ddl.sqlpp
@@ -27,4 +27,4 @@
 
 create type testdv.testtype as open {
 id : int32
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type/meta04_builtin_type.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.1.ddl.sqlpp
index c93b3b6..322caba 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.1.ddl.sqlpp
@@ -27,4 +27,4 @@
 
 create type testdv.testtype as open {
 id : int32?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/builtin_type_nullable/meta04_builtin_type_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.1.ddl.sqlpp
index 44e4787..804e8f9 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as open {
 id : int32,
 list: [ string ]
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list/meta04_ordered_list.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.1.ddl.sqlpp
index 4ae5634..8a7ba27 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as open {
 id : int32,
 list: [ string ]?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/ordered_list_nullable/meta04_ordered_list_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.1.ddl.sqlpp
index d1777fe..5ef351a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as open {
 id : int32,
 subtype: { sec_id: int32}
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record/meta04_record.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.1.ddl.sqlpp
index 745491f..b8a9905 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as open {
 id : int32,
 subtype: { sec_id: int32}?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/record_nullable/meta04_record_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.1.ddl.sqlpp
index 12c3c9b..aea2f06 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as open {
 id : int32,
 list: {{ string }}
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.3.query.sqlpp
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.3.query.sqlpp
index 39ef6bd..5dc984a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list/meta04_unordered_list.3.query.sqlpp
@@ -22,3 +22,8 @@
  * Date         : 15 Sep 2012
  */
 
+
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.sqlpp
index 30416aa..8a8731c 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.1.ddl.sqlpp
@@ -28,4 +28,4 @@
 create type testdv.testtype as open {
 id : int32,
 list: {{ string }}?
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.2.update.aql
deleted file mode 100644
index 39ef6bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.aql
deleted file mode 100644
index aab3433..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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  : Create open type & query Metadata dataset Datatype to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-
-for $l in dataset('Metadata.Datatype')
-where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.sqlpp
index 39ef6bd..cad8659 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta03/builtin_type_nullable/meta03_builtin_type_nullable.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta04/complex_type/unordered_list_nullable/meta04_unordered_list_nullable.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='testdv' and t.DatatypeName='testtype';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.1.ddl.sqlpp
index b3b49b5..9fff3ca 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.1.ddl.sqlpp
@@ -28,7 +28,7 @@
 create type testdv.testtype as open {
 id : int32,
 name : string
-}
+};
 
 create dataset testdv.t1(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.3.query.aql
deleted file mode 100644
index d1e8391..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.3.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : Create primary & secondary indexes & query Metadata dataset to verify.
- * Expected Res : Success
- * Date         : 15 Sep 2012
- */
-
-for $l in dataset('Metadata.Index')
-where $l.DataverseName='testdv' 
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.3.query.sqlpp
index 84a6ff8..cc8fe15 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta05/meta05.3.query.sqlpp
@@ -22,3 +22,6 @@
  * Date         : 15 Sep 2012
  */
 
+SELECT VALUE idx
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName = 'testdv';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.1.ddl.sqlpp
index 342579b..6366217 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.1.ddl.sqlpp
@@ -26,6 +26,6 @@
 create dataverse testdv;
 
 create function testdv.fun01(){
-"This is an AQL Bodied UDF"
+"This is a SQLPP Bodied UDF"
 }
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.3.query.aql
deleted file mode 100644
index 7129805..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.3.query.aql
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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  : Create AQL bodied UDFs and verify that there are related entries in metadata Function dataset
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
-for $l in dataset('Metadata.Function')
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.3.query.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.3.query.sqlpp
index f6ba3a7..19cc518 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta06/meta06.3.query.sqlpp
@@ -22,3 +22,5 @@
  * Date         : Sep 17 2012
  */
 
+SELECT VALUE fn
+FROM Metadata.`Function` fn;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.1.ddl.aql
deleted file mode 100644
index b99884a..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.1.ddl.aql
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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  : Verify default entries for Node dataset in Metadata dataverse
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.2.update.aql
deleted file mode 100644
index 494aec05..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Verify default entries for Node dataset in Metadata dataverse
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.3.query.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.3.query.sqlpp
index a72982d..fac2f09 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta07/meta07.3.query.sqlpp
@@ -24,5 +24,5 @@
 
 // Please note this query was run on two nodes, i.e; two NCs
 
-for $l in dataset('Metadata.Node')
-return $l
+SELECT VALUE nd
+FROM Metadata.`Node` nd;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.2.update.aql
deleted file mode 100644
index 04be9cd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Verify default entries for Nodegroup dataset in Metadata dataverse
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.3.query.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.3.query.sqlpp
index 623f091..a9d49d2 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta08/meta08.3.query.sqlpp
@@ -24,5 +24,5 @@
 
 // Please note this query was run on two nodes, i.e; two NCs
 
-for $l in dataset('Metadata.Nodegroup')
-return $l
+SELECT VALUE ng
+FROM Metadata.`Nodegroup` ng;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.sqlpp
index ce9ab49..9354e7e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.sqlpp
@@ -27,7 +27,7 @@
 
 create type test.testtype as open {
 id:int32
-}
+};
 
 create dataset test.t1(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.2.update.aql
deleted file mode 100644
index d5624b9..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.2.update.aql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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  : Create internal dataset, insert data and query metadata Dataset to verify entries for that dataset.
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
-use dataverse test;
-
-insert into dataset test.t1({"id":123});
-insert into dataset test.t1({"id":133});
-insert into dataset test.t1({"id":223});
-insert into dataset test.t1({"id":127});
-insert into dataset test.t1({"id":423});
-insert into dataset test.t1({"id":183});
-insert into dataset test.t1({"id":193});
-insert into dataset test.t1({"id":129});
-insert into dataset test.t1({"id":373});
-insert into dataset test.t1({"id":282});
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.2.update.sqlpp
similarity index 74%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.2.update.sqlpp
index ce9ab49..67f19f1 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.2.update.sqlpp
@@ -22,12 +22,16 @@
  * Date         : Sep 17 2012
  */
 
-drop dataverse test if exists;
-create dataverse test;
+use test;
 
-create type test.testtype as open {
-id:int32
-}
-
-create dataset test.t1(testtype) primary key id;
+insert into test.t1({"id":123});
+insert into test.t1({"id":133});
+insert into test.t1({"id":223});
+insert into test.t1({"id":127});
+insert into test.t1({"id":423});
+insert into test.t1({"id":183});
+insert into test.t1({"id":193});
+insert into test.t1({"id":129});
+insert into test.t1({"id":373});
+insert into test.t1({"id":282});
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.3.query.sqlpp
similarity index 90%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.3.query.sqlpp
index 96189e4..d3f038a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta09/meta09.3.query.sqlpp
@@ -22,6 +22,6 @@
  * Date         : Sep 17 2012
  */
 
-for $l in dataset('Metadata.Dataset')
-where $l.DataverseName='test' and $l.DatasetName='t1'
-return $l
+SELECT VALUE ds
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test' and ds.DatasetName='t1';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.2.update.aql
deleted file mode 100644
index 3e06e46..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create dataverse and drop that dataverse and verify dataverse entries in metadata
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.3.query.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.3.query.sqlpp
index 05f57ee..1e7660e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta10/meta10.3.query.sqlpp
@@ -23,8 +23,6 @@
  */
 
 
-count(
-for $l in dataset('Metadata.Dataverse')
-where $l.DataverseName='test'
-return $l
-)
+SELECT VALUE COUNT(*)
+FROM Metadata.`Dataverse` dv
+WHERE dv.DataverseName='test';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.1.ddl.sqlpp
index e9af1a4..86628ac 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.1.ddl.sqlpp
@@ -27,7 +27,7 @@
 
 create type test.testtype as open {
 id : int32
-}
+};
 
 create dataset test.dst01(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.2.update.aql
deleted file mode 100644
index 8a051ad..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : Create dataset and drop that dataset and query Metadata Dataset to verify the drop.
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.3.query.sqlpp
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.3.query.sqlpp
index b2cc71d..ed615b0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta11/meta11.3.query.sqlpp
@@ -22,9 +22,6 @@
  * Date         : Sep 17 2012
  */
 
-count(
-for $l in dataset('Metadata.Dataset')
-where $l.DataverseName='test' and $l.DatasetName='dst01'
-return $l
-)
-
+SELECT VALUE COUNT(*)
+FROM Metadata.`Dataset` ds
+WHERE ds.DataverseName='test' and ds.DatasetName='dst01';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.1.ddl.sqlpp
index 751b741..9dcd6a7 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.1.ddl.sqlpp
@@ -28,7 +28,7 @@
 create type test.testtype as open {
 id : int32,
 name : string
-}
+};
 
 create dataset test.dst01(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.3.query.aql
deleted file mode 100644
index 545557f..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.3.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : Create secondary index and drop the secondary index and query metadata to verify drop index.
- * Expected Res : Success 
- * Date         : Sep 17 2012
- */
-
-for $l in dataset('Metadata.Index')
-where $l.DatasetName = 'dst01'
-return $l
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.3.query.sqlpp
index 04b34eb..a31d154 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta12/meta12.3.query.sqlpp
@@ -22,3 +22,7 @@
  * Date         : Sep 17 2012
  */
 
+SELECT VALUE idx
+FROM Metadata.`Index` idx
+WHERE idx.DatasetName = 'dst01';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.1.ddl.sqlpp
index 8cf7085..1f5c102 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.1.ddl.sqlpp
@@ -28,7 +28,7 @@
 
 create function test.foo(){
 "drop this function"
-}
+};
 
 drop function test.foo@0;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.3.query.aql
deleted file mode 100644
index 303c021..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.3.query.aql
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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  : Create functions and drop that function and query metadata 
- *              : to verify entries in Function dataset for the dropped UDF.
- * Expected Res : Success
- * Date         : Sep 17 2012
- */
-
-count(
-for $l in dataset('Metadata.Function')
-where $l.DataverseName='test' and $l.Name='foo' and $l.Arity='0'
-return $l);
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.3.query.sqlpp
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.3.query.sqlpp
index 3126d1f..9b7d679 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta13/meta13.3.query.sqlpp
@@ -23,3 +23,7 @@
  * Date         : Sep 17 2012
  */
 
+SELECT VALUE COUNT(*)
+FROM Metadata.`Function` fn
+WHERE fn.DataverseName='test' and fn.Name='foo' and fn.Arity='0';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.1.ddl.sqlpp
index 1699425..e12dd92 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.1.ddl.sqlpp
@@ -25,7 +25,7 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type FooType as closed {
    bar: int32?
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.3.query.aql
deleted file mode 100644
index 00c9700..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.3.query.aql
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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      :  Test that a synthetically created content type is dropped with its parent type. 
- *                     Guards against regression to issue 188.
- * Expected Result  :  Success
- */
-
-count(
-for $x in dataset('Metadata.Datatype')
-where $x.DataverseName='test'
-return $x
-)
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.3.query.sqlpp
index 8c7a346..f33f3cf 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta14/meta14.3.query.sqlpp
@@ -22,3 +22,6 @@
  * Expected Result  :  Success
  */
 
+SELECT VALUE COUNT(*)
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='test';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.1.ddl.aql
deleted file mode 100644
index 35a07616..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.1.ddl.aql
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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  : Query Metadata dataset Adapter to verify to contents.
- * Expected Res : Success
- * Date         : 25 Nov 2012
- */
-
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.3.query.aql
deleted file mode 100644
index 32ce3ad..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.3.query.aql
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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  : Query Metadata dataset Adapter to verify to contents.
- * Expected Res : Success
- * Date         : 25 Nov 2012
- */
-
-for $l in dataset('Metadata.DatasourceAdapter')
-order by $l.AdapterName
-return $l
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.3.query.sqlpp
index d1ffc6e..0412205 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta15/meta15.3.query.sqlpp
@@ -22,3 +22,6 @@
  * Date         : 25 Nov 2012
  */
 
+SELECT VALUE a
+FROM Metadata.`DatasourceAdapter` a
+ORDER by a.AdapterName;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.sqlpp
index cd0c11a..62a971a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.1.ddl.sqlpp
@@ -27,10 +27,8 @@
 
 create type testdv.testtype as open {
 id : int32
-}
+};
 
 create dataset testdv.t1(testtype) primary key id;
 
 create index idx1 on testdv.t1(name: string?) enforced;
-
-/* drop index testdv.t1.idx1; */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.3.query.sqlpp
index a28a66c..1a2cf66 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta16/meta16.3.query.sqlpp
@@ -22,7 +22,7 @@
  * Date         : 30 Sep 2013
  */
 
-for $l in dataset('Metadata.Index')
-where $l.DataverseName='testdv'
-return $l
+SELECT VALUE idx
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName='testdv';
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.sqlpp
index 4205378..1fb6b34 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.1.ddl.sqlpp
@@ -28,7 +28,7 @@
 create type testdv.testtype as open {
 id : int32,
 name : string?
-}
+};
 
 create dataset testdv.t1(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.sqlpp
similarity index 92%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.sqlpp
index c7c9f69..242375c 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.sqlpp
@@ -22,7 +22,6 @@
  * Date         : 30 Sep 2013
  */
 
-for $l in dataset('Metadata.Index')
-where $l.DataverseName='testdv'
-return $l
-
+SELECT VALUE idx
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName='testdv';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.sqlpp
index 2d6b3c0..7522cfb 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.1.ddl.sqlpp
@@ -27,7 +27,7 @@
 
 create type testdv.testtype as open {
 id : int32
-}
+};
 
 create dataset testdv.t1(testtype) primary key id;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.3.query.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.3.query.sqlpp
index e8ca427..381ce98 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.3.query.sqlpp
@@ -22,7 +22,7 @@
  * Date         : 30 Sep 2013
  */
 
-for $l in dataset('Metadata.Index')
-where $l.DataverseName='testdv'
-return $l.SearchKeyType
+SELECT VALUE idx.SearchKeyType
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName='testdv';
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.4.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.4.query.aql
deleted file mode 100644
index 774ff28..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.4.query.aql
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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  : Create primary index & secondary index on open union field & query Metadata dataset to verify.
- * Expected Res : Success
- * Date         : 30 Sep 2013
- */
-
-for $l in dataset('Metadata.Index')
-where $l.DataverseName='testdv'
-return $l.IsEnforced
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.4.query.sqlpp
similarity index 91%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.4.query.sqlpp
index c7c9f69..1135c0e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta17/meta17.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/meta24/meta24.4.query.sqlpp
@@ -22,7 +22,7 @@
  * Date         : 30 Sep 2013
  */
 
-for $l in dataset('Metadata.Index')
-where $l.DataverseName='testdv'
-return $l
+SELECT VALUE idx.IsEnforced
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName='testdv';
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.2.update.aql
deleted file mode 100644
index da3dfc0..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.2.update.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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  : query the Metadata dataset CompactionPolicy
- * Expected Res : Success
- * Date         : 13 Nov. 2013
- * Issue        : 646
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.3.query.aql
deleted file mode 100644
index f720b09..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.3.query.aql
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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  : query the Metadata dataset CompactionPolicy
- * Expected Res : Success
- * Date         : 13 Nov. 2013
- * Issue        : 646
- */
- 
-for $x in dataset Metadata.CompactionPolicy
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.3.query.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.3.query.sqlpp
index da3dfc0..8770e4f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_compaction_policy/metadata_compaction_policy.3.query.sqlpp
@@ -22,3 +22,6 @@
  * Date         : 13 Nov. 2013
  * Issue        : 646
  */
+
+SELECT VALUE cp
+FROM Metadata.`CompactionPolicy` cp;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.2.update.aql
deleted file mode 100644
index bd244d0..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.2.update.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.3.query.aql
deleted file mode 100644
index 7a457fd..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.3.query.aql
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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 Metadata;
-
-for $c in dataset('Dataset')
-where $c.DataverseName='Metadata'
-return $c
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.3.query.sqlpp
index 921b7b1..7046f2a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.3.query.sqlpp
@@ -16,4 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-drop index Cust.ord;
+use Metadata;
+
+SELECT VALUE ds
+FROM `Dataset` ds
+WHERE ds.DataverseName = 'Metadata';
+
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.1.ddl.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.1.ddl.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.3.query.aql
deleted file mode 100644
index 66acc08..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.3.query.aql
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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 Metadata;
-     
-for $c in dataset('Datatype')
-where $c.DataverseName='Metadata'
-return $c
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.3.query.sqlpp
index 921b7b1..d3ac6f9 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype/metadata_datatype.3.query.sqlpp
@@ -16,4 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-drop index Cust.ord;
+use Metadata;
+
+SELECT VALUE t
+FROM `Datatype` t
+WHERE t.DataverseName='Metadata';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.1.ddl.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.1.ddl.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.3.query.aql
deleted file mode 100644
index 1a05cdb..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 Metadata;
-
-for $c in dataset('Dataverse')
-return $c
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.3.query.sqlpp
similarity index 93%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.3.query.sqlpp
index 921b7b1..5ce7162 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse/metadata_dataverse.3.query.sqlpp
@@ -16,4 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-drop index Cust.ord;
+use Metadata;
+
+SELECT VALUE dv
+FROM `Dataverse` dv;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.1.ddl.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.1.ddl.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.3.query.aql
deleted file mode 100644
index a11b850..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.3.query.aql
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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 Metadata;
-
-for $c in dataset('Index')
-where $c.DataverseName='Metadata'
-return $c
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.3.query.sqlpp
index bd244d0..4f3d2d4 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_index/metadata_index.3.query.sqlpp
@@ -16,4 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+use Metadata;
 
+SELECT VALUE idx
+FROM `Index` idx
+WHERE idx.DataverseName='Metadata';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.1.ddl.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.1.ddl.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.3.query.aql
deleted file mode 100644
index 240c60f..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 Metadata;    
-
-for $c in dataset('Node')
-return $c
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.3.query.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.3.query.sqlpp
index bd244d0..c07604e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset/metadata_dataset.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_node/metadata_node.3.query.sqlpp
@@ -16,4 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+use Metadata;
 
+SELECT VALUE nd
+FROM `Node` nd;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.1.ddl.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.1.ddl.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.2.update.aql
deleted file mode 100644
index 042f3ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.2.update.aql
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.3.query.aql
deleted file mode 100644
index a59a39b..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.3.query.aql
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 Metadata;
-     
-for $c in dataset('Nodegroup')
-return $c
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.3.query.sqlpp
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.3.query.sqlpp
index 921b7b1..27a5984 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup/metadata_nodegroup.3.query.sqlpp
@@ -16,4 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-drop index Cust.ord;
+use Metadata;
+
+SELECT VALUE ng
+FROM `Nodegroup` ng;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.3.query.aql
deleted file mode 100644
index 569d3d1..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.3.query.aql
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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  : Checks whether a meta-data self-join query works or not.
- * Expected Res : Success
- * Issue        : ASTERIXDB-1231
- */
-
-use dataverse Metadata;
-
-for $m in dataset Metadata.Dataset
-for $n in dataset Metadata.Dataset
-where $m=$n
-return
-{ "dv1": $m.DataverseName, "dv2": $n.DataverseName }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.2.update.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.3.query.sqlpp
similarity index 86%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.2.update.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.3.query.sqlpp
index 15bf59a..2d4e8ce 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.2.update.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/basic/metadata_selfjoin/metadata_selfjoin.3.query.sqlpp
@@ -21,4 +21,10 @@
  * Description  : Checks whether a meta-data self-join query works or not.
  * Expected Res : Success
  * Issue        : ASTERIXDB-1231
- */
\ No newline at end of file
+ */
+
+use Metadata;
+
+SELECT ds1.DataverseName as dv1, ds2.DataverseName as dv2
+FROM Metadata.`Dataset` ds1, Metadata.`Dataset` ds2
+WHERE ds1 = ds2;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql
deleted file mode 100644
index 845e6c5..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 dataset DBLP;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset/exception_drop_dataset.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset/exception_drop_dataset.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset/exception_drop_dataset.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset/exception_drop_dataset.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql
deleted file mode 100644
index c52588b..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 fuzzyjoin;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse/exception_drop_dataverse.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse/exception_drop_dataverse.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse/exception_drop_dataverse.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse/exception_drop_dataverse.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index/exception_drop_index.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index/exception_drop_index.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index/exception_drop_index.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index/exception_drop_index.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
deleted file mode 100644
index 7404b60..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 nodegroup group1;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup/exception_drop_nodegroup.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup/exception_drop_nodegroup.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup/exception_drop_nodegroup.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup/exception_drop_nodegroup.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql
deleted file mode 100644
index e4f386b..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 type AddressType;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1/exception_drop_type1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1/exception_drop_type1.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1/exception_drop_type1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1/exception_drop_type1.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql
deleted file mode 100644
index a67cbab..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 type CustomerType;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2/exception_drop_type2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2/exception_drop_type2.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2/exception_drop_type2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2/exception_drop_type2.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql
deleted file mode 100644
index 21cdbb1..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 type StreetType;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3/exception_drop_type3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3/exception_drop_type3.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3/exception_drop_type3.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3/exception_drop_type3.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1.aql
deleted file mode 100644
index 7d2bd1c..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Dataset
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Dataset;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1/issue_239_drop_system_dataset_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1/issue_239_drop_system_dataset_1.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1/issue_239_drop_system_dataset_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1/issue_239_drop_system_dataset_1.1.ddl.sqlpp
index 7d2bd1c..b8334dc 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1/issue_239_drop_system_dataset_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_1/issue_239_drop_system_dataset_1.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Dataset;
+drop dataset Metadata.`Dataset`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2/issue_239_drop_system_dataset_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2/issue_239_drop_system_dataset_2.1.ddl.aql
deleted file mode 100644
index 228abae..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2/issue_239_drop_system_dataset_2.1.ddl.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Dataset
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Dataverse;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2/issue_239_drop_system_dataset_2.1.ddl.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2/issue_239_drop_system_dataset_2.1.ddl.sqlpp
index 228abae..f3650ae 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_2/issue_239_drop_system_dataset_2.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Dataverse;
+drop dataset Metadata.`Dataverse`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3/issue_239_drop_system_dataset_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3/issue_239_drop_system_dataset_3.1.ddl.aql
deleted file mode 100644
index 822c596..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3/issue_239_drop_system_dataset_3.1.ddl.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Nodegroup
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Nodegroup;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3/issue_239_drop_system_dataset_3.1.ddl.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3/issue_239_drop_system_dataset_3.1.ddl.sqlpp
index 822c596..9556b7b 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_3/issue_239_drop_system_dataset_3.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Nodegroup;
+drop dataset Metadata.`Nodegroup`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4/issue_239_drop_system_dataset_4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4/issue_239_drop_system_dataset_4.1.ddl.aql
deleted file mode 100644
index 31413e3..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4/issue_239_drop_system_dataset_4.1.ddl.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Index
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Index;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4/issue_239_drop_system_dataset_4.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4/issue_239_drop_system_dataset_4.1.ddl.sqlpp
index 31413e3..ae8eb91 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_4/issue_239_drop_system_dataset_4.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Index;
+drop dataset Metadata.`Index`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5.aql
deleted file mode 100644
index 338c9ea..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.DatasourceAdapter
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.DatasourceAdapter;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5/issue_239_drop_system_dataset_5.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5/issue_239_drop_system_dataset_5.1.ddl.sqlpp
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5/issue_239_drop_system_dataset_5.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5/issue_239_drop_system_dataset_5.1.ddl.sqlpp
index 338c9ea..0b51df0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5/issue_239_drop_system_dataset_5.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_5/issue_239_drop_system_dataset_5.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.DatasourceAdapter;
+drop dataset Metadata.`DatasourceAdapter`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6.aql
deleted file mode 100644
index 2f67a6f..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Function
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Function;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6/issue_239_drop_system_dataset_6.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6/issue_239_drop_system_dataset_6.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6/issue_239_drop_system_dataset_6.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6/issue_239_drop_system_dataset_6.1.ddl.sqlpp
index 2f67a6f..546487f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6/issue_239_drop_system_dataset_6.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_6/issue_239_drop_system_dataset_6.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Function;
+drop dataset Metadata.`Function`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7.aql
deleted file mode 100644
index beaf463..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Datatype
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Datatype;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7/issue_239_drop_system_dataset_7.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7/issue_239_drop_system_dataset_7.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7/issue_239_drop_system_dataset_7.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7/issue_239_drop_system_dataset_7.1.ddl.sqlpp
index beaf463..11adc6a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7/issue_239_drop_system_dataset_7.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_7/issue_239_drop_system_dataset_7.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Datatype;
+drop dataset Metadata.`Datatype`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8/issue_239_drop_system_dataset_8.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8/issue_239_drop_system_dataset_8.1.ddl.aql
deleted file mode 100644
index 36ebb64..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8/issue_239_drop_system_dataset_8.1.ddl.aql
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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  : Drop a system dataset- Metadata.Node
- * Expected Res : Failure
- * Date         : 13 Jan 2013
- * Issue        : 239
- */
-
-drop dataset Metadata.Node;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8/issue_239_drop_system_dataset_8.1.ddl.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8/issue_239_drop_system_dataset_8.1.ddl.sqlpp
index 36ebb64..b991697 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_239_drop_system_dataset_8/issue_239_drop_system_dataset_8.1.ddl.sqlpp
@@ -23,4 +23,4 @@
  * Issue        : 239
  */
 
-drop dataset Metadata.Node;
+drop dataset Metadata.`Node`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1/issue_251_dataset_hint_error_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1/issue_251_dataset_hint_error_1.1.ddl.aql
deleted file mode 100644
index 37e1476..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1/issue_251_dataset_hint_error_1.1.ddl.aql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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  : create a dataset providing invalid hints
- * Expected Res : Failure
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type LineType as open {
-  id:int32,
-  text: string
-}
-
-create dataset Book(LineType)
-primary key id
-hints(size=2000,tuple_size=100);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1/issue_251_dataset_hint_error_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1/issue_251_dataset_hint_error_1.1.ddl.sqlpp
index 37e1476..50d7d89 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1/issue_251_dataset_hint_error_1.1.ddl.sqlpp
@@ -25,12 +25,12 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType)
 primary key id
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql
deleted file mode 100644
index cae85c7..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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  : create a dataset providingi an invalid value for a hint and an unknown hint
- * Expected Res : Failure
- * Date         : 29 Jan 2013
- * Issue        : 251
- */
-
-
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type LineType as open {
-  id:int32,
-  text: string
-}
-
-create dataset Book(LineType)
-primary key id
-hints(cardinality="-20jh0",size=45);
-
-for $x in dataset('Metadata.Dataset')
-where $x.DataverseName='test'
-return $x
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2/issue_251_dataset_hint_error_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2/issue_251_dataset_hint_error_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2/issue_251_dataset_hint_error_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2/issue_251_dataset_hint_error_2.1.ddl.sqlpp
index f5e87c6..438ff47 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2/issue_251_dataset_hint_error_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2/issue_251_dataset_hint_error_2.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type LineType as open {
   id:int32,
   text: string
-}
+};
 
 create dataset Book(LineType)
 primary key id
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_1/issue_255_create_dataset_error_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_1/issue_255_create_dataset_error_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_1/issue_255_create_dataset_error_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_1/issue_255_create_dataset_error_1.1.ddl.sqlpp
index 7c0d4a2..d55c0e3 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_1/issue_255_create_dataset_error_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_1/issue_255_create_dataset_error_1.1.ddl.sqlpp
@@ -25,10 +25,10 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32
-}
+};
 
 create dataset testds(opentype) primary key name;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_2/issue_255_create_dataset_error_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_2/issue_255_create_dataset_error_2.1.ddl.sqlpp
similarity index 91%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_2/issue_255_create_dataset_error_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_2/issue_255_create_dataset_error_2.1.ddl.sqlpp
index bebae2d..1fecf9e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_2/issue_255_create_dataset_error_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_dataset_error_2/issue_255_create_dataset_error_2.1.ddl.sqlpp
@@ -25,15 +25,15 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type opentype1 as open {
 id:int32
-}
+};
 
 create type opentype2 as open {
 id:int32,
-open-type:opentype1
-}
+`open-type`:opentype1
+};
 
-create dataset testds(opentype2) primary key open-type;
+create dataset testds(opentype2) primary key `open-type`;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_feed_error/issue_255_create_feed_error.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_feed_error/issue_255_create_feed_error.1.ddl.aql
deleted file mode 100644
index 5244af0..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_255_create_feed_error/issue_255_create_feed_error.1.ddl.aql
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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  : create a dataset partitioned on non-existent field
- * Expected Res : Failure
- * Date         : 14 April 2013
- * Issue        : 255
- */
-
-drop dataverse feeds if exists;
-create dataverse feeds;
-use dataverse feeds;
-
-create type TweetType as closed {
-  id: string,
-  username : string,
-  location : string,
-  text : string,
-  timestamp : string
-}      
-
-create feed dataset TweetFeed(TweetType)
-using "org.apache.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
-(("output-type-name"="TweetType"),("fs"="localfs"),("path"="asterix_nc1://data/twitter/obamatweets.adm"),("format"="adm"),("tuple-interval"="10"))
-primary key name;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_1/issue_266_create_dataset_error_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_1/issue_266_create_dataset_error_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_1/issue_266_create_dataset_error_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_1/issue_266_create_dataset_error_1.1.ddl.sqlpp
index 876fad0..f304848 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_1/issue_266_create_dataset_error_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_1/issue_266_create_dataset_error_1.1.ddl.sqlpp
@@ -25,10 +25,10 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type opentype as open {
 loc:point
-}
+};
 
 create dataset testds(opentype) primary key point;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_2/issue_266_create_dataset_error_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_2/issue_266_create_dataset_error_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_2/issue_266_create_dataset_error_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_2/issue_266_create_dataset_error_2.1.ddl.sqlpp
index 18bc128..6d9cdb0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_2/issue_266_create_dataset_error_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_266_create_dataset_error_2/issue_266_create_dataset_error_2.1.ddl.sqlpp
@@ -25,10 +25,10 @@
 
 drop dataverse test if exists;
 create dataverse test;
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32?
-}
+};
 
 create dataset testds(opentype) primary key id;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_1/issue_272_create_index_error_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_1/issue_272_create_index_error_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_1/issue_272_create_index_error_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_1/issue_272_create_index_error_1.1.ddl.sqlpp
index da09304..883b3e4 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_1/issue_272_create_index_error_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_1/issue_272_create_index_error_1.1.ddl.sqlpp
@@ -26,6 +26,6 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 create index loc_index on Foo(name);
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_2/issue_272_create_index_error_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_2/issue_272_create_index_error_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_2/issue_272_create_index_error_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_2/issue_272_create_index_error_2.1.ddl.sqlpp
index 826cb55..f44003c 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_2/issue_272_create_index_error_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_272_create_index_error_2/issue_272_create_index_error_2.1.ddl.sqlpp
@@ -26,7 +26,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create index loc_index if not exists on Foo(name);
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_1/issue_384_create_index_error_1.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_1/issue_384_create_index_error_1.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_1/issue_384_create_index_error_1.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_1/issue_384_create_index_error_1.1.ddl.sqlpp
index a1278f8..256f7d3 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_1/issue_384_create_index_error_1.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_1/issue_384_create_index_error_1.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32,
 loc:point
-}
+};
 
 create dataset testds(opentype) primary key id;
 create index loc_index on testds(loc);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_2/issue_384_create_index_error_2.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_2/issue_384_create_index_error_2.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_2/issue_384_create_index_error_2.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_2/issue_384_create_index_error_2.1.ddl.sqlpp
index 0fe5247..52ffc22 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_2/issue_384_create_index_error_2.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_2/issue_384_create_index_error_2.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32,
 age:int32
-}
+};
 
 create dataset testds(opentype) primary key id;
 create index loc_index on testds(age) type rtree;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.sqlpp
index 7a9ff2e..21ec004 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32,
 loc:point
-}
+};
 
 create dataset testds(opentype) primary key id;
 create index loc_index on testds(loc) type keyword;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_4/issue_384_create_index_error_4.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_4/issue_384_create_index_error_4.1.ddl.aql
deleted file mode 100644
index 7a9ff2e..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_4/issue_384_create_index_error_4.1.ddl.aql
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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  : create a keyword index on unallowed key type.
- * Expected Res : Failure
- * Date         : 23 April 2013
- * Issue        : 384
- */
-
-drop dataverse test if exists;
-create dataverse test;
-
-use dataverse test;
-
-create type opentype as open {
-id:int32,
-loc:point
-}
-
-create dataset testds(opentype) primary key id;
-create index loc_index on testds(loc) type keyword;
-
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_4/issue_384_create_index_error_4.1.ddl.sqlpp
similarity index 97%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_4/issue_384_create_index_error_4.1.ddl.sqlpp
index 7a9ff2e..21ec004 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_3/issue_384_create_index_error_3.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_4/issue_384_create_index_error_4.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32,
 loc:point
-}
+};
 
 create dataset testds(opentype) primary key id;
 create index loc_index on testds(loc) type keyword;
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_5/issue_384_create_index_error_5.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_5/issue_384_create_index_error_5.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_5/issue_384_create_index_error_5.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_5/issue_384_create_index_error_5.1.ddl.sqlpp
index 70998e9..85a6cb2 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_5/issue_384_create_index_error_5.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_5/issue_384_create_index_error_5.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32,
 loc:point
-}
+};
 
 create dataset testds(opentype) primary key id;
 create index loc_index on testds(loc) type ngram(2);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_6/issue_384_create_index_error_6.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_6/issue_384_create_index_error_6.1.ddl.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_6/issue_384_create_index_error_6.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_6/issue_384_create_index_error_6.1.ddl.sqlpp
index 7576c42..b165e4e 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_6/issue_384_create_index_error_6.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/exception/issue_384_create_index_error_6/issue_384_create_index_error_6.1.ddl.sqlpp
@@ -26,12 +26,12 @@
 drop dataverse test if exists;
 create dataverse test;
 
-use dataverse test;
+use test;
 
 create type opentype as open {
 id:int32,
 loc:point
-}
+};
 
 create dataset testds(opentype) primary key id;
 create index loc_index on testds(loc) type ngram(2);
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.sqlpp
index fda1632..ace30a0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.sqlpp
@@ -26,19 +26,19 @@
 
 create dataverse custord;
 
-use dataverse custord;
+use custord;
 
 create type StreetType as closed {
   number: int32?,
   name: string
-}
+};
 
 create type AddressType as open {
   street: StreetType,
   city: string,
   state: string,
   zip: int16
-}
+};
 
 create type CustomerType as closed {
   cid: int32, 
@@ -50,7 +50,7 @@
              name : string,
              dob : string
              } ]
-}
+};
 
 create type OrderType as open {
   oid: int32,
@@ -63,10 +63,10 @@
        number: int64,
        storeIds: {{int8}} 
        } ]
-}
+};
 
 
 create type StreetType as closed {
   number: int32?,
   name: string
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success/failure_previous_success.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success/failure_previous_success.1.ddl.aql
deleted file mode 100644
index fda1632..0000000
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success/failure_previous_success.1.ddl.aql
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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  : Cause a failure by creating an existing type. Verify that rollback does not affect the pre-existing types.
- *                Verification is done in a separate session (compilation unit).
- * Expected Res : Success
- * Date         : 24 Nov 2012
- */
-drop dataverse custord if exists;
-
-create dataverse custord;
-
-use dataverse custord;
-
-create type StreetType as closed {
-  number: int32?,
-  name: string
-}
-
-create type AddressType as open {
-  street: StreetType,
-  city: string,
-  state: string,
-  zip: int16
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ {
-             name : string,
-             dob : string
-             } ]
-}
-
-create type OrderType as open {
-  oid: int32,
-  cid: int32,
-  orderstatus: string,
-  orderpriority: string,
-  clerk: string,
-  total: float,
-  items: [ {
-       number: int64,
-       storeIds: {{int8}} 
-       } ]
-}
-
-
-create type StreetType as closed {
-  number: int32?,
-  name: string
-}
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success/failure_previous_success.1.ddl.sqlpp
similarity index 97%
copy from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
copy to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success/failure_previous_success.1.ddl.sqlpp
index fda1632..ace30a0 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success/failure_previous_success.1.ddl.sqlpp
@@ -26,19 +26,19 @@
 
 create dataverse custord;
 
-use dataverse custord;
+use custord;
 
 create type StreetType as closed {
   number: int32?,
   name: string
-}
+};
 
 create type AddressType as open {
   street: StreetType,
   city: string,
   state: string,
   zip: int16
-}
+};
 
 create type CustomerType as closed {
   cid: int32, 
@@ -50,7 +50,7 @@
              name : string,
              dob : string
              } ]
-}
+};
 
 create type OrderType as open {
   oid: int32,
@@ -63,10 +63,10 @@
        number: int64,
        storeIds: {{int8}} 
        } ]
-}
+};
 
 
 create type StreetType as closed {
   number: int32?,
   name: string
-}
+};
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.sqlpp
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.sqlpp
index 9f4ac09..e84f65c 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.sqlpp
@@ -26,19 +26,19 @@
 
 create dataverse custord;
 
-use dataverse custord;
+use custord;
 
 create type StreetType as closed {
   number: int32?,
   name: string
-}
+};
 
 create type AddressType as open {
   street: StreetType,
   city: string,
   state: string,
   zip: int16
-}
+};
 
 create type CustomerType as closed {
   cid: int32, 
@@ -50,7 +50,7 @@
              name : string,
              dob : string
              } ]
-}
+};
 
 create nodegroup group1 if not exists on asterix_nc1, asterix_nc2;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution/failure_subsequent_no_execution.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution/failure_subsequent_no_execution.1.ddl.sqlpp
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution/failure_subsequent_no_execution.1.ddl.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution/failure_subsequent_no_execution.1.ddl.sqlpp
index 9f4ac09..e84f65c 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution/failure_subsequent_no_execution.1.ddl.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution/failure_subsequent_no_execution.1.ddl.sqlpp
@@ -26,19 +26,19 @@
 
 create dataverse custord;
 
-use dataverse custord;
+use custord;
 
 create type StreetType as closed {
   number: int32?,
   name: string
-}
+};
 
 create type AddressType as open {
   street: StreetType,
   city: string,
   state: string,
   zip: int16
-}
+};
 
 create type CustomerType as closed {
   cid: int32, 
@@ -50,7 +50,7 @@
              name : string,
              dob : string
              } ]
-}
+};
 
 create nodegroup group1 if not exists on asterix_nc1, asterix_nc2;
 
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.sqlpp
similarity index 86%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.sqlpp
index cb458ca..041fc6d 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.sqlpp
@@ -17,14 +17,14 @@
  * under the License.
  */
 /*
- * Description  : Verify the state of the Metadata adter the failure caused in failure_previous_success.aql 
+ * Description  : Verify the state of the Metadata adter the failure caused in failure_previous_success.sqlpp
  * Expected Res : Success
  * Date         : 24 Nov 2012
  */
-use dataverse custord;
+use custord;
 
 write output to asterix_nc1:"mdtest/transaction_verify_failure_previous_success.adm";
 
-for $x in dataset('Metadata.Datatype')
-where $x.DataverseName='custord'
-return $x
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='custord';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success/verify_failure_previous_success.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success/verify_failure_previous_success.3.query.sqlpp
similarity index 85%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success/verify_failure_previous_success.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success/verify_failure_previous_success.3.query.sqlpp
index 8a18dc2..2cf493a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success/verify_failure_previous_success.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success/verify_failure_previous_success.3.query.sqlpp
@@ -17,13 +17,13 @@
  * under the License.
  */
 /*
- * Description  : Verify the state of the Metadata adter the failure caused in failure_previous_success.aql 
+ * Description  : Verify the state of the Metadata adter the failure caused in failure_previous_success.sqlpp
  * Expected Res : Success
  * Date         : 24 Nov 2012
  */
 
-use dataverse custord;
+use custord;
 
-for $x in dataset('Metadata.Datatype')
-where $x.DataverseName='custord'
-return $x
+SELECT VALUE t
+FROM Metadata.`Datatype` t
+WHERE t.DataverseName='custord';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.sqlpp
similarity index 86%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.sqlpp
index e4fc62a..16c9b26 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.sqlpp
@@ -17,15 +17,15 @@
  * under the License.
  */
 /*
- * Description  : Verify the state of the metadata after the failure caused by failure_subsequent_no_execution.aql
+ * Description  : Verify the state of the metadata after the failure caused by failure_subsequent_no_execution.sqlpp
  * Expected Res : Success
  * Date         : 24 Nov 2012
  */
 
-use dataverse custord;
+use custord;
 
 write output to asterix_nc1:"mdtest/transaction_verify_failure_subsequent_no_execution.adm";
 
-for $x in dataset('Metadata.Index')
-where $x.DataverseName='custord'
-return $x
+SELECT VALUE idx
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName='custord';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution/verify_failure_subsequent_no_execution.3.query.aql b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution/verify_failure_subsequent_no_execution.3.query.sqlpp
similarity index 85%
rename from asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution/verify_failure_subsequent_no_execution.3.query.aql
rename to asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution/verify_failure_subsequent_no_execution.3.query.sqlpp
index 131eeb0..913eb71 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution/verify_failure_subsequent_no_execution.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution/verify_failure_subsequent_no_execution.3.query.sqlpp
@@ -17,13 +17,13 @@
  * under the License.
  */
 /*
- * Description  : Verify the state of the metadata after the failure caused by failure_subsequent_no_execution.aql
+ * Description  : Verify the state of the metadata after the failure caused by failure_subsequent_no_execution.sqlpp
  * Expected Res : Success
  * Date         : 24 Nov 2012
  */
 
-use dataverse custord;
+use custord;
 
-for $x in dataset('Metadata.Index')
-where $x.DataverseName='custord'
-return $x
+SELECT VALUE idx
+FROM Metadata.`Index` idx
+WHERE idx.DataverseName='custord';
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta06/meta06.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta06/meta06.1.adm
index a7ebb36..420d799 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta06/meta06.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta06/meta06.1.adm
@@ -1 +1 @@
-{ "DataverseName": "testdv", "Name": "fun01", "Arity": "0", "Params": [  ], "ReturnType": "", "Definition": "\"This is an AQL Bodied UDF\"", "Language": "AQL", "Kind": "SCALAR", "Dependencies": [ [  ], [  ], [  ] ] }
+{ "DataverseName": "testdv", "Name": "fun01", "Arity": "0", "Params": [  ], "ReturnType": "", "Definition": "\"This is a SQLPP Bodied UDF\"", "Language": "SQLPP", "Kind": "SCALAR", "Dependencies": [ [  ], [  ], [  ] ] }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/testsuite.xml b/asterixdb/asterix-app/src/test/resources/metadata/testsuite.xml
index db10dcb..616691f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/metadata/testsuite.xml
@@ -16,7 +16,7 @@
  ! specific language governing permissions and limitations
  ! under the License.
  !-->
-<test-suite xmlns="urn:xml.testframework.asterix.apache.org" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
+<test-suite xmlns="urn:xml.testframework.asterix.apache.org" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".sqlpp">
   <test-group name="basic">
     <test-case FilePath="basic">
       <compilation-unit name="dataset_with_default_dataverse_type">