asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjaco...@apache.org
Subject [1/2] asterixdb-bad git commit: Added Procedures to BAD
Date Wed, 01 Mar 2017 20:08:19 GMT
Repository: asterixdb-bad
Updated Branches:
  refs/heads/master 3dcf57c4d -> 79226b576


http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/RepetitiveChannelOperatorNodePushable.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/RepetitiveChannelOperatorNodePushable.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/RepetitiveChannelOperatorNodePushable.java
deleted file mode 100644
index 1bbe331..0000000
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/RepetitiveChannelOperatorNodePushable.java
+++ /dev/null
@@ -1,76 +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.
- */
-package org.apache.asterix.bad.runtime;
-
-import java.util.EnumSet;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.logging.Logger;
-
-import org.apache.asterix.active.ActiveRuntimeId;
-import org.apache.asterix.active.ActiveSourceOperatorNodePushable;
-import org.apache.asterix.bad.ChannelJobService;
-import org.apache.hyracks.api.client.HyracksConnection;
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.api.job.JobFlag;
-import org.apache.hyracks.api.job.JobSpecification;
-
-public class RepetitiveChannelOperatorNodePushable extends ActiveSourceOperatorNodePushable
{
-
-    private static final Logger LOGGER = Logger.getLogger(RepetitiveChannelOperatorNodePushable.class.getName());
-
-    private ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
-    private final JobSpecification jobSpec;
-    private long duration;
-    private final HyracksConnection hcc;
-
-    public RepetitiveChannelOperatorNodePushable(IHyracksTaskContext ctx, ActiveRuntimeId
runtimeId,
-            JobSpecification channeljobSpec, String duration, String strIP, int port) throws
HyracksDataException {
-        super(ctx, runtimeId);
-        this.jobSpec = channeljobSpec;
-        this.duration = ChannelJobService.findPeriod(duration);
-        try {
-            hcc = new HyracksConnection(strIP, port);
-        } catch (Exception e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-
-    @Override
-    protected void start() throws HyracksDataException, InterruptedException {
-        try {
-            scheduledExecutorService =
-                    ChannelJobService.startJob(jobSpec, EnumSet.noneOf(JobFlag.class), null,
hcc, duration);
-        } catch (Exception e) {
-            throw new HyracksDataException(e);
-        }
-        while (!scheduledExecutorService.isTerminated()) {
-
-        }
-
-    }
-
-    @Override
-    protected void abort() throws HyracksDataException, InterruptedException {
-        scheduledExecutorService.shutdown();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/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 94b4c78..b433f5f 100644
--- a/asterix-bad/src/main/resources/lang-extension/lang.txt
+++ b/asterix-bad/src/main/resources/lang-extension/lang.txt
@@ -5,6 +5,8 @@ import org.apache.asterix.bad.lang.statement.ChannelUnsubscribeStatement;
 import org.apache.asterix.bad.lang.statement.CreateBrokerStatement;
 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;
 
 
 @merge
@@ -18,7 +20,7 @@ Statement SingleStatement() throws ParseException:
   (
     // merge area 2
     before:
-    after:    | stmt = ChannelSubscriptionStatement())
+    after:    | stmt = ChannelSubscriptionStatement() | stmt = ProcedureExecution())
   {
     // merge area 3
   }
@@ -60,6 +62,10 @@ Statement DropStatement() throws ParseException:
       {
         stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);	
       }
+              | "procedure" funcSig = FunctionSignature() ifExists = IfExists()
+      {
+        stmt = new ProcedureDropStatement(funcSig, ifExists);
+      }
       )
   {
     // merge area 3
@@ -74,13 +80,13 @@ CreateChannelStatement ChannelSpecification() throws ParseException:
   CreateChannelStatement ccs = null;
   String fqFunctionName = null;
   Expression period = null;
-  boolean distributed = false;
+  boolean distributed = true;
 }
 {
   (
     "repetitive" "channel"  nameComponents = QualifiedName()
     <USING> appliedFunction = FunctionSignature()
-    "period" period = FunctionCallExpr() ("distributed" { distributed = true; })?
+    "period" period = FunctionCallExpr() ("nondistributed" { distributed = false; })?
     {
       ccs = new CreateChannelStatement(nameComponents.first,
                                    nameComponents.second, appliedFunction, period, distributed);
@@ -91,37 +97,67 @@ CreateChannelStatement ChannelSpecification() throws ParseException:
     }
 }
 
-
 @new
 CreateProcedureStatement ProcedureSpecification() throws ParseException:
 {
-  Pair<Identifier,Identifier> nameComponents = null;
+  FunctionName fctName = null;
   FunctionSignature signature;
   List<VarIdentifier> paramList = new ArrayList<VarIdentifier>();
   String functionBody;
   Token beginPos;
   Token endPos;
-  Expression functionBodyExpr;
+  Statement functionBodyExpr;
+  Expression period = null;
 }
 {
-    "procedure" nameComponents = QualifiedName()
+     "procedure" fctName = FunctionName()
      paramList = ParameterList()
     <LEFTBRACE>
   {
      beginPos = token;
   }
-  functionBodyExpr = Expression() <RIGHTBRACE>
+  functionBodyExpr = SingleStatement() <RIGHTBRACE>
     {
       endPos = token;
       functionBody = extractFragment(beginPos.beginLine, beginPos.beginColumn, endPos.beginLine,
endPos.beginColumn);
-      signature = new FunctionSignature(nameComponents.first.toString(), nameComponents.second.toString(),
paramList.size());
+      signature = new FunctionSignature(fctName.dataverse, fctName.function, paramList.size());
       removeCurrentScope();
-      return new CreateProcedureStatement(signature, paramList, functionBody);
     }
+  ("period" period = FunctionCallExpr())?
+  {
+  return new CreateProcedureStatement(signature, paramList, functionBody, period);
+  }
 }
 
-
-
+@new
+ExecuteProcedureStatement ProcedureExecution() throws ParseException:
+{
+  ExecuteProcedureStatement callExpr;
+  List<Expression> argList = new ArrayList<Expression>();
+  Expression tmp;
+  int arity = 0;
+  FunctionName funcName = null;
+  String hint = null;
+}
+{
+  "execute"
+  funcName = FunctionName()
+  <LEFTPAREN> (tmp = Expression()
+    {
+      argList.add(tmp);
+      arity ++;
+    }
+  (<COMMA> tmp = Expression()
+    {
+      argList.add(tmp);
+      arity++;
+    }
+  )*)? <RIGHTPAREN>
+    {
+      String fqFunctionName =  funcName.function;
+      return new ExecuteProcedureStatement(funcName.dataverse, fqFunctionName, arity);
+    }
+}
 
 @new
 CreateBrokerStatement BrokerSpecification() throws ParseException:

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/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
new file mode 100644
index 0000000..be1fc86
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.1.ddl.aql
@@ -0,0 +1,27 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..0a0c582
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.2.query.aql
@@ -0,0 +1,10 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..e9adaa8
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.3.update.aql
@@ -0,0 +1,9 @@
+/*
+* Description  : Simple Delete Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use dataverse channels;
+execute deleteAll();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/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
new file mode 100644
index 0000000..0a0c582
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure/delete_procedure.4.query.aql
@@ -0,0 +1,10 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..1110d94
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.1.ddl.aql
@@ -0,0 +1,25 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..ddc2790
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.2.update.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..ddc2790
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.3.update.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..ddc2790
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.4.update.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..a229f81
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.5.ddl.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..df9cc77
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/insert_procedure/insert_procedure.6.query.aql
@@ -0,0 +1,10 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..eaebfbd
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.1.ddl.aql
@@ -0,0 +1,25 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..2f0e968
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.2.update.aql
@@ -0,0 +1,12 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..824d026
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..199d0fc
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.4.update.aql
@@ -0,0 +1,11 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..25e0ba5
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..f4d45c9
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.1.ddl.aql
@@ -0,0 +1,25 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..ddc2790
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.2.update.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..8adb253
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.3.sleep.aql
@@ -0,0 +1,8 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..3b6e6c4
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.4.ddl.aql
@@ -0,0 +1,9 @@
+/*
+* 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/79226b57/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
new file mode 100644
index 0000000..8a1872c
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.query.aql
@@ -0,0 +1,10 @@
+/*
+* 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/79226b57/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.2.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.2.adm
b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.2.adm
new file mode 100644
index 0000000..56a6051
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.2.adm
@@ -0,0 +1 @@
+1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.4.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.4.adm
b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.4.adm
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure/delete_procedure.4.adm
@@ -0,0 +1 @@
+0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/asterix-bad/src/test/resources/runtimets/results/procedure/insert_procedure/insert_procedure.6.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/insert_procedure/insert_procedure.6.adm
b/asterix-bad/src/test/resources/runtimets/results/procedure/insert_procedure/insert_procedure.6.adm
new file mode 100644
index 0000000..e440e5c
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/insert_procedure/insert_procedure.6.adm
@@ -0,0 +1 @@
+3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
new file mode 100644
index 0000000..6dd90d2
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
@@ -0,0 +1 @@
+222
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
new file mode 100644
index 0000000..b1d4fa9
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
@@ -0,0 +1,2 @@
+222
+225
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/asterix-bad/src/test/resources/runtimets/results/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.adm
b/asterix-bad/src/test/resources/runtimets/results/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/repetitive_insert_procedure/repetitive_insert_procedure.5.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/79226b57/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 997dc77..d9ade1f 100644
--- a/asterix-bad/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-bad/src/test/resources/runtimets/testsuite.xml
@@ -8,6 +8,26 @@
             <output-dir compare="Text">room_occupants</output-dir>
         </compilation-unit>
     </test-case>
+    <test-case FilePath="procedure">
+        <compilation-unit name="insert_procedure">
+            <output-dir compare="Text">insert_procedure</output-dir>
+        </compilation-unit>
+    </test-case>
+    <test-case FilePath="procedure">
+        <compilation-unit name="delete_procedure">
+            <output-dir compare="Text">delete_procedure</output-dir>
+        </compilation-unit>
+    </test-case>
+    <test-case FilePath="procedure">
+        <compilation-unit name="query_procedure">
+            <output-dir compare="Text">query_procedure</output-dir>
+        </compilation-unit>
+    </test-case>
+    <test-case FilePath="procedure">
+        <compilation-unit name="repetitive_insert_procedure">
+            <output-dir compare="Text">repetitive_insert_procedure</output-dir>
+        </compilation-unit>
+    </test-case>
     <test-case FilePath="channel">
         <compilation-unit name="create_channel_check_datasets">
             <output-dir compare="Text">create_channel_check_datasets</output-dir>


Mime
View raw message