Fix for issue 252 and 253

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_issue_252_253@1182 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-w-optional.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-w-optional.aql
index 354757d..c5fb80c1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-w-optional.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-w-optional.aql
@@ -18,9 +18,9 @@
 optnl_fld:string?
 }
 
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
-create dataset T2(TestType) partitioned by key id;
+create dataset T2(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-wo-optional.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-wo-optional.aql
index 9d4b90a..b31fe88 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-wo-optional.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c-wo-optional.aql
@@ -19,9 +19,9 @@
 optnl_fld:string?
 }
 
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
-create dataset T2(TestType) partitioned by key id;
+create dataset T2(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c.aql
index 83888f3..9f923e7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/c2c.aql
@@ -17,10 +17,10 @@
 }
 
 // source dataset
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
 // target dataset
-create dataset T2(TestType) partitioned by key id;
+create dataset T2(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list-ordered01.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list-ordered01.aql
index 27935e0..b51c1fe 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list-ordered01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list-ordered01.aql
@@ -22,7 +22,7 @@
 batters:[[BatterType]]
 }
 
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list01.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list01.aql
index 7ba1641..82823ce 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list01.aql
@@ -22,7 +22,7 @@
 batters:{{BatterType}}
 }
 
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql
index 47dd921..45e4bac 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql
@@ -22,7 +22,7 @@
 batters:[[BatterType]]
 }
 
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql
index 94a87c0..94faa44 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql
@@ -23,7 +23,7 @@
 batters:[[BatterType]]?
 }
 
-create dataset T1(TestType) partitioned by key id;
+create dataset T1(TestType) primary key id;
 
 insert into dataset T1({
 "id":1234,
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-01.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-01.aql
index 0d26b5d..55d0497 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-01.aql
@@ -16,7 +16,7 @@
 name : string
 }
 
-create dataset testds(testType) partitioned by key id;
+create dataset testds(testType) primary key id;
 
 
 insert into dataset testds({"id": 123, "name": "John Doe", "hobbies": {{ "scuba", "music" }} }
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-12.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-12.aql
index ae21794..087ca36 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-12.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-12.aql
@@ -22,9 +22,9 @@
 name : string
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "001", "name": "Person One", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-14.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-14.aql
index 6c517ca..7038437 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-14.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-14.aql
@@ -19,9 +19,9 @@
   id: string  
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds01 (
 { "id": "001" }
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-15.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-15.aql
index 2ac2567..d3547e2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-15.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-15.aql
@@ -26,7 +26,7 @@
 lat_lon: point
 }
 
-create dataset tdtst(Schema) partitioned by key id_32; 
+create dataset tdtst(Schema) primary key id_32; 
 
 insert into dataset tdtst(
 let $f1:=time("10:50:56:200+05:00")
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-16.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-16.aql
index 5e1a591..d07fce0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-16.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-16.aql
@@ -26,7 +26,7 @@
 lat_lon: point
 }
 
-create dataset tdtst(Schema) partitioned by key id_32; 
+create dataset tdtst(Schema) primary key id_32; 
 
 insert into dataset tdtst(
 let $f1:=time("10:50:56:200+05:00")
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-17.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-17.aql
index a590cf1..da83e0f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-17.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-17.aql
@@ -22,7 +22,7 @@
 lat_lon: point
 }
 
-create dataset tdtst(Schema) partitioned by key id_32; 
+create dataset tdtst(Schema) primary key id_32; 
 
 insert into dataset tdtst(
 let $f1:=time("10:50:56:200+05:00")
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-19.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-19.aql
index b406663..1d93992 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-19.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-19.aql
@@ -15,7 +15,7 @@
 id:int32
 }
 
-create dataset dtst01(TestType) partitioned by key id;
+create dataset dtst01(TestType) primary key id;
 
 insert into dtst01({"id":137});
 insert into dtst01({"id":117});
@@ -30,7 +30,7 @@
 dob:date
 }
 
-create dataset employee(Emp) partitioned by key id;
+create dataset employee(Emp) primary key id;
 
 insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":"1-1-82"});
 insert into dataset employee({"id":202,"name":"John Smith","age":30,"sex":"M","dob":"1-1-82"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql
index 29b4366..7f1be27 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql
@@ -16,7 +16,7 @@
 id:int32
 }
 
-create dataset dtst01(TestType) partitioned by key id;
+create dataset dtst01(TestType) primary key id;
 
 create type Emp as open {
 id:int32,
@@ -26,7 +26,7 @@
 dob:date?
 }
 
-create dataset employee(Emp) partitioned by key id;
+create dataset employee(Emp) primary key id;
 
 insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":date("1975-01-11")});
 insert into dataset employee({"id":202,"name":"John Smith","age":30,date("1982-05-23")});
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql
index c52344e..3d955c8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql
@@ -14,7 +14,7 @@
 id:int32
 }
 
-create dataset dtst01(TestType) partitioned by key id;
+create dataset dtst01(TestType) primary key id;
 
 create type Emp as open {
 id:int32,
@@ -24,7 +24,7 @@
 dob:date
 }
 
-create dataset employee(Emp) partitioned by key id;
+create dataset employee(Emp) primary key id;
 
 insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":date("1975-01-11")});
 insert into dataset employee({"id":202,"name":"John Smith","age":30,"sex":"M","dob":date("1982-07-12")});
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
index cd9ac44..0b4c31f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
@@ -20,7 +20,7 @@
 dob:date?
 }
 
-create dataset employee(Emp) partitioned by key id;
+create dataset employee(Emp) primary key id;
 
 //date("YYYY-MM-DD")
 insert into dataset employee({"id":201,"name":"John Doe","age":37,"dept":"HR","sex":"M","dob":date("1975-11-02")});
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql
index 7012a5a..4123cf2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql
@@ -17,7 +17,7 @@
 opt_tag : {{ string }}
 }
 
-create dataset testds(testType) partitioned by key id;
+create dataset testds(testType) primary key id;
 
 insert into dataset testds({"id": 32,"name": "UCI","opt_tag":{{"optional text","put any text here","and more"}}});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql
index b29b63a..ec0d4cd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql
@@ -17,7 +17,7 @@
 opt_tag : {{ string }}?
 }
 
-create dataset testds(testType) partitioned by key id;
+create dataset testds(testType) primary key id;
 
 insert into dataset testds({"id": 32,"name": "UCI","opt_tag":{{"optional text","put any text here","and more"}}});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql
index f19e4a7..486b76e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql
@@ -18,7 +18,7 @@
 opt_tag : {{ string }}?
 }
 
-create dataset testds(testType) partitioned by key id;
+create dataset testds(testType) primary key id;
 
 insert into dataset testds({"id": 32,"name": "UCI"});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-28.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-28.aql
index 8fdab75..acef21e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-28.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-28.aql
@@ -20,9 +20,9 @@
 name : string
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "001", "name": "Person One", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-29.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-29.aql
index 9560430..5047342 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-29.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-29.aql
@@ -20,9 +20,9 @@
 name : string
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "001", "name": "Person One", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-30.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-30.aql
index 42aa2e6..e52be74 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-30.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-30.aql
@@ -19,9 +19,9 @@
 name : string
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "011", "name": "John Doe", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-31.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-31.aql
index 03b1754..5d5fa33 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-31.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-31.aql
@@ -18,9 +18,9 @@
 name : string
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "011", "name": "John Doe", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-32.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-32.aql
index f101e47..a79c53d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-32.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-32.aql
@@ -23,9 +23,9 @@
 interests : {{string}}
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "011", "name": "John Doe", "sex":"Male", "dept":"HR", "salary":80000,"interests":{{"hiking","scuba","painting","biking"}}});
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-33.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-33.aql
index b75e6c6..809c93e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-33.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-33.aql
@@ -24,9 +24,9 @@
 interests : {{string}}?
 }
 
-create dataset testds01(testtype01) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
 
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds02 (
 { "id": "011", "name": "John Doe", "sex":"Male", "dept":"HR", "salary":80000,"interests":{{"hiking","scuba","painting","biking"}}});
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
index e46286c..2094b4a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
@@ -26,7 +26,7 @@
 }
 
 create dataset TweetMessages(TweetMessageType)
-partitioned by key tweetid;
+primary key tweetid;
 
 load dataset TweetMessages
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue236.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue236.aql
index 3d8ab69..7e859af 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue236.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue236.aql
@@ -31,7 +31,7 @@
 }
 
 create dataset TweetMessages(TweetMessageType)
-partitioned by key tweetid;
+primary key tweetid;
 
 
 insert into dataset TweetMessages(
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql
index a8d00f8..2668430 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal.aql
@@ -26,7 +26,7 @@
 };
 
 create dataset TweetMessages(TweetMessageType)
-partitioned by key tweetid;
+primary key tweetid;
 
 insert into dataset TweetMessages(
    {
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql
index 36feac4..b3945a0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-proposal02.aql
@@ -27,7 +27,7 @@
 };
 
 create dataset TweetMessages(TweetMessageType)
-partitioned by key tweetid;
+primary key tweetid;
 
 insert into dataset TweetMessages(
    {