You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by sj...@apache.org on 2017/04/21 03:05:20 UTC

[1/3] asterixdb-bad git commit: Move BAD from AQL to SQL++

Repository: asterixdb-bad
Updated Branches:
  refs/heads/master 3b20a63c6 -> 55514040b


http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.sqlpp
new file mode 100644
index 0000000..dd9e350
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute deleteAll();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.aql
deleted file mode 100644
index 16013d3..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.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  : Simple Delete Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-count(for $i in dataset UserLocations
-return $i);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.sqlpp
new file mode 100644
index 0000000..c3a42ea
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(location) from UserLocations location;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.aql
deleted file mode 100644
index b3eebc0..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.aql
+++ /dev/null
@@ -1,43 +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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type myLocation as {
-  timeStamp: datetime,
-  roomNumber: int
-}
-
-
-create dataset UserLocations(myLocation)
-primary key timeStamp;
-
-create procedure findMe() {
-  insert into dataset UserLocations([
-    {"timeStamp":current-datetime(), "roomNumber":222}]
-  )
-};

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.sqlpp
new file mode 100644
index 0000000..783aacb
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.sqlpp
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type myLocation as {
+  timeStamp: datetime,
+  roomNumber: int
+}
+
+
+create dataset UserLocations(myLocation)
+primary key timeStamp;
+
+create procedure addMe() {
+  insert into UserLocations([
+    {"timeStamp":current_datetime(), "roomNumber":222}]
+  )
+};

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.aql
deleted file mode 100644
index 4f9a164..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute findMe();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.sqlpp
new file mode 100644
index 0000000..8610395
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute addMe();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.aql
deleted file mode 100644
index 4f9a164..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute findMe();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.sqlpp
new file mode 100644
index 0000000..8610395
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute addMe();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.aql
deleted file mode 100644
index 4f9a164..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute findMe();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.sqlpp
new file mode 100644
index 0000000..8610395
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute addMe();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.aql
deleted file mode 100644
index 9128d0f..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.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  : Simple Insert Procedure
-* Expected Res : 3
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-drop procedure findMe@0;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.sqlpp
new file mode 100644
index 0000000..5ed56cf
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : 3
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+drop procedure addMe@0;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.aql
deleted file mode 100644
index 5bf00cf..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-count(for $i in dataset UserLocations
-return $i);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.sqlpp
new file mode 100644
index 0000000..2094a77
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(location) from UserLocations location;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.aql
deleted file mode 100644
index 8a23b38..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.aql
+++ /dev/null
@@ -1,43 +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  : Simple Query Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type myLocation as {
-  timeStamp: datetime,
-  roomNumber: int
-}
-
-
-create dataset UserLocations(myLocation)
-primary key timeStamp;
-
-create procedure findMe() {
-for $i in dataset UserLocations
-order by $i.timeStamp
-return $i.roomNumber
-};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.sqlpp
new file mode 100644
index 0000000..8cdfc6a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.sqlpp
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type myLocation as {
+  timeStamp: datetime,
+  roomNumber: int
+}
+
+
+create dataset UserLocations(myLocation)
+primary key timeStamp;
+
+create procedure findMe() {
+select roomNumber from UserLocations
+order by timeStamp;
+};

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.aql
deleted file mode 100644
index d7eb3eb..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.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  : Simple Query Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-
-insert into dataset UserLocations([
-  {"timeStamp":current-datetime(), "roomNumber":222}]
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.sqlpp
new file mode 100644
index 0000000..28370e9
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+
+insert into UserLocations([
+  {"timeStamp":current_datetime(), "roomNumber":222}]
+)

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.aql
deleted file mode 100644
index d21ef6f..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.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  : Simple Query Procedure
-* Expected Res : 222
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute findMe();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.sqlpp
new file mode 100644
index 0000000..5d02928
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure
+* Expected Res : 222
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute findMe();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.aql
deleted file mode 100644
index 3af0eeb..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.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  : Simple Query Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-insert into dataset UserLocations([
-  {"timeStamp":current-datetime(), "roomNumber":225}]
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.sqlpp
new file mode 100644
index 0000000..ef3184b
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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  : Simple Query Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+insert into UserLocations([
+  {"timeStamp":current_datetime(), "roomNumber":225}]
+)

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.aql
deleted file mode 100644
index ce66457..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.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  : Simple Query Procedure
-* Expected Res : 222,225
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute findMe();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.sqlpp
new file mode 100644
index 0000000..fb92f66
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure
+* Expected Res : 222,225
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute findMe();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.aql
deleted file mode 100644
index a940ace..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.aql
+++ /dev/null
@@ -1,43 +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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type myLocation as {
-  timeStamp: datetime,
-  roomNumber: int
-}
-
-
-create dataset UserLocations(myLocation)
-primary key timeStamp;
-
-create procedure findMe() {
-  insert into dataset UserLocations([
-    {"timeStamp":current-datetime(), "roomNumber":222}]
-  )
-} period duration("PT5S");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.sqlpp
new file mode 100644
index 0000000..b89d997
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.sqlpp
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type myLocation as {
+  timeStamp: datetime,
+  roomNumber: int
+}
+
+
+create dataset UserLocations(myLocation)
+primary key timeStamp;
+
+create procedure addMe() {
+  insert into UserLocations([
+    {"timeStamp":current_datetime(), "roomNumber":222}]
+  )
+} period duration("PT5S");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.aql
deleted file mode 100644
index 4f9a164..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute findMe();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.sqlpp
new file mode 100644
index 0000000..8610395
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute addMe();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.aql
deleted file mode 100644
index 361f288..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-11000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.sqlpp
new file mode 100644
index 0000000..af1e202
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+11000

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.aql
deleted file mode 100644
index c974aa0..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.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  : Simple Insert Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-drop procedure findMe@0;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.sqlpp
new file mode 100644
index 0000000..2ebf4b1
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+drop procedure addMe@0;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.aql
deleted file mode 100644
index 14321a1..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.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  : Simple Insert Procedure
-* Expected Res : 3
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-count(for $i in dataset UserLocations
-return $i);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.sqlpp
new file mode 100644
index 0000000..d84d2dd
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : 3
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(location) from UserLocations location;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.1.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.1.adm b/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.1.adm
new file mode 100644
index 0000000..ce8cc0f
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.1.adm
@@ -0,0 +1,2 @@
+{ "BrokerName": "brokerA", "param0": 123 }
+{ "BrokerName": "brokerB", "param0": 350 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.2.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.2.adm b/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.2.adm
new file mode 100644
index 0000000..0abd600
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.2.adm
@@ -0,0 +1,2 @@
+{ "userId": 1 }
+{ "userId": 3 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.3.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.3.adm b/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.3.adm
deleted file mode 100644
index 8f3c264..0000000
--- a/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.3.adm
+++ /dev/null
@@ -1,2 +0,0 @@
-{ "broker": "brokerA", "parameter": 123 }
-{ "broker": "brokerB", "parameter": 350 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.7.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.7.adm b/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.7.adm
deleted file mode 100644
index c396a2c..0000000
--- a/asterix-bad/src/test/resources/runtimets/results/channel/room_occupants/room_occupants.7.adm
+++ /dev/null
@@ -1,2 +0,0 @@
-1
-3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/testsuite.xml
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/testsuite.xml b/asterix-bad/src/test/resources/runtimets/testsuite.xml
index 7fa6b5c..12d7d55 100644
--- a/asterix-bad/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-bad/src/test/resources/runtimets/testsuite.xml
@@ -19,7 +19,7 @@
 <test-suite  xmlns="urn:xml.testframework.asterix.apache.org"
              ResultOffsetPath="results"
              QueryOffsetPath="queries"
-             QueryFileExtension=".aql">
+             QueryFileExtension=".sqlpp">
   <test-group name="channel">
     <test-case FilePath="channel">
         <compilation-unit name="room_occupants">


[3/3] asterixdb-bad git commit: Move BAD from AQL to SQL++

Posted by sj...@apache.org.
Move BAD from AQL to SQL++

Change-Id: I563bf7b91b280eb65fbbbca0e95e8968f05ea591


Project: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/commit/55514040
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/tree/55514040
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/diff/55514040

Branch: refs/heads/master
Commit: 55514040b1b9cf7488f0138577eb2d35b0dc456d
Parents: 3b20a63
Author: Steven Glenn Jacobs <sj...@ucr.edu>
Authored: Wed Apr 19 15:54:13 2017 -0700
Committer: Steven Glenn Jacobs <sj...@ucr.edu>
Committed: Wed Apr 19 15:54:13 2017 -0700

----------------------------------------------------------------------
 asterix-bad/pom.xml                             |  6 +-
 .../bad/lang/BADCompilationProvider.java        | 12 ++--
 .../asterix/bad/lang/BADLangExtension.java      |  5 +-
 .../asterix/bad/lang/BADParserFactory.java      |  4 +-
 .../asterix/bad/lang/BADStatementExecutor.java  |  4 +-
 .../statement/ChannelSubscribeStatement.java    | 18 ++---
 .../statement/ChannelUnsubscribeStatement.java  |  4 +-
 .../lang/statement/CreateChannelStatement.java  | 46 ++++++------
 .../statement/CreateProcedureStatement.java     | 10 +--
 .../apache/asterix/bad/metadata/Procedure.java  |  1 -
 .../src/main/resources/lang-extension/lang.txt  |  2 +
 .../queries/channel/channel-create.aql          | 54 --------------
 .../queries/channel/channel-create.sqlpp        | 52 ++++++++++++++
 .../queries/channel/channel-subscribe.aql       | 58 ---------------
 .../queries/channel/channel-subscribe.sqlpp     | 56 +++++++++++++++
 .../queries/channel/channel-unsubscribe.aql     | 56 ---------------
 .../queries/channel/channel-unsubscribe.sqlpp   | 54 ++++++++++++++
 .../results/channel/channel-create.plan         | 20 +++---
 .../results/channel/channel-subscribe.plan      | 20 +++---
 .../results/channel/channel-unsubscribe.plan    | 18 ++---
 .../create_channel_check_datasets.1.ddl.aql     | 52 --------------
 .../create_channel_check_datasets.1.ddl.sqlpp   | 51 ++++++++++++++
 .../create_channel_check_datasets.3.query.aql   | 26 -------
 .../create_channel_check_datasets.3.query.sqlpp | 26 +++++++
 .../create_channel_check_metadata.1.ddl.aql     | 52 --------------
 .../create_channel_check_metadata.1.ddl.sqlpp   | 51 ++++++++++++++
 .../create_channel_check_metadata.3.query.aql   | 23 ------
 .../create_channel_check_metadata.3.query.sqlpp | 23 ++++++
 .../drop_channel_check_datasets.1.ddl.aql       | 56 ---------------
 .../drop_channel_check_datasets.1.ddl.sqlpp     | 55 +++++++++++++++
 .../drop_channel_check_datasets.2.ddl.aql       | 21 ------
 .../drop_channel_check_datasets.2.ddl.sqlpp     | 21 ++++++
 .../drop_channel_check_datasets.3.query.aql     | 26 -------
 .../drop_channel_check_datasets.3.query.sqlpp   | 25 +++++++
 .../drop_channel_check_metadata.1.ddl.aql       | 56 ---------------
 .../drop_channel_check_metadata.1.ddl.sqlpp     | 55 +++++++++++++++
 .../drop_channel_check_metadata.2.ddl.aql       | 21 ------
 .../drop_channel_check_metadata.2.ddl.sqlpp     | 21 ++++++
 .../drop_channel_check_metadata.3.query.aql     | 23 ------
 .../drop_channel_check_metadata.3.query.sqlpp   | 23 ++++++
 .../room_occupants/room_occupants.1.ddl.aql     | 74 --------------------
 .../room_occupants/room_occupants.1.ddl.sqlpp   | 74 ++++++++++++++++++++
 .../room_occupants/room_occupants.2.update.aql  | 30 --------
 .../room_occupants.2.update.sqlpp               | 29 ++++++++
 .../room_occupants/room_occupants.3.query.aql   | 33 ---------
 .../room_occupants.3.update.sqlpp               | 29 ++++++++
 .../room_occupants/room_occupants.4.query.sqlpp | 30 ++++++++
 .../room_occupants/room_occupants.4.update.aql  | 34 ---------
 .../room_occupants/room_occupants.5.sleep.aql   | 25 -------
 .../room_occupants.5.update.sqlpp               | 34 +++++++++
 .../room_occupants/room_occupants.6.sleep.sqlpp | 25 +++++++
 .../room_occupants/room_occupants.6.update.aql  | 32 ---------
 .../room_occupants/room_occupants.7.query.aql   | 30 --------
 .../room_occupants.7.update.sqlpp               | 32 +++++++++
 .../room_occupants/room_occupants.8.query.sqlpp | 30 ++++++++
 ...scribe_channel_check_subscriptions.1.ddl.aql | 54 --------------
 ...ribe_channel_check_subscriptions.1.ddl.sqlpp | 53 ++++++++++++++
 ...ibe_channel_check_subscriptions.2.update.aql | 21 ------
 ...e_channel_check_subscriptions.2.update.sqlpp | 21 ++++++
 ...ibe_channel_check_subscriptions.3.update.aql | 21 ------
 ...e_channel_check_subscriptions.3.update.sqlpp | 21 ++++++
 ...ibe_channel_check_subscriptions.4.update.aql | 21 ------
 ...e_channel_check_subscriptions.4.update.sqlpp | 21 ++++++
 ...ribe_channel_check_subscriptions.5.query.aql | 23 ------
 ...be_channel_check_subscriptions.5.query.sqlpp | 23 ++++++
 .../ten_minute_channel.1.ddl.aql                | 46 ------------
 .../ten_minute_channel.1.ddl.sqlpp              | 46 ++++++++++++
 .../ten_minute_channel.2.update.aql             | 29 --------
 .../ten_minute_channel.2.update.sqlpp           | 29 ++++++++
 .../ten_minute_channel.3.update.aql             | 34 ---------
 .../ten_minute_channel.3.update.sqlpp           | 34 +++++++++
 .../ten_minute_channel.4.sleep.aql              | 25 -------
 .../ten_minute_channel.4.sleep.sqlpp            | 25 +++++++
 .../ten_minute_channel.5.query.aql              | 30 --------
 .../ten_minute_channel.5.query.sqlpp            | 30 ++++++++
 .../delete_procedure/delete_procedure.1.ddl.aql | 45 ------------
 .../delete_procedure.1.ddl.sqlpp                | 45 ++++++++++++
 .../delete_procedure.2.query.aql                | 28 --------
 .../delete_procedure.2.query.sqlpp              | 27 +++++++
 .../delete_procedure.3.update.aql               | 27 -------
 .../delete_procedure.3.update.sqlpp             | 27 +++++++
 .../delete_procedure.4.query.aql                | 28 --------
 .../delete_procedure.4.query.sqlpp              | 27 +++++++
 .../insert_procedure/insert_procedure.1.ddl.aql | 43 ------------
 .../insert_procedure.1.ddl.sqlpp                | 43 ++++++++++++
 .../insert_procedure.2.update.aql               | 27 -------
 .../insert_procedure.2.update.sqlpp             | 27 +++++++
 .../insert_procedure.3.update.aql               | 27 -------
 .../insert_procedure.3.update.sqlpp             | 27 +++++++
 .../insert_procedure.4.update.aql               | 27 -------
 .../insert_procedure.4.update.sqlpp             | 27 +++++++
 .../insert_procedure/insert_procedure.5.ddl.aql | 27 -------
 .../insert_procedure.5.ddl.sqlpp                | 27 +++++++
 .../insert_procedure.6.query.aql                | 28 --------
 .../insert_procedure.6.query.sqlpp              | 27 +++++++
 .../query_procedure/query_procedure.1.ddl.aql   | 43 ------------
 .../query_procedure/query_procedure.1.ddl.sqlpp | 42 +++++++++++
 .../query_procedure.2.update.aql                | 30 --------
 .../query_procedure.2.update.sqlpp              | 30 ++++++++
 .../query_procedure.3.update.aql                | 27 -------
 .../query_procedure.3.update.sqlpp              | 27 +++++++
 .../query_procedure.4.update.aql                | 29 --------
 .../query_procedure.4.update.sqlpp              | 29 ++++++++
 .../query_procedure.5.update.aql                | 27 -------
 .../query_procedure.5.update.sqlpp              | 27 +++++++
 .../repetitive_insert_procedure.1.ddl.aql       | 43 ------------
 .../repetitive_insert_procedure.1.ddl.sqlpp     | 43 ++++++++++++
 .../repetitive_insert_procedure.2.update.aql    | 27 -------
 .../repetitive_insert_procedure.2.update.sqlpp  | 27 +++++++
 .../repetitive_insert_procedure.3.sleep.aql     | 26 -------
 .../repetitive_insert_procedure.3.sleep.sqlpp   | 26 +++++++
 .../repetitive_insert_procedure.4.ddl.aql       | 27 -------
 .../repetitive_insert_procedure.4.ddl.sqlpp     | 27 +++++++
 .../repetitive_insert_procedure.5.query.aql     | 28 --------
 .../repetitive_insert_procedure.5.query.sqlpp   | 27 +++++++
 .../channel/room_occupants/room_occupants.1.adm |  2 +
 .../channel/room_occupants/room_occupants.2.adm |  2 +
 .../channel/room_occupants/room_occupants.3.adm |  2 -
 .../channel/room_occupants/room_occupants.7.adm |  2 -
 .../src/test/resources/runtimets/testsuite.xml  |  2 +-
 120 files changed, 1793 insertions(+), 1795 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/pom.xml
----------------------------------------------------------------------
diff --git a/asterix-bad/pom.xml b/asterix-bad/pom.xml
index c2ff29f..4a2d80d 100644
--- a/asterix-bad/pom.xml
+++ b/asterix-bad/pom.xml
@@ -36,10 +36,10 @@
         <version>${asterix.version}</version>
         <configuration>
           <base>${project.basedir}</base>
-          <gbase>../../asterix-lang-aql/src/main/javacc/AQL.jj</gbase>
+          <gbase>../../asterix-lang-sqlpp/src/main/javacc/SQLPP.jj</gbase>
           <gextension>src/main/resources/lang-extension/lang.txt</gextension>
           <output>target/generated-resources/javacc/grammar.jj</output>
-          <parserClassName>BADAQLParser</parserClassName>
+          <parserClassName>BADParser</parserClassName>
           <packageName>org.apache.asterix.bad.lang</packageName>
         </configuration>
         <executions>
@@ -240,7 +240,7 @@
     </dependency>
     <dependency>
       <groupId>org.apache.asterix</groupId>
-      <artifactId>asterix-lang-aql</artifactId>
+      <artifactId>asterix-lang-sqlpp</artifactId>
       <version>${asterix.version}</version>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
index 0a6ced2..2a3d4fb 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADCompilationProvider.java
@@ -21,12 +21,12 @@ package org.apache.asterix.bad.lang;
 import org.apache.asterix.algebra.base.ILangExpressionToPlanTranslatorFactory;
 import org.apache.asterix.compiler.provider.ILangCompilationProvider;
 import org.apache.asterix.compiler.provider.IRuleSetFactory;
-import org.apache.asterix.lang.aql.rewrites.AQLRewriterFactory;
-import org.apache.asterix.lang.aql.visitor.AQLAstPrintVisitorFactory;
 import org.apache.asterix.lang.common.base.IAstPrintVisitorFactory;
 import org.apache.asterix.lang.common.base.IParserFactory;
 import org.apache.asterix.lang.common.base.IRewriterFactory;
-import org.apache.asterix.translator.AqlExpressionToPlanTranslatorFactory;
+import org.apache.asterix.lang.sqlpp.rewrites.SqlppRewriterFactory;
+import org.apache.asterix.lang.sqlpp.visitor.SqlppAstPrintVisitorFactory;
+import org.apache.asterix.translator.SqlppExpressionToPlanTranslatorFactory;
 
 public class BADCompilationProvider implements ILangCompilationProvider {
 
@@ -37,17 +37,17 @@ public class BADCompilationProvider implements ILangCompilationProvider {
 
     @Override
     public IRewriterFactory getRewriterFactory() {
-        return new AQLRewriterFactory();
+        return new SqlppRewriterFactory();
     }
 
     @Override
     public IAstPrintVisitorFactory getAstPrintVisitorFactory() {
-        return new AQLAstPrintVisitorFactory();
+        return new SqlppAstPrintVisitorFactory();
     }
 
     @Override
     public ILangExpressionToPlanTranslatorFactory getExpressionToPlanTranslatorFactory() {
-        return new AqlExpressionToPlanTranslatorFactory();
+        return new SqlppExpressionToPlanTranslatorFactory();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
index 1d46bc4..fa0c0da 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
@@ -32,7 +32,6 @@ import org.apache.asterix.bad.metadata.Procedure;
 import org.apache.asterix.bad.metadata.ProcedureSearchKey;
 import org.apache.asterix.common.api.ExtensionId;
 import org.apache.asterix.compiler.provider.ILangCompilationProvider;
-import org.apache.asterix.compiler.provider.SqlppCompilationProvider;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.metadata.MetadataTransactionContext;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -54,10 +53,8 @@ public class BADLangExtension implements ILangExtension {
     @Override
     public ILangCompilationProvider getLangCompilationProvider(Language lang) {
         switch (lang) {
-            case AQL:
-                return new BADCompilationProvider();
             case SQLPP:
-                return new SqlppCompilationProvider();
+                return new BADCompilationProvider();
             default:
                 return null;
         }

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
index 58bca17..5e87f49 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADParserFactory.java
@@ -27,12 +27,12 @@ public class BADParserFactory implements IParserFactory {
 
     @Override
     public IParser createParser(String query) {
-        return new BADAQLParser(query);
+        return new BADParser(query);
     }
 
     @Override
     public IParser createParser(Reader reader) {
-        return new BADAQLParser(reader);
+        return new BADParser(reader);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
index 5cc6444..f62a7e0 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
@@ -42,10 +42,10 @@ import org.apache.hyracks.api.client.IHyracksClientConnection;
 
 public class BADStatementExecutor extends QueryTranslator {
 
-    public BADStatementExecutor(List<Statement> aqlStatements, SessionConfig conf,
+    public BADStatementExecutor(List<Statement> statements, SessionConfig conf,
             ILangCompilationProvider compliationProvider, IStorageComponentProvider storageComponentProvider,
             ExecutorService executorService) {
-        super(aqlStatements, conf, compliationProvider, storageComponentProvider, executorService);
+        super(statements, conf, compliationProvider, storageComponentProvider, executorService);
     }
 
 

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
index 5c5cdf1..305ca20 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
@@ -30,10 +30,7 @@ import org.apache.asterix.bad.metadata.Channel;
 import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
-import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
-import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.base.Expression;
-import org.apache.asterix.lang.common.clause.LetClause;
 import org.apache.asterix.lang.common.expression.CallExpr;
 import org.apache.asterix.lang.common.expression.FieldAccessor;
 import org.apache.asterix.lang.common.expression.FieldBinding;
@@ -195,19 +192,12 @@ public class ChannelSubscribeStatement implements IExtensionStatement {
 
             if (subscriptionId == null) {
                 //To create a new subscription
-                VariableExpr subscriptionVar = new VariableExpr(new VarIdentifier("$sub", 1));
-                VariableExpr useSubscriptionVar = new VariableExpr(new VarIdentifier("$sub", 1));
                 VariableExpr resultVar = new VariableExpr(new VarIdentifier("$result", 0));
                 VariableExpr useResultVar = new VariableExpr(new VarIdentifier("$result", 0));
                 useResultVar.setIsNewVar(false);
-                useSubscriptionVar.setIsNewVar(false);
-                List<Clause> clauseList = new ArrayList<>();
-                LetClause let = new LetClause(subscriptionVar,
-                        new FieldAccessor(useResultVar, new Identifier(BADConstants.SubscriptionId)));
-                clauseList.add(let);
-                FLWOGRExpression body = new FLWOGRExpression(clauseList, useSubscriptionVar);
-
-                metadataProvider.setResultSetId(new ResultSetId(resultSetIdCounter++));
+                FieldAccessor accessor = new FieldAccessor(useResultVar, new Identifier(BADConstants.SubscriptionId));
+
+                metadataProvider.setResultSetId(new ResultSetId(resultSetIdCounter));
                 boolean resultsAsync =
                         resultDelivery == ResultDelivery.ASYNC || resultDelivery == ResultDelivery.DEFERRED;
                 metadataProvider.setResultAsyncMode(resultsAsync);
@@ -219,7 +209,7 @@ public class ChannelSubscribeStatement implements IExtensionStatement {
                 tempMdProvider.setOutputFile(metadataProvider.getOutputFile());
 
                 InsertStatement insert = new InsertStatement(new Identifier(dataverse),
-                        new Identifier(subscriptionsDatasetName), subscriptionTuple, varCounter, resultVar, body);
+                        new Identifier(subscriptionsDatasetName), subscriptionTuple, varCounter, resultVar, accessor);
                 ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(tempMdProvider, insert, hcc, hdc,
                         resultDelivery, stats, false, null, null);
             } else {

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
index 538a5ea..0cc96ad 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
@@ -29,7 +29,6 @@ import org.apache.asterix.bad.metadata.Channel;
 import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
-import org.apache.asterix.lang.aql.visitor.AqlDeleteRewriteVisitor;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.expression.CallExpr;
 import org.apache.asterix.lang.common.expression.FieldAccessor;
@@ -40,6 +39,7 @@ import org.apache.asterix.lang.common.literal.StringLiteral;
 import org.apache.asterix.lang.common.statement.DeleteStatement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
+import org.apache.asterix.lang.sqlpp.visitor.SqlppDeleteRewriteVisitor;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.metadata.MetadataTransactionContext;
 import org.apache.asterix.metadata.declared.MetadataProvider;
@@ -141,7 +141,7 @@ public class ChannelUnsubscribeStatement implements IExtensionStatement {
 
             DeleteStatement delete = new DeleteStatement(vars, new Identifier(dataverse),
                     new Identifier(subscriptionsDatasetName), condition, varCounter);
-            AqlDeleteRewriteVisitor visitor = new AqlDeleteRewriteVisitor();
+            SqlppDeleteRewriteVisitor visitor = new SqlppDeleteRewriteVisitor();
             delete.accept(visitor, null);
             MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getDefaultDataverse(),
                     metadataProvider.getStorageComponentProvider());

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
index f138d4f..19ea29d 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
@@ -36,6 +36,7 @@ import org.apache.asterix.app.translator.QueryTranslator;
 import org.apache.asterix.bad.BADConstants;
 import org.apache.asterix.bad.ChannelJobService;
 import org.apache.asterix.bad.lang.BADLangExtension;
+import org.apache.asterix.bad.lang.BADParserFactory;
 import org.apache.asterix.bad.metadata.Channel;
 import org.apache.asterix.bad.metadata.PrecompiledJobEventListener;
 import org.apache.asterix.bad.metadata.PrecompiledJobEventListener.PrecompiledType;
@@ -44,7 +45,6 @@ import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
 import org.apache.asterix.common.metadata.IDataset;
-import org.apache.asterix.lang.aql.parser.AQLParserFactory;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.expression.CallExpr;
@@ -54,6 +54,7 @@ import org.apache.asterix.lang.common.statement.DatasetDecl;
 import org.apache.asterix.lang.common.statement.IDatasetDetailsDecl;
 import org.apache.asterix.lang.common.statement.InsertStatement;
 import org.apache.asterix.lang.common.statement.InternalDetailsDecl;
+import org.apache.asterix.lang.common.statement.SetStatement;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.asterix.metadata.MetadataException;
@@ -206,32 +207,33 @@ public class CreateChannelStatement implements IExtensionStatement {
             Identifier resultsName, MetadataProvider metadataProvider, IHyracksClientConnection hcc,
             IHyracksDataset hdc, Stats stats, String dataverse) throws Exception {
         StringBuilder builder = new StringBuilder();
-        builder.append("insert into dataset " + dataverse + "." + resultsName + " ");
-        builder.append(" as $a (" + " let $" + BADConstants.ChannelExecutionTime + " := current-datetime() \n");
-
-        builder.append("for $sub in dataset " + dataverse + "." + subscriptionsName + "\n");
-        builder.append(
-                "for $broker in dataset " + BADConstants.BAD_DATAVERSE_NAME + "." + BADConstants.BROKER_KEYWORD + "\n");
-        builder.append("where $broker." + BADConstants.BrokerName + "= $sub." + BADConstants.BrokerName + "\n");
-        builder.append("and $broker." + BADConstants.DataverseName + "= $sub." + BADConstants.DataverseName + "\n");
-        builder.append(" for $result in " + function.getNamespace() + "." + function.getName() + "(");
+        builder.append("SET inline_with \"false\"\n");
+        builder.append("insert into " + dataverse + "." + resultsName);
+        builder.append(" as a (\n" + "with " + BADConstants.ChannelExecutionTime + " as current_datetime() \n");
+        builder.append("select result, ");
+        builder.append(BADConstants.ChannelExecutionTime + ", ");
+        builder.append("sub." + BADConstants.SubscriptionId + " as " + BADConstants.SubscriptionId + ",");
+        builder.append("current_datetime() as " + BADConstants.DeliveryTime + "\n");
+        builder.append("from " + dataverse + "." + subscriptionsName + " sub,\n");
+        builder.append(BADConstants.BAD_DATAVERSE_NAME + "." + BADConstants.BROKER_KEYWORD + " b, \n");
+        builder.append(function.getNamespace() + "." + function.getName() + "(");
         int i = 0;
         for (; i < function.getArity() - 1; i++) {
-            builder.append("$sub.param" + i + ",");
+            builder.append("sub.param" + i + ",");
         }
-        builder.append("$sub.param" + i + ")\n");
-        builder.append("return {\n");
-        builder.append("\"" + BADConstants.ChannelExecutionTime + "\":$" + BADConstants.ChannelExecutionTime + ",");
-        builder.append("\"" + BADConstants.SubscriptionId + "\":$sub." + BADConstants.SubscriptionId + ",");
-        builder.append("\"" + BADConstants.DeliveryTime + "\":current-datetime(),");
-        builder.append("\"result\":$result");
-        builder.append("}");
+        builder.append("sub.param" + i + ") result \n");
+        builder.append("where b." + BADConstants.BrokerName + " = sub." + BADConstants.BrokerName + "\n");
+        builder.append("and b." + BADConstants.DataverseName + " = sub." + BADConstants.DataverseName + "\n");
         builder.append(")");
-        builder.append(" returning $a");
+        builder.append(" returning a");
         builder.append(";");
-        AQLParserFactory aqlFact = new AQLParserFactory();
-        List<Statement> fStatements = aqlFact.createParser(new StringReader(builder.toString())).parse();
-        return ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider, fStatements.get(0),
+        BADParserFactory factory = new BADParserFactory();
+        List<Statement> fStatements = factory.createParser(new StringReader(builder.toString())).parse();
+
+        SetStatement ss = (SetStatement) fStatements.get(0);
+        metadataProvider.getConfig().put(ss.getPropName(), ss.getPropValue());
+
+        return ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider, fStatements.get(1),
                 hcc, hdc, ResultDelivery.ASYNC, stats, true, null, null);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
index ae6886a..d378890 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
@@ -33,14 +33,13 @@ import org.apache.asterix.app.result.ResultReader;
 import org.apache.asterix.app.translator.QueryTranslator;
 import org.apache.asterix.bad.BADConstants;
 import org.apache.asterix.bad.lang.BADLangExtension;
+import org.apache.asterix.bad.lang.BADParserFactory;
 import org.apache.asterix.bad.metadata.PrecompiledJobEventListener;
 import org.apache.asterix.bad.metadata.PrecompiledJobEventListener.PrecompiledType;
 import org.apache.asterix.bad.metadata.Procedure;
 import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
-import org.apache.asterix.lang.aql.parser.AQLParserFactory;
-import org.apache.asterix.lang.aql.visitor.AqlDeleteRewriteVisitor;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.expression.CallExpr;
@@ -50,6 +49,7 @@ import org.apache.asterix.lang.common.statement.Query;
 import org.apache.asterix.lang.common.struct.Identifier;
 import org.apache.asterix.lang.common.struct.VarIdentifier;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
+import org.apache.asterix.lang.sqlpp.visitor.SqlppDeleteRewriteVisitor;
 import org.apache.asterix.metadata.MetadataException;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.metadata.MetadataTransactionContext;
@@ -162,8 +162,8 @@ public class CreateProcedureStatement implements IExtensionStatement {
         StringBuilder builder = new StringBuilder();
         builder.append(body);
         builder.append(";");
-        AQLParserFactory aqlFact = new AQLParserFactory();
-        List<Statement> fStatements = aqlFact.createParser(new StringReader(builder.toString())).parse();
+        BADParserFactory factory = new BADParserFactory();
+        List<Statement> fStatements = factory.createParser(new StringReader(builder.toString())).parse();
         if (fStatements.size() > 1) {
             throw new CompilationException("Procedure can only execute a single statement");
         }
@@ -178,7 +178,7 @@ public class CreateProcedureStatement implements IExtensionStatement {
             metadataProvider.getLocks().unlock();
             return pair;
         } else if (fStatements.get(0).getKind() == Statement.Kind.DELETE) {
-            AqlDeleteRewriteVisitor visitor = new AqlDeleteRewriteVisitor();
+            SqlppDeleteRewriteVisitor visitor = new SqlppDeleteRewriteVisitor();
             fStatements.get(0).accept(visitor, null);
             return new Pair<>(((QueryTranslator) statementExecutor).handleDeleteStatement(metadataProvider,
                     fStatements.get(0), hcc, true), PrecompiledType.DELETE);

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/Procedure.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/Procedure.java b/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/Procedure.java
index a77a14d..e3ed7fc 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/Procedure.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/Procedure.java
@@ -27,7 +27,6 @@ import org.apache.asterix.metadata.api.IExtensionMetadataEntity;
 
 public class Procedure implements IExtensionMetadataEntity {
     private static final long serialVersionUID = 1L;
-    public static final String LANGUAGE_AQL = "AQL";
     public static final String LANGUAGE_JAVA = "JAVA";
 
     public static final String RETURNTYPE_VOID = "VOID";

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/main/resources/lang-extension/lang.txt
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/resources/lang-extension/lang.txt b/asterix-bad/src/main/resources/lang-extension/lang.txt
index adce6ed..6a06ea6 100644
--- a/asterix-bad/src/main/resources/lang-extension/lang.txt
+++ b/asterix-bad/src/main/resources/lang-extension/lang.txt
@@ -26,6 +26,8 @@ import org.apache.asterix.bad.lang.statement.CreateChannelStatement;
 import org.apache.asterix.bad.lang.statement.CreateProcedureStatement;
 import org.apache.asterix.bad.lang.statement.ExecuteProcedureStatement;
 import org.apache.asterix.bad.lang.statement.ProcedureDropStatement;
+import org.apache.asterix.lang.sqlpp.parser.ParseException;
+import org.apache.asterix.lang.sqlpp.parser.Token;
 
 
 @merge

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.aql b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.aql
deleted file mode 100644
index a5d4167..0000000
--- a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.aql
+++ /dev/null
@@ -1,54 +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  : Check the Plan used by a channel
- * Expected Res : Success
- * Date         : Mar 2015
- */
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text 
-};
-
-write output to nc1:"rttest/channel-create.adm";
-
-create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.sqlpp b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.sqlpp
new file mode 100644
index 0000000..24d73e2
--- /dev/null
+++ b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-create.sqlpp
@@ -0,0 +1,52 @@
+/*
+ * 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  : Check the Plan used by a channel
+ * Expected Res : Success
+ * Date         : Mar 2015
+ */
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+write output to nc1:"rttest/channel-create.sqlpp";
+
+create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.aql b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.aql
deleted file mode 100644
index cbccbde..0000000
--- a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.aql
+++ /dev/null
@@ -1,58 +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  : Check the Plan for Subscribing to a channel
- * Expected Res : Success
- * Date         : Mar 2015
- */
-
-drop dataverse channels2 if exists;
-create dataverse channels2;
-use dataverse channels2;
-
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text 
-};
-
-create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
-
-write output to nc1:"rttest/channel-subscribe.adm";
-
-create broker brokerA at "http://www.hello.com";
-
-subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.sqlpp b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.sqlpp
new file mode 100644
index 0000000..4a5cbbc
--- /dev/null
+++ b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-subscribe.sqlpp
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : Check the Plan for Subscribing to a channel
+ * Expected Res : Success
+ * Date         : Mar 2015
+ */
+
+drop dataverse channels2 if exists;
+create dataverse channels2;
+use channels2;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
+
+write output to nc1:"rttest/channel-subscribe.sqlpp";
+
+create broker brokerA at "http://www.hello.com";
+
+subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.aql b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.aql
deleted file mode 100644
index 039b554..0000000
--- a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.aql
+++ /dev/null
@@ -1,56 +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  : Check the Plan for Unsubscribing to a channel
- * Expected Res : Success
- * Date         : Mar 2015
- */
-
-drop dataverse channels3 if exists;
-create dataverse channels3;
-use dataverse channels3;
-
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text 
-};
-
-create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
-
-write output to nc1:"rttest/channel-unsubscribe.adm";
-
-unsubscribe "c45ef6d0-c5ae-4b9e-b5da-cf1932718296" from nearbyTweetChannel;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.sqlpp b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.sqlpp
new file mode 100644
index 0000000..508eaa2
--- /dev/null
+++ b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-unsubscribe.sqlpp
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : Check the Plan for Unsubscribing to a channel
+ * Expected Res : Success
+ * Date         : Mar 2015
+ */
+
+drop dataverse channels3 if exists;
+create dataverse channels3;
+use channels3;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
+
+write output to nc1:"rttest/channel-unsubscribe.sqlpp";
+
+unsubscribe "c45ef6d0-c5ae-4b9e-b5da-cf1932718296" from nearbyTweetChannel;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
index b642fed..4c0ff87 100644
--- a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
+++ b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
@@ -1,23 +1,23 @@
 -- NOTIFY_BROKERS  |PARTITIONED|
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    -- PRE_CLUSTERED_GROUP_BY[$$53, $$1]  |PARTITIONED|
+    -- PRE_CLUSTERED_GROUP_BY[$$52, $$0]  |PARTITIONED|
             {
               -- AGGREGATE  |LOCAL|
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
             }
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-        -- STABLE_SORT [$$53(ASC), $$1(ASC)]  |PARTITIONED|
-          -- HASH_PARTITION_EXCHANGE [$$53, $$1]  |PARTITIONED|
+        -- STABLE_SORT [$$52(ASC), $$0(ASC)]  |PARTITIONED|
+          -- HASH_PARTITION_EXCHANGE [$$52, $$0]  |PARTITIONED|
             -- PRE_SORTED_DISTINCT_BY  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- STABLE_SORT [$$40(ASC)]  |PARTITIONED|
-                  -- HASH_PARTITION_EXCHANGE [$$40]  |PARTITIONED|
+                -- STABLE_SORT [$$37(ASC)]  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$37]  |PARTITIONED|
                     -- STREAM_PROJECT  |PARTITIONED|
                       -- COMMIT  |PARTITIONED|
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- INSERT_DELETE  |PARTITIONED|
-                              -- HASH_PARTITION_EXCHANGE [$$35]  |PARTITIONED|
+                              -- HASH_PARTITION_EXCHANGE [$$32]  |PARTITIONED|
                                 -- ASSIGN  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- ASSIGN  |PARTITIONED|
@@ -31,8 +31,8 @@
                                                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                       -- STREAM_PROJECT  |PARTITIONED|
                                                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                          -- HYBRID_HASH_JOIN [$$45, $$47][$$41, $$42]  |PARTITIONED|
-                                                            -- HASH_PARTITION_EXCHANGE [$$45, $$47]  |PARTITIONED|
+                                                          -- HYBRID_HASH_JOIN [$$44, $$42][$$38, $$39]  |PARTITIONED|
+                                                            -- HASH_PARTITION_EXCHANGE [$$44, $$42]  |PARTITIONED|
                                                               -- STREAM_PROJECT  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
@@ -40,7 +40,7 @@
                                                                       -- BROADCAST_EXCHANGE  |PARTITIONED|
                                                                         -- ASSIGN  |UNPARTITIONED|
                                                                           -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
-                                                            -- HASH_PARTITION_EXCHANGE [$$41, $$42]  |PARTITIONED|
+                                                            -- HASH_PARTITION_EXCHANGE [$$38, $$39]  |PARTITIONED|
                                                               -- STREAM_PROJECT  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
@@ -54,4 +54,4 @@
                                                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                               -- DATASOURCE_SCAN  |PARTITIONED|
                                                                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                                  -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                  -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
index 68d1c86..42544d9 100644
--- a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
+++ b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
@@ -1,23 +1,23 @@
 -- NOTIFY_BROKERS  |PARTITIONED|
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    -- PRE_CLUSTERED_GROUP_BY[$$53, $$1]  |PARTITIONED|
+    -- PRE_CLUSTERED_GROUP_BY[$$52, $$0]  |PARTITIONED|
             {
               -- AGGREGATE  |LOCAL|
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
             }
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-        -- STABLE_SORT [$$53(ASC), $$1(ASC)]  |PARTITIONED|
-          -- HASH_PARTITION_EXCHANGE [$$53, $$1]  |PARTITIONED|
+        -- STABLE_SORT [$$52(ASC), $$0(ASC)]  |PARTITIONED|
+          -- HASH_PARTITION_EXCHANGE [$$52, $$0]  |PARTITIONED|
             -- PRE_SORTED_DISTINCT_BY  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- STABLE_SORT [$$40(ASC)]  |PARTITIONED|
-                  -- HASH_PARTITION_EXCHANGE [$$40]  |PARTITIONED|
+                -- STABLE_SORT [$$37(ASC)]  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$37]  |PARTITIONED|
                     -- STREAM_PROJECT  |PARTITIONED|
                       -- COMMIT  |PARTITIONED|
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- INSERT_DELETE  |PARTITIONED|
-                              -- HASH_PARTITION_EXCHANGE [$$35]  |PARTITIONED|
+                              -- HASH_PARTITION_EXCHANGE [$$32]  |PARTITIONED|
                                 -- ASSIGN  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- ASSIGN  |PARTITIONED|
@@ -31,8 +31,8 @@
                                                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                       -- STREAM_PROJECT  |PARTITIONED|
                                                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                          -- HYBRID_HASH_JOIN [$$45, $$47][$$41, $$42]  |PARTITIONED|
-                                                            -- HASH_PARTITION_EXCHANGE [$$45, $$47]  |PARTITIONED|
+                                                          -- HYBRID_HASH_JOIN [$$44, $$42][$$38, $$39]  |PARTITIONED|
+                                                            -- HASH_PARTITION_EXCHANGE [$$44, $$42]  |PARTITIONED|
                                                               -- STREAM_PROJECT  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
@@ -40,7 +40,7 @@
                                                                       -- BROADCAST_EXCHANGE  |PARTITIONED|
                                                                         -- ASSIGN  |UNPARTITIONED|
                                                                           -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
-                                                            -- HASH_PARTITION_EXCHANGE [$$41, $$42]  |PARTITIONED|
+                                                            -- HASH_PARTITION_EXCHANGE [$$38, $$39]  |PARTITIONED|
                                                               -- STREAM_PROJECT  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
@@ -62,7 +62,7 @@
         -- STREAM_PROJECT  |PARTITIONED|
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
             -- INSERT_DELETE  |PARTITIONED|
-              -- HASH_PARTITION_EXCHANGE [$$8]  |PARTITIONED|
+              -- HASH_PARTITION_EXCHANGE [$$4]  |PARTITIONED|
                 -- ASSIGN  |UNPARTITIONED|
                   -- STREAM_PROJECT  |UNPARTITIONED|
                     -- ASSIGN  |UNPARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
index 79aaa8c..843205a 100644
--- a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
+++ b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
@@ -1,23 +1,23 @@
 -- NOTIFY_BROKERS  |PARTITIONED|
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-    -- PRE_CLUSTERED_GROUP_BY[$$53, $$1]  |PARTITIONED|
+    -- PRE_CLUSTERED_GROUP_BY[$$52, $$0]  |PARTITIONED|
             {
               -- AGGREGATE  |LOCAL|
                 -- NESTED_TUPLE_SOURCE  |LOCAL|
             }
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-        -- STABLE_SORT [$$53(ASC), $$1(ASC)]  |PARTITIONED|
-          -- HASH_PARTITION_EXCHANGE [$$53, $$1]  |PARTITIONED|
+        -- STABLE_SORT [$$52(ASC), $$0(ASC)]  |PARTITIONED|
+          -- HASH_PARTITION_EXCHANGE [$$52, $$0]  |PARTITIONED|
             -- PRE_SORTED_DISTINCT_BY  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                -- STABLE_SORT [$$40(ASC)]  |PARTITIONED|
-                  -- HASH_PARTITION_EXCHANGE [$$40]  |PARTITIONED|
+                -- STABLE_SORT [$$37(ASC)]  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$37]  |PARTITIONED|
                     -- STREAM_PROJECT  |PARTITIONED|
                       -- COMMIT  |PARTITIONED|
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- INSERT_DELETE  |PARTITIONED|
-                              -- HASH_PARTITION_EXCHANGE [$$35]  |PARTITIONED|
+                              -- HASH_PARTITION_EXCHANGE [$$32]  |PARTITIONED|
                                 -- ASSIGN  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- ASSIGN  |PARTITIONED|
@@ -31,8 +31,8 @@
                                                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                       -- STREAM_PROJECT  |PARTITIONED|
                                                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                          -- HYBRID_HASH_JOIN [$$45, $$47][$$41, $$42]  |PARTITIONED|
-                                                            -- HASH_PARTITION_EXCHANGE [$$45, $$47]  |PARTITIONED|
+                                                          -- HYBRID_HASH_JOIN [$$44, $$42][$$38, $$39]  |PARTITIONED|
+                                                            -- HASH_PARTITION_EXCHANGE [$$44, $$42]  |PARTITIONED|
                                                               -- STREAM_PROJECT  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
@@ -40,7 +40,7 @@
                                                                       -- BROADCAST_EXCHANGE  |PARTITIONED|
                                                                         -- ASSIGN  |UNPARTITIONED|
                                                                           -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
-                                                            -- HASH_PARTITION_EXCHANGE [$$41, $$42]  |PARTITIONED|
+                                                            -- HASH_PARTITION_EXCHANGE [$$38, $$39]  |PARTITIONED|
                                                               -- STREAM_PROJECT  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.aql
deleted file mode 100644
index 97add37..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.aql
+++ /dev/null
@@ -1,52 +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 Channel Test. Confirms that the subscription and result datasets are created
-* Expected Res : Success
-* Date         : March 2015
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text
-};
-
-create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.sqlpp
new file mode 100644
index 0000000..5e1a742
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.1.ddl.sqlpp
@@ -0,0 +1,51 @@
+/*
+ * 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 Channel Test. Confirms that the subscription and result datasets are created
+* Expected Res : Success
+* Date         : March 2015
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.aql
deleted file mode 100644
index c2c3c34..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.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.
- */
-use dataverse channels;
-
-for $result in dataset Metadata.Channel where $result.ChannelName = "nearbyTweetChannel"
-for $x in dataset Metadata.Dataset
-where $x.DatasetName = $result.SubscriptionsDatasetName
-or $x.DatasetName = $result.ResultsDatasetName
-order by $x.DatasetName
-return $x;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.sqlpp
new file mode 100644
index 0000000..c9ac4c8
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_datasets/create_channel_check_datasets.3.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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 channels;
+
+select value x
+from Metadata.`Channel` result, Metadata.`Dataset` x
+where result.ChannelName = "nearbyTweetChannel"
+and (x.DatasetName = result.SubscriptionsDatasetName
+or x.DatasetName = result.ResultsDatasetName)
+order by x.DatasetName;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.aql
deleted file mode 100644
index e96db01..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.aql
+++ /dev/null
@@ -1,52 +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 Channel Test
-* Expected Res : Success
-* Date         : March 2015
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text
-};
-
-create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.sqlpp
new file mode 100644
index 0000000..69c3e3e
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.1.ddl.sqlpp
@@ -0,0 +1,51 @@
+/*
+ * 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 Channel Test
+* Expected Res : Success
+* Date         : March 2015
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.aql
deleted file mode 100644
index e96ee38..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.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 channels;
-
-for $result in dataset Metadata.Channel
-order by $result.ChannelName
-return $result;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.sqlpp
new file mode 100644
index 0000000..0728be0
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/create_channel_check_metadata/create_channel_check_metadata.3.query.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+select value x
+from Metadata.`Channel` x
+order by x.ChannelName;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.aql
deleted file mode 100644
index 6234721..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.aql
+++ /dev/null
@@ -1,56 +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 Channel Test. Check Metadata
-* Expected Res : Success
-* Date         : March 2015
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text
-};
-
-create repetitive channel nearbyTweetChannel1 using NearbyTweetsContainingText@2 period duration("PT10M");
-
-create repetitive channel nearbyTweetChannel2 using NearbyTweetsContainingText@2 period duration("PT10M");
-
-create repetitive channel nearbyTweetChannel3 using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.sqlpp
new file mode 100644
index 0000000..cd6db81
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.1.ddl.sqlpp
@@ -0,0 +1,55 @@
+/*
+ * 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 Channel Test. Check Metadata
+* Expected Res : Success
+* Date         : March 2015
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create repetitive channel nearbyTweetChannel1 using NearbyTweetsContainingText@2 period duration("PT10M");
+
+create repetitive channel nearbyTweetChannel2 using NearbyTweetsContainingText@2 period duration("PT10M");
+
+create repetitive channel nearbyTweetChannel3 using NearbyTweetsContainingText@2 period duration("PT10M");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.aql
deleted file mode 100644
index 3d3c206..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.aql
+++ /dev/null
@@ -1,21 +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 channels;
-
-drop channel nearbyTweetChannel2;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.sqlpp
new file mode 100644
index 0000000..0eb7fe5
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.2.ddl.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+drop channel nearbyTweetChannel2;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.aql
deleted file mode 100644
index 2944387..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.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.
- */
-use dataverse channels;
-
-for $result in dataset Metadata.Channel
-for $x in dataset Metadata.Dataset
-where $x.DatasetName = $result.SubscriptionsDatasetName
-or $x.DatasetName = $result.ResultsDatasetName
-order by $x.DatasetName
-return $x;
\ No newline at end of file


[2/3] asterixdb-bad git commit: Move BAD from AQL to SQL++

Posted by sj...@apache.org.
http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.sqlpp
new file mode 100644
index 0000000..cde68a7
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_datasets/drop_channel_check_datasets.3.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+select value x
+from Metadata.`Channel` result, Metadata.`Dataset` x
+where x.DatasetName = result.SubscriptionsDatasetName
+or x.DatasetName = result.ResultsDatasetName
+order by x.DatasetName

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.aql
deleted file mode 100644
index 6234721..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.aql
+++ /dev/null
@@ -1,56 +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 Channel Test. Check Metadata
-* Expected Res : Success
-* Date         : March 2015
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text
-};
-
-create repetitive channel nearbyTweetChannel1 using NearbyTweetsContainingText@2 period duration("PT10M");
-
-create repetitive channel nearbyTweetChannel2 using NearbyTweetsContainingText@2 period duration("PT10M");
-
-create repetitive channel nearbyTweetChannel3 using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.sqlpp
new file mode 100644
index 0000000..cd6db81
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.ddl.sqlpp
@@ -0,0 +1,55 @@
+/*
+ * 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 Channel Test. Check Metadata
+* Expected Res : Success
+* Date         : March 2015
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create repetitive channel nearbyTweetChannel1 using NearbyTweetsContainingText@2 period duration("PT10M");
+
+create repetitive channel nearbyTweetChannel2 using NearbyTweetsContainingText@2 period duration("PT10M");
+
+create repetitive channel nearbyTweetChannel3 using NearbyTweetsContainingText@2 period duration("PT10M");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.aql
deleted file mode 100644
index 3d3c206..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.aql
+++ /dev/null
@@ -1,21 +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 channels;
-
-drop channel nearbyTweetChannel2;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.sqlpp
new file mode 100644
index 0000000..0eb7fe5
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.2.ddl.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+drop channel nearbyTweetChannel2;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.aql
deleted file mode 100644
index e96ee38..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.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 channels;
-
-for $result in dataset Metadata.Channel
-order by $result.ChannelName
-return $result;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.sqlpp
new file mode 100644
index 0000000..0728be0
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/drop_channel_check_metadata/drop_channel_check_metadata.3.query.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+select value x
+from Metadata.`Channel` x
+order by x.ChannelName;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.aql
deleted file mode 100644
index 7ed987e..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.aql
+++ /dev/null
@@ -1,74 +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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type userLocation as {
-  userId: int,
-  roomNumber: int
-}
-create type watchedUser as {
-  userId: int,
-  name: string
-}
-create type roomSecurity as {
-  roomNumber: int,
-  securityGuardName: string,
-  securityGuardNumber: string 
-}
-
-create dataset watchedUsers(watchedUser)
-primary key userId;
-
-create dataset roomSecurityAssignments(roomSecurity)
-primary key roomNumber;
-
-upsert into dataset roomSecurityAssignments([
-{"roomNumber":123, "securityGuardName":"Mike", "securityGuardNumber":"555-4815"},
-{"roomNumber":222, "securityGuardName":"Steven", "securityGuardNumber":"555-1623"},
-{"roomNumber":350, "securityGuardName":"Vassilis", "securityGuardNumber":"555-1234"}]
-);
-
-upsert into dataset watchedUsers([
-{"userId":1, "name":"suspectNumber1"}]
-);
-
-
-create dataset UserLocations(userLocation)
-primary key userId;
-
-create function RoomOccupants($room) {
-    for $location in dataset UserLocations 
-    where $location.roomNumber = $room 
-    return $location.userId
-};
-
-create broker brokerA at "http://www.notifyA.com";
-create broker brokerB at "http://www.notifyB.com";
-
-
-create repetitive channel roomRecords using RoomOccupants@1 period duration("PT5S");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.sqlpp
new file mode 100644
index 0000000..9febd43
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.1.ddl.sqlpp
@@ -0,0 +1,74 @@
+/*
+ * 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  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type userLocation as {
+  userId: int,
+  roomNumber: int
+}
+create type watchedUser as {
+  userId: int,
+  name: string
+}
+create type roomSecurity as {
+  roomNumber: int,
+  securityGuardName: string,
+  securityGuardNumber: string
+}
+
+create dataset watchedUsers(watchedUser)
+primary key userId;
+
+create dataset roomSecurityAssignments(roomSecurity)
+primary key roomNumber;
+
+upsert into roomSecurityAssignments([
+{"roomNumber":123, "securityGuardName":"Mike", "securityGuardNumber":"555_4815"},
+{"roomNumber":222, "securityGuardName":"Steven", "securityGuardNumber":"555_1623"},
+{"roomNumber":350, "securityGuardName":"Vassilis", "securityGuardNumber":"555_1234"}]
+);
+
+upsert into watchedUsers([
+{"userId":1, "name":"suspectNumber1"}]
+);
+
+
+create dataset UserLocations(userLocation)
+primary key userId;
+
+create function RoomOccupants(room) {
+  (select location.userId
+  from UserLocations location
+  where location.roomNumber = room)
+};
+
+create broker brokerA at "http://www.notifyA.com";
+create broker brokerB at "http://www.notifyB.com";
+
+
+create repetitive channel roomRecords using RoomOccupants@1 period duration("PT5S");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.aql
deleted file mode 100644
index 59a8678..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-
-use dataverse channels;
-
-subscribe to roomRecords (123) on brokerA;
-subscribe to roomRecords (350) on brokerB;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.sqlpp
new file mode 100644
index 0000000..3e2d5c0
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.2.update.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+
+use channels;
+
+subscribe to roomRecords (123) on brokerA;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.query.aql
deleted file mode 100644
index e564c35..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.query.aql
+++ /dev/null
@@ -1,33 +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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-
-from $test in dataset roomRecordsSubscriptions
-order by $test.BrokerName
-select {
-"broker":$test.BrokerName,
-"parameter":$test.param0
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.update.sqlpp
new file mode 100644
index 0000000..2e00f6a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.3.update.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+
+use channels;
+
+subscribe to roomRecords (350) on brokerB;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.query.sqlpp
new file mode 100644
index 0000000..de8d3e8
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+use channels;
+
+select test.BrokerName, test.param0
+from roomRecordsSubscriptions test
+order by test.BrokerName

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.update.aql
deleted file mode 100644
index 66d6a7d..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.4.update.aql
+++ /dev/null
@@ -1,34 +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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-
-use dataverse channels;
-
-
-upsert into dataset UserLocations([
-{"userId":1, "roomNumber":123},
-{"userId":2, "roomNumber":222},
-{"userId":3, "roomNumber":350}]
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.sleep.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.sleep.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.sleep.aql
deleted file mode 100644
index e90c028..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.sleep.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-5000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.update.sqlpp
new file mode 100644
index 0000000..2499ac7
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.5.update.sqlpp
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+
+use channels;
+
+
+upsert into UserLocations([
+{"userId":1, "roomNumber":123},
+{"userId":2, "roomNumber":222},
+{"userId":3, "roomNumber":350}]
+);

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.sleep.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.sleep.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.sleep.sqlpp
new file mode 100644
index 0000000..b7bb951
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.sleep.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+5000

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.update.aql
deleted file mode 100644
index 7875ec0..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.6.update.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-
-upsert into dataset UserLocations([
-{"userId":1, "roomNumber":222},
-{"userId":2, "roomNumber":222},
-{"userId":3, "roomNumber":222}]
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.query.aql
deleted file mode 100644
index 45ed2d6..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-
-from $result in dataset roomRecordsResults
-order by $result.result
-select $result.result;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.update.sqlpp
new file mode 100644
index 0000000..eb7ee2e
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.7.update.sqlpp
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+use channels;
+
+upsert into UserLocations([
+{"userId":1, "roomNumber":222},
+{"userId":2, "roomNumber":222},
+{"userId":3, "roomNumber":222}]
+);

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.8.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.8.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.8.query.sqlpp
new file mode 100644
index 0000000..1f9851f
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/room_occupants/room_occupants.8.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+use channels;
+
+select result.result.userId
+from roomRecordsResults result
+order by result.result.userId

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.aql
deleted file mode 100644
index 652fb6a..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.aql
+++ /dev/null
@@ -1,54 +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 Channel Test. Confirms that the subscription and result datasets are created
-* Expected Res : Success
-* Date         : March 2015
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type TweetMessageTypeuuid as closed {
-  tweetid: uuid,
-  sender-location: point,
-  send-time: datetime,
-  referred-topics: {{ string }},
-  message-text: string,
-  countA: int32,
-  countB: int32
-}
-
-
-create dataset TweetMessageuuids(TweetMessageTypeuuid)
-primary key tweetid autogenerated;
-
-create function NearbyTweetsContainingText($location, $text) {
-  for $tweet in dataset TweetMessageuuids
-  let $circle := create-circle($location,30.0)
-  where contains($tweet.message-text,$text)
-  and spatial-intersect($tweet.sender-location, $location)
-  return $tweet.message-text
-};
-
-create broker brokerA at "http://www.notifyA.com";
-
-create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.sqlpp
new file mode 100644
index 0000000..52942ba
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.1.ddl.sqlpp
@@ -0,0 +1,53 @@
+/*
+ * 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 Channel Test. Confirms that the subscription and result datasets are created
+* Expected Res : Success
+* Date         : March 2015
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type TweetMessageTypeuuid as closed {
+  tweetid: uuid,
+  sender_location: point,
+  send_time: datetime,
+  referred_topics: {{ string }},
+  message_text: string,
+  countA: int32,
+  countB: int32
+}
+
+
+create dataset TweetMessageuuids(TweetMessageTypeuuid)
+primary key tweetid autogenerated;
+
+create function NearbyTweetsContainingText(place, text) {
+  (select m.message_text
+  from TweetMessageuuids m
+  where contains(m.message_text,text)
+  and spatial_intersect(m.sender_location, place))
+};
+
+create broker brokerA at "http://www.notifyA.com";
+
+create repetitive channel nearbyTweetChannel using NearbyTweetsContainingText@2 period duration("PT10M");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.aql
deleted file mode 100644
index 2af20cc..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.aql
+++ /dev/null
@@ -1,21 +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 channels;
-
-subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.sqlpp
new file mode 100644
index 0000000..3917107
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.2.update.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+subscribe to nearbyTweetChannel (point("30.0, 30.0"), "Live") on brokerA;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.aql
deleted file mode 100644
index 4f8f21e..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.aql
+++ /dev/null
@@ -1,21 +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 channels;
-
-subscribe to nearbyTweetChannel (point("20.0, 20.0"), "Long") on brokerA;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.sqlpp
new file mode 100644
index 0000000..8b813e6
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.3.update.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+subscribe to nearbyTweetChannel (point("20.0, 20.0"), "Long") on brokerA;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.aql
deleted file mode 100644
index 71c3e14..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.aql
+++ /dev/null
@@ -1,21 +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 channels;
-
-subscribe to nearbyTweetChannel (point("10.0, 10.0"), "Prosper") on brokerA;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.sqlpp
new file mode 100644
index 0000000..c6cda12
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.4.update.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+subscribe to nearbyTweetChannel (point("10.0, 10.0"), "Prosper") on brokerA;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.aql
deleted file mode 100644
index 22bf97c..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.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 channels;
-
-for $test in dataset nearbyTweetChannelSubscriptions
-order by $test.param1
-return $test.param1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.sqlpp
new file mode 100644
index 0000000..ef6a39c
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/subscribe_channel_check_subscriptions/subscribe_channel_check_subscriptions.5.query.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use channels;
+
+select value param1
+from nearbyTweetChannelSubscriptions
+order by param1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.aql
deleted file mode 100644
index e8f5d56..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.aql
+++ /dev/null
@@ -1,46 +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  : Room Occupants Long Term Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type userLocation as {
-  userId: int,
-  roomNumber: int
-}
-
-create dataset UserLocations(userLocation)
-primary key userId;
-
-create function RoomOccupants($room) {
-    for $location in dataset UserLocations
-    where $location.roomNumber = $room
-    return $location.userId
-};
-
-create broker brokerA at "http://www.notifyA.com";
-
-create repetitive channel roomRecords using RoomOccupants@1 period duration("PT1S");
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp
new file mode 100644
index 0000000..8b0b05c
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp
@@ -0,0 +1,46 @@
+/*
+ * 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  : Room Occupants Long Term Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type userLocation as {
+  userId: int,
+  roomNumber: int
+}
+
+create dataset UserLocations(userLocation)
+primary key userId;
+
+create function RoomOccupants($room) {
+    for $location in dataset UserLocations
+    where $location.roomNumber = $room
+    return $location.userId
+};
+
+create broker brokerA at "http://www.notifyA.com";
+
+create repetitive channel roomRecords using RoomOccupants@1 period duration("PT1S");

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.aql
deleted file mode 100644
index e253265..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-
-use dataverse channels;
-
-subscribe to roomRecords (123) on brokerA;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.sqlpp
new file mode 100644
index 0000000..3e2d5c0
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.2.update.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * 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  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+
+use channels;
+
+subscribe to roomRecords (123) on brokerA;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.aql
deleted file mode 100644
index 66d6a7d..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.aql
+++ /dev/null
@@ -1,34 +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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-
-use dataverse channels;
-
-
-upsert into dataset UserLocations([
-{"userId":1, "roomNumber":123},
-{"userId":2, "roomNumber":222},
-{"userId":3, "roomNumber":350}]
-);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.sqlpp
new file mode 100644
index 0000000..2499ac7
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.3.update.sqlpp
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+
+use channels;
+
+
+upsert into UserLocations([
+{"userId":1, "roomNumber":123},
+{"userId":2, "roomNumber":222},
+{"userId":3, "roomNumber":350}]
+);

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.aql
deleted file mode 100644
index 12bc053..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-600000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp
new file mode 100644
index 0000000..270326b
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+600000

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.aql b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.aql
deleted file mode 100644
index 55e044b..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.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  : Room Occupants Test
-* Expected Res : Success
-* Date         : Sep 2016
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-
-count (from $result in dataset roomRecordsResults
-order by $result.result
-select $result.result) > 599;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp
new file mode 100644
index 0000000..8db3fde
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Room Occupants Test
+* Expected Res : Success
+* Date         : Sep 2016
+* Author       : Steven Jacobs
+*/
+
+use channels;
+
+count (from $result in dataset roomRecordsResults
+order by $result.result
+select $result.result) > 599;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.aql
deleted file mode 100644
index 712ad54..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.aql
+++ /dev/null
@@ -1,45 +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  : Simple Delete Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-drop dataverse channels if exists;
-create dataverse channels;
-use dataverse channels;
-
-create type myLocation as {
-  timeStamp: datetime,
-  roomNumber: int
-}
-
-
-create dataset UserLocations(myLocation)
-primary key timeStamp;
-
-insert into dataset UserLocations([
-  {"timeStamp":current-datetime(), "roomNumber":222}]
-);
-
-create procedure deleteAll() {
-delete $i from dataset UserLocations
-};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.sqlpp
new file mode 100644
index 0000000..face703
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.sqlpp
@@ -0,0 +1,45 @@
+/*
+ * 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  : Simple Delete Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type myLocation as {
+  timeStamp: datetime,
+  roomNumber: int
+}
+
+
+create dataset UserLocations(myLocation)
+primary key timeStamp;
+
+insert into UserLocations([
+  {"timeStamp":current_datetime(), "roomNumber":222}]
+);
+
+create procedure deleteAll() {
+delete from UserLocations
+};

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.aql
deleted file mode 100644
index 16013d3..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.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  : Simple Delete Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-count(for $i in dataset UserLocations
-return $i);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.sqlpp
new file mode 100644
index 0000000..c3a42ea
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(location) from UserLocations location;

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/55514040/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.aql
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.aql b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.aql
deleted file mode 100644
index c02ee67..0000000
--- a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.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  : Simple Delete Procedure
-* Expected Res : Success
-* Date         : Jan 2017
-* Author       : Steven Jacobs
-*/
-
-use dataverse channels;
-execute deleteAll();
\ No newline at end of file