Added a new test for positional variable in partitioned group-by
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.1.ddl.aql
new file mode 100644
index 0000000..d8f7cd5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.1.ddl.aql
@@ -0,0 +1,39 @@
+/*
+ * Description : Test for clause of the position variable in FLWOR expression, using partitioned group-by
+ * Expected Result : Success
+ * Date : 07/27/2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type EmploymentType as open {
+ organization-name: string,
+ start-date: date,
+ end-date: date?
+}
+
+create type FacebookUserType as closed {
+ id: int32,
+ alias: string,
+ name: string,
+ user-since: datetime,
+ friend-ids: {{ int32 }},
+ employment: [EmploymentType]
+}
+
+create type FacebookMessageType as closed {
+ message-id: int32,
+ author-id: int32,
+ in-response-to: int32?,
+ sender-location: point?,
+ message: string
+}
+
+create dataset FacebookUsers(FacebookUserType)
+ primary key id;
+
+create dataset FacebookMessages(FacebookMessageType)
+primary key message-id;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.2.update.aql
new file mode 100644
index 0000000..8ecce52
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.2.update.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : Test for clause of the position variable in FLWOR expression, using partitioned group-by
+ * Expected Result : Success
+ * Date : 07/27/2013
+ */
+
+use dataverse test;
+
+load dataset FacebookUsers using localfs
+(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm"));
+
+load dataset FacebookMessages using localfs
+(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm"));
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.3.query.aql
new file mode 100644
index 0000000..e46760f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at02/at02.3.query.aql
@@ -0,0 +1,19 @@
+/*
+ * Description : Test for clause of the position variable in FLWOR expression, using partitioned group-by
+ * Expected Result : Success
+ * Date : 07/27/2013
+ */
+
+use dataverse test;
+
+for $u in dataset('FacebookUsers')
+for $m in dataset('FacebookMessages')
+where $u.id = $m.author-id
+group by $g := $u.id with $u, $m
+order by $g
+return { "group": $g,
+ "item": (
+ for $a at $p in (for $ii in $m order by $ii.message-id return $ii)
+ return {"num": $p, "mid": $a.message-id}
+ )
+ };
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.1.ddl.aql
index 367fb8f..9e1015c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.1.ddl.aql
@@ -1,5 +1,5 @@
/*
- * Description : Test for clause of the position variable in FLWOR expression
+ * Description : Test for clause of the position variable in FLWOR expression nested in group-by
* Expected Result : Success
* Date : 07/18/2013
*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.2.update.aql
index 5fc25cd..95cde2a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.2.update.aql
@@ -1,5 +1,5 @@
/*
- * Description : Test for clause of the position variable in FLWOR expression
+ * Description : Test for clause of the position variable in FLWOR expression nested in group-by
* Expected Result : Success
* Date : 07/18/2013
*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.3.query.aql
index 15ce8f6..5c115fe 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at03/at03.3.query.aql
@@ -1,5 +1,5 @@
/*
- * Description : Test for clause of the position variable in FLWOR expression
+ * Description : Test for clause of the position variable in FLWOR expression nested in group-by
* Expected Result : Success
* Date : 07/18/2013
*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.1.ddl.aql
similarity index 94%
rename from asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.1.ddl.aql
rename to asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.1.ddl.aql
index 03517b5..336cb49 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.1.ddl.aql
@@ -1,5 +1,5 @@
/*
- * Description : Test for clause of the position variable in FLWOR expression
+ * Description : Test for clause of the position variable in FLWOR expression using tpch
* Expected Result : Success
* Date : 07/18/2013
*/
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.2.update.aql
similarity index 90%
rename from asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.2.update.aql
rename to asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.2.update.aql
index 3676177..8509181 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.2.update.aql
@@ -1,9 +1,9 @@
/*
- * Description : Test for clause of the position variable in FLWOR expression
+ * Description : Test for clause of the position variable in FLWOR expression using tpch dataset
* Expected Result : Success
* Date : 07/18/2013
*/
-
+
use dataverse test;
load dataset Orders
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.3.query.aql
similarity index 93%
rename from asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.3.query.aql
index 348b2ea..64d6a3d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at03.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/at04/at04.3.query.aql
@@ -1,5 +1,5 @@
/*
- * Description : Test for clause of the position variable in FLWOR expression
+ * Description : Test for clause of the position variable in FLWOR expression using tpch
* Expected Result : Success
* Date : 07/18/2013
*/
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/at02/at02.1.adm b/asterix-app/src/test/resources/runtimets/results/flwor/at02/at02.1.adm
new file mode 100644
index 0000000..93ebdb9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/at02/at02.1.adm
@@ -0,0 +1,8 @@
+{ "group": 1, "item": [ { "num": 1, "mid": 2 }, { "num": 2, "mid": 4 }, { "num": 3, "mid": 8 }, { "num": 4, "mid": 10 }, { "num": 5, "mid": 11 } ] }
+{ "group": 2, "item": [ { "num": 1, "mid": 3 }, { "num": 2, "mid": 6 } ] }
+{ "group": 3, "item": [ { "num": 1, "mid": 1 }, { "num": 2, "mid": 9 } ] }
+{ "group": 5, "item": [ { "num": 1, "mid": 7 } ] }
+{ "group": 6, "item": [ { "num": 1, "mid": 5 } ] }
+{ "group": 7, "item": [ { "num": 1, "mid": 15 } ] }
+{ "group": 9, "item": [ { "num": 1, "mid": 14 } ] }
+{ "group": 10, "item": [ { "num": 1, "mid": 12 }, { "num": 2, "mid": 13 } ] }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index d8fe04c..35911e3 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -20,6 +20,11 @@
</compilation-unit>
</test-case>
<test-case FilePath="flwor">
+ <compilation-unit name="at02">
+ <output-dir compare="Text">at02</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="flwor">
<compilation-unit name="at03">
<output-dir compare="Text">at03</output-dir>
</compilation-unit>