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/AQLTS/queries/del-dataset.aql b/asterix-app/src/test/resources/AQLTS/queries/del-dataset.aql
index 51e4344..1660e44 100644
--- a/asterix-app/src/test/resources/AQLTS/queries/del-dataset.aql
+++ b/asterix-app/src/test/resources/AQLTS/queries/del-dataset.aql
@@ -24,6 +24,6 @@
 create nodegroup group1  if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 drop dataset Customers;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/AQLTS/queries/load-del-dataset.aql b/asterix-app/src/test/resources/AQLTS/queries/load-del-dataset.aql
index f70de14..576a9da 100644
--- a/asterix-app/src/test/resources/AQLTS/queries/load-del-dataset.aql
+++ b/asterix-app/src/test/resources/AQLTS/queries/load-del-dataset.aql
@@ -24,7 +24,7 @@
 create nodegroup group1  if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/dapd/denorm_user_event.aql b/asterix-app/src/test/resources/dapd/denorm_user_event.aql
index a3b9fab..fe79872 100644
--- a/asterix-app/src/test/resources/dapd/denorm_user_event.aql
+++ b/asterix-app/src/test/resources/dapd/denorm_user_event.aql
@@ -27,8 +27,8 @@
 
 declare nodegroup group1 on nc1, nc2;
 
-declare dataset Users(UserType) partitioned by key u_name on group1;
-declare dataset Events(EventType) partitioned by key e_name on group1;
+declare dataset Users(UserType) primary key u_name on group1;
+declare dataset Events(EventType) primary key e_name on group1;
 
 write output to nc1:"/tmp/denorm_user_event.adm";
 
diff --git a/asterix-app/src/test/resources/dapd/q1.aql b/asterix-app/src/test/resources/dapd/q1.aql
index ae6b28f..934387b 100644
--- a/asterix-app/src/test/resources/dapd/q1.aql
+++ b/asterix-app/src/test/resources/dapd/q1.aql
@@ -23,7 +23,7 @@
 
 declare nodegroup group1 on nc1, nc2;
 
-declare dataset User(UserType) partitioned by key name on group1;
+declare dataset User(UserType) primary key name on group1;
 
 write output to nc1:"/tmp/q1.adm";
 
diff --git a/asterix-app/src/test/resources/dapd/q2.aql b/asterix-app/src/test/resources/dapd/q2.aql
index 3998b9e..fdb0469 100644
--- a/asterix-app/src/test/resources/dapd/q2.aql
+++ b/asterix-app/src/test/resources/dapd/q2.aql
@@ -37,7 +37,7 @@
 
 drop dataset Event;
 declare dataset Event(EventType) 
-  partitioned by key event_id on group1;
+  primary key event_id on group1;
 
 load dataset Event 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo0216/01-load-dblp-large.aql b/asterix-app/src/test/resources/demo0216/01-load-dblp-large.aql
index 0cb6b21..171c935 100644
--- a/asterix-app/src/test/resources/demo0216/01-load-dblp-large.aql
+++ b/asterix-app/src/test/resources/demo0216/01-load-dblp-large.aql
@@ -12,7 +12,7 @@
 rainbow-04, rainbow-05;
 
 declare dataset DBLP(DBLPType)
- partitioned by key id on group1;
+ primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo0216/03-load-dblp-small.aql b/asterix-app/src/test/resources/demo0216/03-load-dblp-small.aql
index f4d8ae0..751179f 100644
--- a/asterix-app/src/test/resources/demo0216/03-load-dblp-small.aql
+++ b/asterix-app/src/test/resources/demo0216/03-load-dblp-small.aql
@@ -12,7 +12,7 @@
 rainbow-04, rainbow-05;
 
 declare dataset DBLPSmall(DBLPType)
- partitioned by key id on group1;
+ primary key id on group1;
 
 load dataset DBLPSmall 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo0216/110-self-join-dblp.aql b/asterix-app/src/test/resources/demo0216/110-self-join-dblp.aql
index 9077f33..dc40196 100644
--- a/asterix-app/src/test/resources/demo0216/110-self-join-dblp.aql
+++ b/asterix-app/src/test/resources/demo0216/110-self-join-dblp.aql
@@ -12,7 +12,7 @@
 rainbow-04, rainbow-05;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to rainbow-01:"/home/hyracks/dblp-self-join.adm";
 
diff --git a/asterix-app/src/test/resources/demo0216/120-self-join-dblp-small.aql b/asterix-app/src/test/resources/demo0216/120-self-join-dblp-small.aql
index 66ca6cb..5802236 100644
--- a/asterix-app/src/test/resources/demo0216/120-self-join-dblp-small.aql
+++ b/asterix-app/src/test/resources/demo0216/120-self-join-dblp-small.aql
@@ -12,7 +12,7 @@
 rainbow-04, rainbow-05;
 
 declare dataset DBLPSmall(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to rainbow-01:"/home/hyracks/small-dblp-self-join.adm";
 
diff --git a/asterix-app/src/test/resources/demo0927/local/create-index.aql b/asterix-app/src/test/resources/demo0927/local/create-index.aql
index 3ecd163..dd41fc8 100644
--- a/asterix-app/src/test/resources/demo0927/local/create-index.aql
+++ b/asterix-app/src/test/resources/demo0927/local/create-index.aql
@@ -20,6 +20,6 @@
 declare nodegroup group1 on nc1,nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 create index NameIndex on Customers(name);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/demo0927/local/dataset-filter-int.aql b/asterix-app/src/test/resources/demo0927/local/dataset-filter-int.aql
index 3acb8f8..c50405b 100644
--- a/asterix-app/src/test/resources/demo0927/local/dataset-filter-int.aql
+++ b/asterix-app/src/test/resources/demo0927/local/dataset-filter-int.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/mycustomers.adm";
 
diff --git a/asterix-app/src/test/resources/demo0927/local/dataset-filter-str.aql b/asterix-app/src/test/resources/demo0927/local/dataset-filter-str.aql
index 35401cf..89242ea 100644
--- a/asterix-app/src/test/resources/demo0927/local/dataset-filter-str.aql
+++ b/asterix-app/src/test/resources/demo0927/local/dataset-filter-str.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/mycustomers.adm";
 
diff --git a/asterix-app/src/test/resources/demo0927/local/dataset-scan.aql b/asterix-app/src/test/resources/demo0927/local/dataset-scan.aql
index 2f8746c..230b6f2 100644
--- a/asterix-app/src/test/resources/demo0927/local/dataset-scan.aql
+++ b/asterix-app/src/test/resources/demo0927/local/dataset-scan.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/mycustomers.adm";
 
diff --git a/asterix-app/src/test/resources/demo0927/local/declare-index.aql b/asterix-app/src/test/resources/demo0927/local/declare-index.aql
index ecacc49..49c0a31 100644
--- a/asterix-app/src/test/resources/demo0927/local/declare-index.aql
+++ b/asterix-app/src/test/resources/demo0927/local/declare-index.aql
@@ -20,6 +20,6 @@
 declare nodegroup group1 on nc1,nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 declare index NameIndex on Customers(name);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/demo0927/local/join-cust-ord.aql b/asterix-app/src/test/resources/demo0927/local/join-cust-ord.aql
index b262860..6630507 100644
--- a/asterix-app/src/test/resources/demo0927/local/join-cust-ord.aql
+++ b/asterix-app/src/test/resources/demo0927/local/join-cust-ord.aql
@@ -30,9 +30,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/custorder.adm";
 
diff --git a/asterix-app/src/test/resources/demo0927/local/load-cust.aql b/asterix-app/src/test/resources/demo0927/local/load-cust.aql
index b71731c..885b226 100644
--- a/asterix-app/src/test/resources/demo0927/local/load-cust.aql
+++ b/asterix-app/src/test/resources/demo0927/local/load-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo0927/local/load-ord.aql b/asterix-app/src/test/resources/demo0927/local/load-ord.aql
index 15ba4cf..6fba4b1 100644
--- a/asterix-app/src/test/resources/demo0927/local/load-ord.aql
+++ b/asterix-app/src/test/resources/demo0927/local/load-ord.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders from nc1:"/tmp/orderData.json";
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo0927/rainbow/01-load-cust.aql b/asterix-app/src/test/resources/demo0927/rainbow/01-load-cust.aql
index 74502a0..ed750e5 100644
--- a/asterix-app/src/test/resources/demo0927/rainbow/01-load-cust.aql
+++ b/asterix-app/src/test/resources/demo0927/rainbow/01-load-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers from rainbow-01:"/home/hyracks/demo-data/customerData.json";
 //  delete dataset Customers;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/demo0927/rainbow/02-filter-cust.aql b/asterix-app/src/test/resources/demo0927/rainbow/02-filter-cust.aql
index 2ed1304..d8070ef 100644
--- a/asterix-app/src/test/resources/demo0927/rainbow/02-filter-cust.aql
+++ b/asterix-app/src/test/resources/demo0927/rainbow/02-filter-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to rainbow-01:"/home/hyracks/mycustomers.adm";
 
diff --git a/asterix-app/src/test/resources/demo0927/rainbow/03-load-ord.aql b/asterix-app/src/test/resources/demo0927/rainbow/03-load-ord.aql
index a9bfe61..0fb5398 100644
--- a/asterix-app/src/test/resources/demo0927/rainbow/03-load-ord.aql
+++ b/asterix-app/src/test/resources/demo0927/rainbow/03-load-ord.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders from rainbow-01:"/home/hyracks/demo-data/orderData.json";
 // delete dataset Orders;
diff --git a/asterix-app/src/test/resources/demo0927/rainbow/04-join-custord.aql b/asterix-app/src/test/resources/demo0927/rainbow/04-join-custord.aql
index 57cc397..d89a799 100644
--- a/asterix-app/src/test/resources/demo0927/rainbow/04-join-custord.aql
+++ b/asterix-app/src/test/resources/demo0927/rainbow/04-join-custord.aql
@@ -30,9 +30,9 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to rainbow-01:"/home/hyracks/custorder.adm";
 
diff --git a/asterix-app/src/test/resources/demo1112/local/01-load-cust.aql b/asterix-app/src/test/resources/demo1112/local/01-load-cust.aql
index 8d764c3..dd7d2a9 100644
--- a/asterix-app/src/test/resources/demo1112/local/01-load-cust.aql
+++ b/asterix-app/src/test/resources/demo1112/local/01-load-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo1112/local/02-filter-cust.aql b/asterix-app/src/test/resources/demo1112/local/02-filter-cust.aql
index 24c5827..eb3f9a8 100644
--- a/asterix-app/src/test/resources/demo1112/local/02-filter-cust.aql
+++ b/asterix-app/src/test/resources/demo1112/local/02-filter-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/mycustomers.adm";
 
diff --git a/asterix-app/src/test/resources/demo1112/local/03-load-ord.aql b/asterix-app/src/test/resources/demo1112/local/03-load-ord.aql
index 7db4f4e..83657df 100644
--- a/asterix-app/src/test/resources/demo1112/local/03-load-ord.aql
+++ b/asterix-app/src/test/resources/demo1112/local/03-load-ord.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo1112/local/04-join-custord.aql b/asterix-app/src/test/resources/demo1112/local/04-join-custord.aql
index 1238e7e..fa82c9a 100644
--- a/asterix-app/src/test/resources/demo1112/local/04-join-custord.aql
+++ b/asterix-app/src/test/resources/demo1112/local/04-join-custord.aql
@@ -30,9 +30,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/custorder.adm";
 
diff --git a/asterix-app/src/test/resources/demo1112/rainbow/01-load-cust.aql b/asterix-app/src/test/resources/demo1112/rainbow/01-load-cust.aql
index ccb959d..f8c34fb 100644
--- a/asterix-app/src/test/resources/demo1112/rainbow/01-load-cust.aql
+++ b/asterix-app/src/test/resources/demo1112/rainbow/01-load-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers from rainbow-01:"/home/onose/demo-data/customerData.adm";
 // drop dataset Customers;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/demo1112/rainbow/02-filter-cust.aql b/asterix-app/src/test/resources/demo1112/rainbow/02-filter-cust.aql
index 2c08f34..2993b92 100644
--- a/asterix-app/src/test/resources/demo1112/rainbow/02-filter-cust.aql
+++ b/asterix-app/src/test/resources/demo1112/rainbow/02-filter-cust.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/mycustomers.adm";
 
diff --git a/asterix-app/src/test/resources/demo1112/rainbow/03-load-ord.aql b/asterix-app/src/test/resources/demo1112/rainbow/03-load-ord.aql
index 1329aa4..3134818 100644
--- a/asterix-app/src/test/resources/demo1112/rainbow/03-load-ord.aql
+++ b/asterix-app/src/test/resources/demo1112/rainbow/03-load-ord.aql
@@ -12,6 +12,6 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders from rainbow-01:"/home/onose/demo-data/orderData.adm";
diff --git a/asterix-app/src/test/resources/demo1112/rainbow/04-join-custord.aql b/asterix-app/src/test/resources/demo1112/rainbow/04-join-custord.aql
index 63c4670..18426d4 100644
--- a/asterix-app/src/test/resources/demo1112/rainbow/04-join-custord.aql
+++ b/asterix-app/src/test/resources/demo1112/rainbow/04-join-custord.aql
@@ -30,9 +30,9 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/custorder.adm";
 
diff --git a/asterix-app/src/test/resources/demo1112/rainbow/05-count-custord.aql b/asterix-app/src/test/resources/demo1112/rainbow/05-count-custord.aql
index dcbea09..f55ccbd 100644
--- a/asterix-app/src/test/resources/demo1112/rainbow/05-count-custord.aql
+++ b/asterix-app/src/test/resources/demo1112/rainbow/05-count-custord.aql
@@ -30,9 +30,9 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/custorder.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/local/01-load-cust.aql b/asterix-app/src/test/resources/demo_aql/local/01-load-cust.aql
index cd7a682..0cbbf5b 100644
--- a/asterix-app/src/test/resources/demo_aql/local/01-load-cust.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/01-load-cust.aql
@@ -18,7 +18,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo_aql/local/02-filter-cust.aql b/asterix-app/src/test/resources/demo_aql/local/02-filter-cust.aql
index 38171ed..f631afc 100644
--- a/asterix-app/src/test/resources/demo_aql/local/02-filter-cust.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/02-filter-cust.aql
@@ -18,7 +18,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/02-filter-cust.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/local/03-count-cust-age.aql b/asterix-app/src/test/resources/demo_aql/local/03-count-cust-age.aql
index 37698a7..1bba3f6 100644
--- a/asterix-app/src/test/resources/demo_aql/local/03-count-cust-age.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/03-count-cust-age.aql
@@ -18,7 +18,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/03-count-cust-age.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/local/04-load-ord.aql b/asterix-app/src/test/resources/demo_aql/local/04-load-ord.aql
index b8898f5..00f4f10 100644
--- a/asterix-app/src/test/resources/demo_aql/local/04-load-ord.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/04-load-ord.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo_aql/local/05-count-param1.aql b/asterix-app/src/test/resources/demo_aql/local/05-count-param1.aql
index 02263c4..f7cc468 100644
--- a/asterix-app/src/test/resources/demo_aql/local/05-count-param1.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/05-count-param1.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/05-count-param1.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/local/06-count-custord.aql b/asterix-app/src/test/resources/demo_aql/local/06-count-custord.aql
index 86e6ea0..3ff3a43 100644
--- a/asterix-app/src/test/resources/demo_aql/local/06-count-custord.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/06-count-custord.aql
@@ -28,9 +28,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/06-count-custord.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/local/101-load-dblp.aql b/asterix-app/src/test/resources/demo_aql/local/101-load-dblp.aql
index 7d6dc62..03cf233 100644
--- a/asterix-app/src/test/resources/demo_aql/local/101-load-dblp.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/101-load-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType)
- partitioned by key id on group1;
+ primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/demo_aql/local/102-fuzzy-select.aql b/asterix-app/src/test/resources/demo_aql/local/102-fuzzy-select.aql
index e37b49a..2cea3c5 100644
--- a/asterix-app/src/test/resources/demo_aql/local/102-fuzzy-select.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/102-fuzzy-select.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType)
- partitioned by key id on group1;
+ primary key id on group1;
 
 write output to nc1:"/tmp/102-fuzzy-select.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/local/110-self-join-dblp.aql b/asterix-app/src/test/resources/demo_aql/local/110-self-join-dblp.aql
index f51e455..64a65a5 100644
--- a/asterix-app/src/test/resources/demo_aql/local/110-self-join-dblp.aql
+++ b/asterix-app/src/test/resources/demo_aql/local/110-self-join-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:"/tmp/110-self-join-dblp.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/01-load-cust.aql b/asterix-app/src/test/resources/demo_aql/rainbow/01-load-cust.aql
index e75bce2..143f55f 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/01-load-cust.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/01-load-cust.aql
@@ -18,7 +18,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers from rainbow-01:"/home/onose/demo-data/semistructured/customer.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/02-filter-cust.aql b/asterix-app/src/test/resources/demo_aql/rainbow/02-filter-cust.aql
index 8af2368..a99e088 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/02-filter-cust.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/02-filter-cust.aql
@@ -18,7 +18,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/02-filter-cust.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/03-count-cust-age.aql b/asterix-app/src/test/resources/demo_aql/rainbow/03-count-cust-age.aql
index eda4015..714c60a 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/03-count-cust-age.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/03-count-cust-age.aql
@@ -18,7 +18,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/03-count-cust-age.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/04-load-ord.aql b/asterix-app/src/test/resources/demo_aql/rainbow/04-load-ord.aql
index bae97e8..be7a874 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/04-load-ord.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/04-load-ord.aql
@@ -12,6 +12,6 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders from rainbow-01:"/home/onose/demo-data/semistructured/orders.adm";
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/05-count-param1.aql b/asterix-app/src/test/resources/demo_aql/rainbow/05-count-param1.aql
index f5ec449..0ea243a 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/05-count-param1.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/05-count-param1.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/05-count-param1.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/06-count-custord.aql b/asterix-app/src/test/resources/demo_aql/rainbow/06-count-custord.aql
index ba5d5f4..2502d48a 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/06-count-custord.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/06-count-custord.aql
@@ -29,9 +29,9 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/06-count-custord.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/101-load-dblp.aql b/asterix-app/src/test/resources/demo_aql/rainbow/101-load-dblp.aql
index 20f0b51..9ed4a85 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/101-load-dblp.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/101-load-dblp.aql
@@ -12,7 +12,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset DBLP(DBLPType)
- partitioned by key id on group1;
+ primary key id on group1;
 
 load dataset DBLP from
   rainbow-01:"/home/onose/demo-data/dblp-id.txt" delimited by ":";
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/102-fuzzy-select.aql b/asterix-app/src/test/resources/demo_aql/rainbow/102-fuzzy-select.aql
index c9f072a..af129cb 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/102-fuzzy-select.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/102-fuzzy-select.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset DBLP(DBLPType)
- partitioned by key id on group1;
+ primary key id on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/102-fuzzy-select.adm";
 
diff --git a/asterix-app/src/test/resources/demo_aql/rainbow/110-self-join-dblp.aql b/asterix-app/src/test/resources/demo_aql/rainbow/110-self-join-dblp.aql
index c5b900b..37f06a0 100644
--- a/asterix-app/src/test/resources/demo_aql/rainbow/110-self-join-dblp.aql
+++ b/asterix-app/src/test/resources/demo_aql/rainbow/110-self-join-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to rainbow-01:"/home/onose/hyracks-rainbow/results/110-self-join-dblp.adm";
 
diff --git a/asterix-app/src/test/resources/dmlts/scripts/enlist-scan-cust.aql b/asterix-app/src/test/resources/dmlts/scripts/enlist-scan-cust.aql
index ed44308..5bc029d 100644
--- a/asterix-app/src/test/resources/dmlts/scripts/enlist-scan-cust.aql
+++ b/asterix-app/src/test/resources/dmlts/scripts/enlist-scan-cust.aql
@@ -24,7 +24,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 enlist dataset Customers;
 
diff --git a/asterix-app/src/test/resources/dmlts/scripts/load-cust.aql b/asterix-app/src/test/resources/dmlts/scripts/load-cust.aql
index d55dfed..77d023e 100644
--- a/asterix-app/src/test/resources/dmlts/scripts/load-cust.aql
+++ b/asterix-app/src/test/resources/dmlts/scripts/load-cust.aql
@@ -24,7 +24,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx-small.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx-small.aql
index f7dcf0e..5e819bd 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx-small.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx-small.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset CSXSmall(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset CSXSmall 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx.aql
index b5787a1..0b6da50 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-csx.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset CSX(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset CSX 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-dblp.aql
index 3ca85bb..c726018f 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/10-load-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1; 
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/20-drop-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/20-drop-dblp.aql
index 868d534..66af9ce 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/20-drop-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/20-drop-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset DBLP;
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/30-filter-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/30-filter-dblp.aql
index 45bd1c8..4a6b486 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/30-filter-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/30-filter-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:"/tmp/amerix.adm";
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/40-self-join-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/40-self-join-dblp.aql
index bc024c3..60eafd3 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/40-self-join-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/40-self-join-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1; 
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:"/tmp/amerix.adm";
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/amerix/50-self-join-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/amerix/50-self-join-dblp.aql
index eb44be7..536b549 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/amerix/50-self-join-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/amerix/50-self-join-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:"/tmp/amerix.adm";
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/dblp/000-1-char-at.aql b/asterix-app/src/test/resources/fuzzyjoin/dblp/000-1-char-at.aql
index 43a595d..182a17d 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/dblp/000-1-char-at.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/dblp/000-1-char-at.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:"/tmp/dblp.adm";
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/dblp/010-load.aql b/asterix-app/src/test/resources/fuzzyjoin/dblp/010-load.aql
index a857935..ab93f83 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/dblp/010-load.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/dblp/010-load.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/dblp/020-drop.aql b/asterix-app/src/test/resources/fuzzyjoin/dblp/020-drop.aql
index 65213dd..c82183b 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/dblp/020-drop.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/dblp/020-drop.aql
@@ -11,6 +11,6 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset DBLP;
diff --git a/asterix-app/src/test/resources/fuzzyjoin/dblp/030-filter.aql b/asterix-app/src/test/resources/fuzzyjoin/dblp/030-filter.aql
index b539aba..2588e99 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/dblp/030-filter.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/dblp/030-filter.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/dblp.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/dblp/040-self-join-aql.aql b/asterix-app/src/test/resources/fuzzyjoin/dblp/040-self-join-aql.aql
index 63e1a1e..4ac1a60 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/dblp/040-self-join-aql.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/dblp/040-self-join-aql.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/dblp.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/dblp/050-self-join-op.aql b/asterix-app/src/test/resources/fuzzyjoin/dblp/050-self-join-op.aql
index f2467f2..e97df35 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/dblp/050-self-join-op.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/dblp/050-self-join-op.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/dblp.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/010-load-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/010-load-dblp.aql
index 49d07ec..7ae0e30 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/010-load-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/010-load-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 // load dataset DBLP from nc1:'/asterix/asterix-app/data/pub-small/dblp-small-id.txt'
 load dataset DBLP 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/020-drop-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/020-drop-dblp.aql
index 65213dd..c82183b 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/020-drop-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/020-drop-dblp.aql
@@ -11,6 +11,6 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset DBLP;
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/030-filter-dblp.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/030-filter-dblp.aql
index d67d58a..7950d12 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/030-filter-dblp.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/030-filter-dblp.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/pub.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/040-load-csx.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/040-load-csx.aql
index 06dfb4e..a87398d 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/040-load-csx.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/040-load-csx.aql
@@ -11,7 +11,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset CSX(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 // load dataset CSX from nc1:'/asterix/asterix-app/data/pub-small/csx-small-id.txt'
 load dataset  CSX
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/050-drop-csx.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/050-drop-csx.aql
index c37c8b5..62e53ca 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/050-drop-csx.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/050-drop-csx.aql
@@ -11,6 +11,6 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset CSX(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset CSX;
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/060-filter-csx.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/060-filter-csx.aql
index 56b6dc9..daf53d3 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/060-filter-csx.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/060-filter-csx.aql
@@ -13,7 +13,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset CSX(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/pub.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/070-join-aql.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/070-join-aql.aql
index ec88679..a72fa03 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/070-join-aql.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/070-join-aql.aql
@@ -19,10 +19,10 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 declare dataset CSX(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/pub.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/pub/080-join-op.aql b/asterix-app/src/test/resources/fuzzyjoin/pub/080-join-op.aql
index 032031f..0466033 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/pub/080-join-op.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/pub/080-join-op.aql
@@ -19,10 +19,10 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 declare dataset CSX(CSXType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'/tmp/pub.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/010-load-users.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/010-load-users.aql
index be75fa6..affd0f3 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/010-load-users.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/010-load-users.aql
@@ -10,7 +10,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/020-drop-users.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/020-drop-users.aql
index 86525a7..71df5ae 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/020-drop-users.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/020-drop-users.aql
@@ -10,6 +10,6 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 
 drop dataset Users;
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/030-filter-users.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/030-filter-users.aql
index 298c0b1..4e6846f 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/030-filter-users.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/030-filter-users.aql
@@ -10,7 +10,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 
 write output to nc1:'/tmp/users.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/040-load-visitors.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/040-load-visitors.aql
index a75989a..0e07e69 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/040-load-visitors.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/040-load-visitors.aql
@@ -10,7 +10,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 load dataset Visitors 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/050-drop-visitors.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/050-drop-visitors.aql
index 15047b8..3a8e725 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/050-drop-visitors.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/050-drop-visitors.aql
@@ -10,6 +10,6 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 drop dataset Visitors;
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/060-fililter-visitors.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/060-fililter-visitors.aql
index dae180e..1fb0a4c 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/060-fililter-visitors.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/060-fililter-visitors.aql
@@ -10,7 +10,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 write output to nc1:'/tmp/visitors.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/070-join-aql-lottery_numbers.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/070-join-aql-lottery_numbers.aql
index aaa145f..c5a625a 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/070-join-aql-lottery_numbers.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/070-join-aql-lottery_numbers.aql
@@ -17,9 +17,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 declare dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 write output to nc1:'/tmp/users-visitors.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/080-join-op-lottery_numbers.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/080-join-op-lottery_numbers.aql
index ca5bebb..4275067 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/080-join-op-lottery_numbers.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/080-join-op-lottery_numbers.aql
@@ -17,9 +17,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 declare dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 write output to nc1:'/tmp/users-visitors.adm';
 
diff --git a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/090-join-op-interests.aql b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/090-join-op-interests.aql
index a7cf0a4..856e02f 100644
--- a/asterix-app/src/test/resources/fuzzyjoin/users-visitors/090-join-op-interests.aql
+++ b/asterix-app/src/test/resources/fuzzyjoin/users-visitors/090-join-op-interests.aql
@@ -17,9 +17,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 declare dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 write output to nc1:'/tmp/users-visitors.adm';
 
diff --git a/asterix-app/src/test/resources/integration/queries/dataset-scan.aql b/asterix-app/src/test/resources/integration/queries/dataset-scan.aql
index 1930be2..f7558c5 100644
--- a/asterix-app/src/test/resources/integration/queries/dataset-scan.aql
+++ b/asterix-app/src/test/resources/integration/queries/dataset-scan.aql
@@ -20,7 +20,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 for $c in dataset('Customers')
 return $c
diff --git a/asterix-app/src/test/resources/integration/updates/load-dataset.aql b/asterix-app/src/test/resources/integration/updates/load-dataset.aql
index c6faa6e..4041450 100644
--- a/asterix-app/src/test/resources/integration/updates/load-dataset.aql
+++ b/asterix-app/src/test/resources/integration/updates/load-dataset.aql
@@ -15,7 +15,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql b/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql
index af15a23..87aa2fc 100644
--- a/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql
+++ b/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql
@@ -44,10 +44,10 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType)
-  partitioned by key cid, name on group1;
+  primary key cid, name on group1;
 
 create dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 create index ordCustId on Orders(cid);
 
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql
index 047eddf..b5c3c28 100644
--- a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql
@@ -1,4 +1,4 @@
 use dataverse custord;
 
 create dataset Customers(CustomerType)
-  partitioned by key cid, name on group1;
+  primary key cid, name on group1;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql
index aa76ae2..a9ad490 100644
--- a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql
@@ -2,7 +2,7 @@
 
 // Creating this dataset should succeed.
 create dataset NewDataset(CustomerType)
-  partitioned by key cid, name on group1;
+  primary key cid, name on group1;
 
 
 // Creating this duplicate type should fail, and rollback should remove the new dataverse.
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1.aql
index f7bad20..de0e870 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_1.aql
@@ -17,7 +17,7 @@
 write output to nc1:"mdtest/basic_issue_251_dataset_hint_1.adm";
 
 create dataset Book(LineType)
-partitioned by key id
+primary key id
 hints(  cardinality  =   2000);
 
 for $x in dataset('Metadata.Dataset')
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2.aql
index 9377ea5..27d2c2c 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_2.aql
@@ -17,7 +17,7 @@
 write output to nc1:"mdtest/basic_issue_251_dataset_hint_2.adm";
 
 create dataset Book(LineType)
-partitioned by key id
+primary key id
 hints(cardinality=2000);
 
 for $x in dataset('Metadata.Dataset')
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3.aql
index 15f45a7..b6a730f 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_3.aql
@@ -17,7 +17,7 @@
 write output to nc1:"mdtest/basic_issue_251_dataset_hint_3.adm";
 
 create dataset Book(LineType)
-partitioned by key id
+primary key id
 hints(CARDINALITY=2000);
 
 for $x in dataset('Metadata.Dataset')
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4.aql
index c5d30e5..af7077a 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_251_dataset_hint_4.aql
@@ -17,7 +17,7 @@
 write output to nc1:"mdtest/basic_issue_251_dataset_hint_4.adm";
 
 create dataset Book(LineType)
-partitioned by key id;
+primary key id;
 
 for $x in dataset('Metadata.Dataset')
 where $x.DataverseName='test'
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
index 8bfc240..7778e99 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
@@ -13,7 +13,7 @@
 id : int32
 }
 
-create dataset testdv.dst01(testtype) partitioned by key id;
+create dataset testdv.dst01(testtype) primary key id;
 
 for $l in dataset('Metadata.Dataset')
 where $l.DataverseName = 'testdv' and $l.DatasetName = 'dst01'
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
index 9eb129d..201ab6e 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
@@ -14,7 +14,7 @@
 name : string
 }
 
-create dataset testdv.t1(testtype) partitioned by key id;
+create dataset testdv.t1(testtype) primary key id;
 
 create index idx1 on testdv.t1(name);
 
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
index 28a3794..56c6c7a 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
@@ -13,7 +13,7 @@
 id:int32
 }
 
-create dataset test.t1(testtype) partitioned by key id;
+create dataset test.t1(testtype) primary key id;
 
 insert into dataset test.t1({"id":123});
 insert into dataset test.t1({"id":133});
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
index d781114..0e02802 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
@@ -13,7 +13,7 @@
 id : int32
 }
 
-create dataset test.dst01(testtype) partitioned by key id;
+create dataset test.dst01(testtype) primary key id;
 
 drop dataset test.dst01;
 
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
index 1de7ac5..82e2eb0 100644
--- a/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
@@ -14,7 +14,7 @@
 name : string
 }
 
-create dataset test.dst01(testtype) partitioned by key id;
+create dataset test.dst01(testtype) primary key id;
 
 create index idx1 on test.dst01(name);
 
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql
index 9f849e3..eb3f3dc 100644
--- a/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_1.aql
@@ -15,5 +15,5 @@
 }
 
 create dataset Book(LineType)
-partitioned by key id
+primary key id
 hints(size=2000,tuple_size=100);
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql b/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql
index 459b7f6..830370e 100644
--- a/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql
+++ b/asterix-app/src/test/resources/metadata/queries/exception/issue_251_dataset_hint_error_2.aql
@@ -16,7 +16,7 @@
 }
 
 create dataset Book(LineType)
-partitioned by key id
+primary key id
 hints(cardinality="-20jh0",size=45);
 
 for $x in dataset('Metadata.Dataset')
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql b/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
index d4678f2..19b87a2 100644
--- a/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
@@ -37,7 +37,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType)
-  partitioned by key cid, name on group1;
+  primary key cid, name on group1;
 
 create nodegroup group1 on nc1, nc2;
 
diff --git a/asterix-app/src/test/resources/misc/split01.aql b/asterix-app/src/test/resources/misc/split01.aql
index 46b2403..de9ec5c 100644
--- a/asterix-app/src/test/resources/misc/split01.aql
+++ b/asterix-app/src/test/resources/misc/split01.aql
@@ -30,9 +30,9 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/split01.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/all-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/all-drop.aql
index 13a0414..0672b32 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/all-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/all-drop.aql
@@ -36,6 +36,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset All(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset All;
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/all-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/all-load.aql
index 73fa096..745562d 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/all-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/all-load.aql
@@ -36,7 +36,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset All(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset All from nc1:"/home/yasser/Dropbox/Research/data/allData.json";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/all-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/all-scan.aql
index 7006eb4..1bd4b73 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/all-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/all-scan.aql
@@ -36,7 +36,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset All(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_all_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/cust-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/cust-drop.aql
index b6a1913..23aeea8 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/cust-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/cust-drop.aql
@@ -23,6 +23,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 drop dataset Customers;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/cust-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/cust-load.aql
index fb57584..4af623a 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/cust-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/cust-load.aql
@@ -17,7 +17,7 @@
 declare nodegroup group1 on nc1;
 
 declare dataset Dataverse(DataverseType)
-  partitioned by key dataverseName on group1;        
+  primary key dataverseName on group1;        
       
 for $c in dataset('Dataverse')
 return $c
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/cust-q1.aql b/asterix-app/src/test/resources/nontagged/custord/local/cust-q1.aql
index bc7ac1f..bc1c623 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/cust-q1.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/cust-q1.aql
@@ -23,7 +23,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_cust_q1.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/cust-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/cust-scan.aql
index a54197f..cf8aacf 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/cust-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/cust-scan.aql
@@ -23,7 +23,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_cust_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/emp-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/emp-drop.aql
index 22230c1..0499a72 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/emp-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/emp-drop.aql
@@ -24,6 +24,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Emp(EmpType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 drop dataset Emp;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/emp-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/emp-load.aql
index c0cbfc3..e676ef6 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/emp-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/emp-load.aql
@@ -20,6 +20,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Emp(EmpType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Emp from nc1:"/home/yasser/Dropbox/Research/data/EmpData.json";
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/emp-q1.aql b/asterix-app/src/test/resources/nontagged/custord/local/emp-q1.aql
index 20b83f7..ef8ce90 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/emp-q1.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/emp-q1.aql
@@ -19,7 +19,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Emp(EmpType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_emp_q1.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/emp-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/emp-scan.aql
index df903bf..e69b361 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/emp-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/emp-scan.aql
@@ -20,7 +20,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Emp(EmpType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_emp_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/join-01.aql b/asterix-app/src/test/resources/nontagged/custord/local/join-01.aql
index d5a32f5..587fa4d 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/join-01.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/join-01.aql
@@ -34,9 +34,9 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_join_1.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/join-02.aql b/asterix-app/src/test/resources/nontagged/custord/local/join-02.aql
index 9b5caf1..ffcc6a0 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/join-02.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/join-02.aql
@@ -34,9 +34,9 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_join_2.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/join-03.aql b/asterix-app/src/test/resources/nontagged/custord/local/join-03.aql
index bff863c..a953d76 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/join-03.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/join-03.aql
@@ -34,9 +34,9 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_join_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/numeric-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/numeric-drop.aql
index b82bf84..a576214 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/numeric-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/numeric-drop.aql
@@ -15,6 +15,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Numeric(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
   
 drop dataset Numeric;
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/numeric-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/numeric-load.aql
index 5a7f162..491b391 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/numeric-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/numeric-load.aql
@@ -16,7 +16,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Numeric(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset Numeric from nc1:"/home/yasser/Dropbox/Research/data/numericData.json";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/numeric-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/numeric-scan.aql
index ec60095..c5bdb34 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/numeric-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/numeric-scan.aql
@@ -15,7 +15,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Numeric(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_numeric_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/ord-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/ord-drop.aql
index fd68e70..d4fa668 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/ord-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/ord-drop.aql
@@ -15,6 +15,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 drop dataset Orders;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/ord-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/ord-load.aql
index fe1d61d..81d25bc 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/ord-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/ord-load.aql
@@ -15,6 +15,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 load dataset Orders from nc1:"/home/yasser/Dropbox/Research/data/orderData.json";
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/ord-q1.aql b/asterix-app/src/test/resources/nontagged/custord/local/ord-q1.aql
index 97aa315..d008979 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/ord-q1.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/ord-q1.aql
@@ -15,7 +15,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_ord_q1.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/ord-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/ord-scan.aql
index e7c5236..9fc0faf 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/ord-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/ord-scan.aql
@@ -15,7 +15,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_ord_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/spatial-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/spatial-drop.aql
index 5e7b515..304ec7c 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/spatial-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/spatial-drop.aql
@@ -14,6 +14,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Spatial(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset Spatial;
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/spatial-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/spatial-load.aql
index b36808a..a0e7bae 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/spatial-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/spatial-load.aql
@@ -14,7 +14,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Spatial(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset Spatial from nc1:"/home/yasser/Dropbox/Research/data/spatialData.json";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/spatial-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/spatial-scan.aql
index e4faa16..5027c29 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/spatial-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/spatial-scan.aql
@@ -16,7 +16,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Spatial(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_spatial_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/temp-drop.aql b/asterix-app/src/test/resources/nontagged/custord/local/temp-drop.aql
index 80a86ac..df7e293 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/temp-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/temp-drop.aql
@@ -13,6 +13,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Temp(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset Temp;
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/temp-load.aql b/asterix-app/src/test/resources/nontagged/custord/local/temp-load.aql
index 0400db1..d75168a 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/temp-load.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/temp-load.aql
@@ -14,7 +14,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Temp(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset Temp from nc1:"/home/yasser/Dropbox/Research/data/tempData.json";
 
diff --git a/asterix-app/src/test/resources/nontagged/custord/local/temp-scan.aql b/asterix-app/src/test/resources/nontagged/custord/local/temp-scan.aql
index 8dc3cfa..7a369e6 100644
--- a/asterix-app/src/test/resources/nontagged/custord/local/temp-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/custord/local/temp-scan.aql
@@ -14,7 +14,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset Temp(ExampleType)
-  partitioned by key id on group1;
+  primary key id on group1;
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_temp_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/alltables-loadAsOpen.aql b/asterix-app/src/test/resources/nontagged/tpch/local/alltables-loadAsOpen.aql
index 7847546..0c4a5b3 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/alltables-loadAsOpen.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/alltables-loadAsOpen.aql
@@ -39,21 +39,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 //load dataset LineItems from nc1:"/home/yasser/Dropbox/Research/data/tpch_data/alldata/jsonformat/lineitem.json" pre-sorted;
 //load dataset Orders from nc1:"/home/yasser/Dropbox/Research/data/tpch_data/alldata/jsonformat/orders.json" pre-sorted;
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/alltablesAsopen-scan.aql b/asterix-app/src/test/resources/nontagged/tpch/local/alltablesAsopen-scan.aql
index cd32ae0..c147235 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/alltablesAsopen-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/alltablesAsopen-scan.aql
@@ -79,21 +79,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 write output to nc1:"/home/yasser/Desktop/result_scan.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-drop.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-drop.aql
index e8c56c1..a30757c 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-drop.aql
@@ -90,21 +90,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 drop dataset LineItems;
 //drop dataset Orders;
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-load.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-load.aql
index 9e05370..0bd1a39 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-load.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-load.aql
@@ -90,21 +90,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 //load dataset LineItems from nc1:"/home/yasser/Dropbox/Research/data/tpch_data/alldata/jsonformat/lineitem.json" pre-sorted;
 //load dataset Orders from nc1:"/home/yasser/Dropbox/Research/data/tpch_data/alldata/jsonformat/orders.json" pre-sorted;
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q1.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q1.aql
index 441ac43..f08d390 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q1.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q1.aql
@@ -24,7 +24,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_closed_1.adm";
  
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q3.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q3.aql
index e002ad9..6933881 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q3.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q3.aql
@@ -47,11 +47,11 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_closed_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q5.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q5.aql
index ceca8cd..d605099 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q5.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q5.aql
@@ -70,17 +70,17 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_closed_5.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q9.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q9.aql
index 2586561..acf2ae3 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q9.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-q9.aql
@@ -74,17 +74,17 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_closed_9.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-scan.aql b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-scan.aql
index f4f50b1..4b97d2e 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-scan.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/closedtables-scan.aql
@@ -90,21 +90,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 write output to nc1:"/home/yasser/Desktop/result_scan.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-drop.aql b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-drop.aql
index 06d352c..61b6d85 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-drop.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-drop.aql
@@ -39,21 +39,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 drop dataset LineItems;
 //drop dataset Orders;
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-load.aql b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-load.aql
index 4241366..fdcf15c 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-load.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-load.aql
@@ -39,21 +39,21 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 //load dataset LineItems from nc1:"/home/yasser/Dropbox/Research/data/tpch_data/alldata/jsonformat/lineitem.json" pre-sorted;
 //load dataset Orders from nc1:"/home/yasser/Dropbox/Research/data/tpch_data/alldata/jsonformat/orders.json" pre-sorted;
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q1.aql b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q1.aql
index ec5e202..6288b4f 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q1.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q1.aql
@@ -10,7 +10,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_open_1.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q3.aql b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q3.aql
index 921cea6..955eba7 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q3.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q3.aql
@@ -18,11 +18,11 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_open_3.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q5.aql b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q5.aql
index 82c996f..ffbd71d 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q5.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q5.aql
@@ -30,17 +30,17 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_open_5.adm";
 
diff --git a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q9.aql b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q9.aql
index 75b176d..8064099 100644
--- a/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q9.aql
+++ b/asterix-app/src/test/resources/nontagged/tpch/local/opentables-q9.aql
@@ -39,17 +39,17 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
   
 write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_tpch_closed_9.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql
index 9b83718..f235220 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-multipred.aql
@@ -37,8 +37,8 @@
   total: float
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset Orders(OrderType) partitioned by key oid;
+create dataset Customers(CustomerType) primary key cid;
+create dataset Orders(OrderType) primary key oid;
 
 write output to nc1:"rttest/btree-index-join_primary-equi-join-multipred.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_01.aql
index 75c522b..8e8324f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_01.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_02.aql
index 4dd0d00..8a62332 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join-neg_02.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
index a0877ba..6950747 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_01.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is a HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
index 59db20b..b7832fd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_02.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is a HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
index d60a8ac..9268c2c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_03.aql
@@ -35,8 +35,8 @@
   total: float
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset Orders(OrderType) partitioned by key oid;
+create dataset Customers(CustomerType) primary key cid;
+create dataset Orders(OrderType) primary key oid;
 
 write output to nc1:"rttest/btree-index-join_primary-equi-join_04.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql
index 56211e8..3c07154 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_04.aql
@@ -35,8 +35,8 @@
   total: float
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset Orders(OrderType) partitioned by key oid;
+create dataset Customers(CustomerType) primary key cid;
+create dataset Orders(OrderType) primary key oid;
 
 write output to nc1:"rttest/btree-index-join_primary-equi-join_05.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql
index 0e6efe8..7da6b0c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-equi-join_05.aql
@@ -26,7 +26,7 @@
   }
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 write output to nc1:"rttest/btree-index-join_primary-equi-join_06.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql
index 559ede2..8bc306c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_01.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql
index 4948b6f..06be0e9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-ge-join_02.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql
index f48cfa3..67d75a1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_01.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql
index b2f67b3..a7be083 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-gt-join_02.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql
index ef4dc05..66f2ace 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_01.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql
index 4c62ebb..39c1d51 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-le-join_02.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql
index 79e24cb..ef6a616 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_01.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql
index 9709acd..4924514 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/primary-lt-join_02.aql
@@ -15,8 +15,8 @@
           lname : string
 }
 
-create dataset test1.DsOne(TestType) partitioned by key key1;
-create dataset test1.DsTwo(TestType) partitioned by key key1;
+create dataset test1.DsOne(TestType) primary key key1;
+create dataset test1.DsTwo(TestType) primary key key1;
 
 // Please note content enclosed in the comment in the predicate is the HINT to the optimizer
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql
index 44cdef8..c596984 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multiindex.aql
@@ -39,10 +39,10 @@
 } 
 
 create dataset FacebookUsers(FacebookUserType)
-partitioned by key id;
+primary key id;
 
 create dataset FacebookMessages(FacebookMessageType)
-partitioned by key message-id;
+primary key message-id;
 
 create index fbmIdxAutId if not exists on FacebookMessages(author-id-copy);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql
index 03cbf24..bb803b0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join-multipred.aql
@@ -27,9 +27,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index title_index on DBLP(title);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql
index e07eee5..8a4f056 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_01.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index title_index on DBLP(title);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql
index 2546244..fa68cd2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_02.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index title_index on CSX(title);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql
index 251c88e..3eedafd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index-join/secondary-equi-join_03.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index title_index on DBLP(title);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql
index d3d8d69..0d096a7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-01.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset with primary index (composite key) defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Roger"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql
index eeded38..fbcdd50 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-02.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset with primary index defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname >= "Susan"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql
index 1046edd..2047b62 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-03.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset with primary index defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname < "Isa"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql
index 2bee1fe..84147ae 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-04.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset with primary index defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname <= "Vanpatten"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql
index 0423290..0fbf179 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-05.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset with primary index defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname != "Max"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql
index 313a4fa..08164fd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-06.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset with primary index defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname = "Julio"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql
index e9063eb..2b635a5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-07.aql
@@ -20,7 +20,7 @@
 }
 
 // create internal dataset with primary index defined on fname,lname fields
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.lname = "Kim"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql
index 9919457..337072e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-08.aql
@@ -15,7 +15,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname = "Young Seok" and $emp.lname = "Kim"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql
index 8973d2d..cc52d2a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-09.aql
@@ -19,7 +19,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname = "Julio" or $emp.lname = "Malaika"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql
index 5076e97..4d0f85e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-10.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Alex" and $emp.lname < "Zach"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql
index feeaaad..164e49a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-11.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Allan" and $emp.lname < "Zubi"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql
index 740cca6..659d1ff 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-12.aql
@@ -19,7 +19,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Allan" and $emp.lname = "Xu"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql
index 47e81b2..3c49200 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-13.aql
@@ -19,7 +19,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname = "Julio" and $emp.lname < "Xu"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql
index 0ec31aa..e93061f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-14.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname >= "Michael" and $emp.lname <= "Xu"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql
index f595804..97a486a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-15.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql
index 022bd50..cf80ed2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-16.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql
index ad114cd..db9c994 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-17.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname <= "Craig" and $emp.lname > "Kevin"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql
index 43b0bd3..9787005 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-18.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname != "Michael" and $emp.lname != "Carey"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql
index fe2dc41..0dff6af 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-19.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Craig" and $emp.lname > "Kevin" and $emp.fname <= "Mary" and $emp.lname <= "Tomes"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql
index c817492..ac9e374 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-20.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname,lname;
+create dataset testdst(TestType) primary key fname,lname;
 
 for $emp in dataset('testdst') 
 where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql
index 46c107c..afa241f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-21.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname;
+create dataset testdst(TestType) primary key fname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Max" 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql
index 0f74980..4af86a0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-22.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname;
+create dataset testdst(TestType) primary key fname;
 
 for $emp in dataset('testdst') 
 where $emp.fname >= "Sofia" 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql
index c942165..f73bd1f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-23.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname;
+create dataset testdst(TestType) primary key fname;
 
 for $emp in dataset('testdst') 
 where $emp.fname < "Chen" 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql
index 0c66008..1faa37e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-24.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname;
+create dataset testdst(TestType) primary key fname;
 
 for $emp in dataset('testdst') 
 where $emp.fname <= "Julio" 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql
index 770baf5..6b24b7c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-25.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname;
+create dataset testdst(TestType) primary key fname;
 
 for $emp in dataset('testdst') 
 where $emp.fname > "Neil" and $emp.fname < "Roger" 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql
index ba5de37..05a69d2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-primary-26.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key fname;
+create dataset testdst(TestType) primary key fname;
 
 for $emp in dataset('testdst') 
 where $emp.fname >= "Max" and $emp.fname <= "Roger" 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql
index 5117da4..c2e6257 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-31.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql
index 37b46b3..d009e2e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-32.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql
index 8f1b4d5..2b364e4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-33.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql
index 5042bd9..f20b5a9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-34.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql
index 2e38330..dfc5017 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-35.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql
index 84bdcd4..7d72623 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-36.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql
index 73133c2..7c155ce 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-37.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql
index 3f844ee..dc63f05 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-38.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql
index 3813e48..a9d32c3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-39.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql
index 4e13597..25c6dec 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-40.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql
index c724cbe..bc65009 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-41.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql
index 06c93b0..289d1b4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-42.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql
index 490becb..86e5d67 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-43.aql
@@ -20,7 +20,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql
index f75f3de..54e149e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-44.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql
index 6717780..cc33e5a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-45.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql
index 8a508b3..f486e44 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-46.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql
index 70e8185..5d06a51 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-47.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql
index bb6f24d..2dc1ab4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-48.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql
index 6d11235..6175ba6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-49.aql
@@ -19,7 +19,7 @@
 }
 
 // create internal dataset
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql
index 3a91c09..04aefc3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-50.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql
index 3be3875..5ae63a9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-51.aql
@@ -18,7 +18,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname,lname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql
index 7b52ec9..e720742 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-52.aql
@@ -17,7 +17,7 @@
     lname : string
 }
  
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql
index 45536b5..65a9b6d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-53.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql
index f1a3cb5..a18975a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-54.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql
index bbeca00..94c1463 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-55.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql
index 7ecfea9..53f8ca4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-56.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql
index 2183f69..43cf54d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-57.aql
@@ -17,7 +17,7 @@
     lname : string
 }
 
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql
index bdf16b6..aa18136 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/btree-index/btree-secondary-58.aql
@@ -17,7 +17,7 @@
     lname : string
 }
  
-create dataset testdst(TestType) partitioned by key id;
+create dataset testdst(TestType) primary key id;
 
 create index sec_Idx on testdst(fname);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/cell-aggregation-with-filtering.aql b/asterix-app/src/test/resources/optimizerts/queries/cell-aggregation-with-filtering.aql
index a328a1b..c883645 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/cell-aggregation-with-filtering.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/cell-aggregation-with-filtering.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if exists on nc1, nc2;
 
 create dataset TwitterData(Tweet)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 
 load dataset TwitterData 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-complex.aql b/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-complex.aql
index 313e9a4..7dfe817 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-complex.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-complex.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-simple.aql b/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-simple.aql
index 8a237d2..d21fa6e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-simple.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/consolidate-selects-simple.aql
@@ -16,7 +16,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"rttest/consolidate-selects-simple.aql";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/cust_group_no_agg.aql b/asterix-app/src/test/resources/optimizerts/queries/cust_group_no_agg.aql
index 6fdae88..6a86b8a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/cust_group_no_agg.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/cust_group_no_agg.aql
@@ -18,7 +18,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/tmp/.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/denorm-cust-order.aql b/asterix-app/src/test/resources/optimizerts/queries/denorm-cust-order.aql
index acad4a1..389dad5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/denorm-cust-order.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/denorm-cust-order.aql
@@ -36,9 +36,9 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 create dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/custorder.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/distinct_aggregate.aql b/asterix-app/src/test/resources/optimizerts/queries/distinct_aggregate.aql
index a4784c1..6fc1dac 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/distinct_aggregate.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/distinct_aggregate.aql
@@ -24,7 +24,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems_q1(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 
 write output to nc1:"rttest/tpch_q1_pricing_summary_report_nt.adm";
  
diff --git a/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql b/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql
index 2898058..f748eae 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql
@@ -22,8 +22,8 @@
 
 create nodegroup group1 if not exists on nc1, nc2;
 
-create dataset DBLP(DBLPType) partitioned by key id on group1;
-create dataset CSX(CSXType) partitioned by key id on group1;
+create dataset DBLP(DBLPType) primary key id on group1;
+create dataset CSX(CSXType) primary key id on group1;
 
 write output to nc1:'rttest/fj-dblp-csx.adm';
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/fj-phase1.aql b/asterix-app/src/test/resources/optimizerts/queries/fj-phase1.aql
index 778232a..19ceda0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/fj-phase1.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/fj-phase1.aql
@@ -19,10 +19,10 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 
 create dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 
 // set simfunction "jaccard";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql b/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql
index 866c027..a0973f4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql
@@ -15,7 +15,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP_fuzzyjoin_078(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 write output to nc1:'rttest/fuzzyjoin_078.adm';
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inlined_q18_large_volume_customer.aql b/asterix-app/src/test/resources/optimizerts/queries/inlined_q18_large_volume_customer.aql
index 49c4157..0db7a51 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inlined_q18_large_volume_customer.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inlined_q18_large_volume_customer.aql
@@ -49,11 +49,11 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/tmp/inlined_q18_large_volume_customer.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/introhashpartitionmerge.aql b/asterix-app/src/test/resources/optimizerts/queries/introhashpartitionmerge.aql
index 9427ab5..cd1d78c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/introhashpartitionmerge.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/introhashpartitionmerge.aql
@@ -9,7 +9,7 @@
 
 create nodegroup group1 if not exists on nc1, nc2;
 
-create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) partitioned by key rank on group1;
+create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) primary key rank on group1;
 
 write output to nc1:'rttest/introhashpartitionmerge.adm';
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql
index 31c0d03..d193238 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains-panic.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql
index 9851cd8..137b1c7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-contains.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql
index 4608aeb..6f7f38c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check-panic.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql
index 7b264b7..0d9db19 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-check.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql
index 9412cf3..7decdb5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance-panic.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql
index d6be7d4..c7a9ba4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-edit-distance.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
index b241311..3a3d7bb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-edit-distance.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
index 33f9d5a..5e9ac0e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-fuzzyeq-jaccard.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql
index 376415f..dbb9c71 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard-check.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql
index ef7143a..f25fb8b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ngram-jaccard.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql
index 8209572..c105eab 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check-panic.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql
index b55a516..b12037d1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-check.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql
index 63bead1..84bcbb9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance-panic.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql
index 7958fb4..afafa37 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-edit-distance.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql
index f156bd2..86b6474 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-edit-distance.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql
index 6632189..64812db 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-fuzzyeq-jaccard.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql
index 61dcc7f..4f8b8fe 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard-check.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql
index 7af2161..62d6806 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/olist-jaccard.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
index d65a517..4ac02c8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-fuzzyeq-jaccard.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
index 9551294..80e8aef 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard-check.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
index 6580bd0..588ca14 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/ulist-jaccard.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql
index eee681a..8d9cb02 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-contains.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql
index fb6d0e8..006398e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-fuzzyeq-jaccard.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql
index 10ca5ce..4c814e4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard-check.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql
index 7f544b6..53a5bbb 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-basic/word-jaccard.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
index 4d6bfd9..1c96adc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_01.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
index a4d4163..e80443e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic-nopanic_02.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
index d6f58fc..d0d3035 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let-panic.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql
index 24d3202..2d2f34f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-edit-distance-check-let.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql
index de57848..fb59040 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-let.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql
index 2eed598..b86c6b2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ngram-jaccard-check-multi-let.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql
index 337eced..aa9bc59 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let-panic.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql
index c3be0bd..8a78450 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-edit-distance-check-let.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql
index 0652131..48ec727 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/olist-jaccard-check-let.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql
index 5a3b329..0757d41 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/ulist-jaccard-check-let.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql
index 2c45ea8..ec97668 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-let.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql
index 8f8f014..bf1821e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-complex/word-jaccard-check-multi-let.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
index 78a285a..ee768d7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
index b05c0d1..ca2827d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql
index 87ebe4a..0e15708 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-edit-distance.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql
index 77aa691..1a97936 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-fuzzyeq-jaccard.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
index 9f6e66c..bf6bb82 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
index 1979201..dae2a78 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
index 25cdc53..21114fc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
@@ -25,7 +25,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
index e5dec4f..b90b4f7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql
index ae24f13..c78f65c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-edit-distance.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql
index f7df554..3bbcc28 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-fuzzyeq-jaccard.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
index 61816b8..7dca72a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
@@ -25,7 +25,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
index d16776a..79d8baf 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql
index 0d4872b..0efb32d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-fuzzyeq-jaccard.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
index c89fdc3..2bca24d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
@@ -25,7 +25,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
index 72d0341..8805542 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql
index 99a3c79..2d2e0cc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-fuzzyeq-jaccard.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
index 24c66ac..0d5bf9c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql
index ef91b89..5ffa92e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join-noeqjoin/word-jaccard.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql
index f9cc7e9..d24ee17 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql
index 011afea..ec553a0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql
index 649c3b6..4de1680 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql
index e6a3c56..091676f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance-check_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql
index a94e84f..8a0282c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql
index 61edf5c..5d026db 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql
index 6c61de1..11b39c5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql
index 5925f47..b8952e9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-edit-distance_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
index f6dd893..4704213 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
index d9822aa..8454be9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
index 0431a6c..4187d8f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-edit-distance_03.aql
@@ -15,7 +15,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(authors) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
index 933e5d0..84fb8f3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
index 1213935..d0c3c6f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
index 70c7640..a725edc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-fuzzyeq-jaccard_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql
index 4d7939a..c25e2e3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql
index e0acebb..0e9f4d5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql
index 808965d..bbd0f51 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql
index e66cdc5..956f712 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard-check_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql
index a28a6af..742cb69 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql
index a4ff58d..a620399 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index ngram_index on CSX(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql
index 1a90cf9..d12bf98 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql
index 7be6773..6b308c8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ngram-jaccard_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index ngram_index on DBLP(title) type ngram(3);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql
index 84d2f45..1afe025 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql
index b0ec650..aec4c85 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql
index 03a1a3f..47cea17 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql
index e7814af..9abc4e8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance-check_04.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql
index ac25ac2..b8f6144 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql
index a160c4d..7b17749 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql
index dba92b9..7132950 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql
index 4835727..84c7d5b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-edit-distance_04.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql
index 1dddf5e..c84bd28 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql
index 15b1001..c6b9d9c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql
index af4814f..962f05c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-edit-distance_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql
index 2b46707..4b3793a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql
index 4f188dd..60cdb07 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql
index 05cf635..2df41b5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-fuzzyeq-jaccard_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql
index 60fc705..8968ec6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql
index 9cdb78b..96b8622 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql
index b1c4d68..e8763b4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql
index a1e1478..3194e47 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard-check_04.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql
index cabdac1..1c4c7c2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql
index 49a7411..212b64b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql
index 639d782..22b4108 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql
index c3e34b0..32e8a6c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/olist-jaccard_04.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql
index c19ce47..cd391a4 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql
index 6e3a274..a7d7118 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql
index 396af09..a5ec440 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-fuzzyeq-jaccard_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql
index 8792dd2..dead8cc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql
index 185df97..b18abf8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql
index 4d2b2e7..5afd428 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql
index acf4d71..3c8bdd7 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard-check_04.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql
index 0d5ad31..2001a2a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_01.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql
index 8ac631e..95ce2ad 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_02.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 create index interests_index on Customers2(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql
index 94aedbb..e4fc27f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_03.aql
@@ -23,7 +23,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql
index e30fbcf..6356f79 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/ulist-jaccard_04.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
 create index interests_index on Customers(interests) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql
index 8438509..ff39969 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql
index 6f6c5f6..f693855 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on CSX(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql
index 3f3a247..72f9bdc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-fuzzyeq-jaccard_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql
index 14f63bf..2a076bc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql
index 46932be..98b3972 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on CSX(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql
index 77ac9ba..dace174 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql
index 6129c52..fa68be2 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard-check_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql
index 47d1192..df0b75e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_01.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql
index ac33cb0..1f227c8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_02.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 create index keyword_index on CSX(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql
index 128e500..7a719ff 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_03.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql
index 325f955..077803b 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/inverted-index-join/word-jaccard_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 create index keyword_index on DBLP(title) type keyword;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/join-super-key_01.aql b/asterix-app/src/test/resources/optimizerts/queries/join-super-key_01.aql
index f0251ad..52b35b8 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/join-super-key_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/join-super-key_01.aql
@@ -66,9 +66,9 @@
 write output to nc1:"/tmp/join-super-key_01.adm";
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_partkey, l_linenumber on group1;
+  primary key l_partkey, l_linenumber on group1;
 create dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 for $li in dataset('LineItems')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/join-super-key_02.aql b/asterix-app/src/test/resources/optimizerts/queries/join-super-key_02.aql
index 0904f37..98f7e9e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/join-super-key_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/join-super-key_02.aql
@@ -66,9 +66,9 @@
 write output to nc1:"/tmp/join-super-key_01.adm";
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_partkey, l_linenumber on group1;
+  primary key l_partkey, l_linenumber on group1;
 create dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 for $ps in dataset('PartSupp')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_01.aql b/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_01.aql
index 1f43f73..4855576 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_01.aql
@@ -66,9 +66,9 @@
 write output to nc1:"/tmp/loj-super-key_01.adm";
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_partkey, l_linenumber on group1;
+  primary key l_partkey, l_linenumber on group1;
 create dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 for $li in dataset('LineItems')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_02.aql b/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_02.aql
index ceab193..ce937c5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/loj-super-key_02.aql
@@ -66,9 +66,9 @@
 write output to nc1:"/tmp/loj-super-key_01.adm";
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_partkey, l_linenumber on group1;
+  primary key l_partkey, l_linenumber on group1;
 create dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 for $ps in dataset('PartSupp')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/nested_loj2.aql b/asterix-app/src/test/resources/optimizerts/queries/nested_loj2.aql
index 0b77f55..d235b09 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/nested_loj2.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/nested_loj2.aql
@@ -47,11 +47,11 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/tmp/nested_loj.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/nested_loj3.aql b/asterix-app/src/test/resources/optimizerts/queries/nested_loj3.aql
index 3a1ef04..1616a67 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/nested_loj3.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/nested_loj3.aql
@@ -57,13 +57,13 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 create dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 write output to nc1:"/tmp/nested_loj.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/noncollocated.aql b/asterix-app/src/test/resources/optimizerts/queries/noncollocated.aql
index 3aa1855..26b5ab0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/noncollocated.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/noncollocated.aql
@@ -21,10 +21,10 @@
 create nodegroup group2 if not exists on nc2;
 
 create dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 
 create dataset Visitors(VisitorType) 
-  partitioned by key vid on group2;
+  primary key vid on group2;
 
 
 write output to nc1:"/tmp/fuzzy1.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orderby-desc-using-gby.aql b/asterix-app/src/test/resources/optimizerts/queries/orderby-desc-using-gby.aql
index 682800c..8cef009 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orderby-desc-using-gby.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orderby-desc-using-gby.aql
@@ -24,7 +24,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
   
 write output to nc1:"rttest/gby-using-orderby-desc.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-aggreg.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-aggreg.aql
index c2f96f6..960a8e6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-aggreg.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-aggreg.aql
@@ -16,7 +16,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key oid on group1;
+  primary key oid on group1;
 
 write output to nc1:"/tmp/orders-aggreg.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql
index d82be3c..73ec062 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-composite-index-search.aql
@@ -14,7 +14,7 @@
   o_comment: string
 }
 
-create dataset Orders(OrderType) partitioned by key o_orderkey;
+create dataset Orders(OrderType) primary key o_orderkey;
 
 create index idx_Custkey_Orderstatus on Orders(o_custkey, o_orderstatus);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql
index 150e962..b5aa50d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_01.aql
@@ -19,7 +19,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_02.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_02.aql
index 725da3a..daef719 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive-open_02.aql
@@ -19,7 +19,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql
index 0a42fa6..21a7f5a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_01.aql
@@ -19,7 +19,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_02.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_02.aql
index fed390c..25a6d3f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-conjunctive_02.aql
@@ -19,7 +19,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-open.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-open.aql
index a6bfa42..31d41b6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-open.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search-open.aql
@@ -20,7 +20,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 create index idx_Orders_Custkey on Orders(o_custkey);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search.aql b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search.aql
index 75be90b..4e01059 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/orders-index-search.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/orders-index-search.aql
@@ -20,7 +20,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 create index idx_Orders_Custkey on Orders(o_custkey);
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search-open.aql b/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search-open.aql
index 09a1ef6..1f6f887 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search-open.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search-open.aql
@@ -21,7 +21,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 
 write output to nc1:"/tmp/prim_index_search.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search.aql b/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search.aql
index 7a22597..7939fed 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/prim-idx-search.aql
@@ -21,7 +21,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 
 write output to nc1:"/tmp/prim_index_search.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/pull_select_above_eq_join.aql b/asterix-app/src/test/resources/optimizerts/queries/pull_select_above_eq_join.aql
index dfc05ff..ee998cf 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/pull_select_above_eq_join.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/pull_select_above_eq_join.aql
@@ -21,10 +21,10 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Users(UserType) 
-  partitioned by key uid on group1;
+  primary key uid on group1;
 
 create dataset Visitors(VisitorType) 
-  partitioned by key vid on group1;
+  primary key vid on group1;
 
 
 write output to nc1:"/tmp/pull-select-above-eq-join.adm";
diff --git a/asterix-app/src/test/resources/optimizerts/queries/push-project-through-group.aql b/asterix-app/src/test/resources/optimizerts/queries/push-project-through-group.aql
index 5dd229b..3c0235c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/push-project-through-group.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/push-project-through-group.aql
@@ -15,7 +15,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 
 write output to nc1:'rttest/fuzzyjoin_080.adm';
diff --git a/asterix-app/src/test/resources/optimizerts/queries/push_limit.aql b/asterix-app/src/test/resources/optimizerts/queries/push_limit.aql
index a9c4fe7..0ffe2b0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/push_limit.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/push_limit.aql
@@ -16,7 +16,7 @@
 
 create nodegroup group1 if not exists on nc1, nc2;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 write output to nc1:"/tmp/push_limit.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/q1.aql b/asterix-app/src/test/resources/optimizerts/queries/q1.aql
index 8f62292..ced342d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/q1.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/q1.aql
@@ -27,7 +27,7 @@
 
 create nodegroup group1 if not exists on nc1, nc2;
 
-create dataset User(UserType) partitioned by key name on group1;
+create dataset User(UserType) primary key name on group1;
 
 write output to nc1:"/tmp/q1.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/q2.aql b/asterix-app/src/test/resources/optimizerts/queries/q2.aql
index 17b1f86..5fba695 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/q2.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/q2.aql
@@ -34,7 +34,7 @@
 
 create nodegroup group1 if not exists on nc1, nc2;
 
-create dataset Event(EventType) partitioned by key name on group1;
+create dataset Event(EventType) primary key name on group1;
 
 write output to nc1:"/tmp/q2.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/q3_shipping_priority.aql b/asterix-app/src/test/resources/optimizerts/queries/q3_shipping_priority.aql
index 89c6fd9..8e6bf6e6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/q3_shipping_priority.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/q3_shipping_priority.aql
@@ -49,11 +49,11 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/tmp/q3_shipping_priority.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/q5_local_supplier_volume.aql b/asterix-app/src/test/resources/optimizerts/queries/q5_local_supplier_volume.aql
index 6b5ccfa..670a392 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/q5_local_supplier_volume.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/q5_local_supplier_volume.aql
@@ -72,17 +72,17 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 create dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 create dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 create dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 create dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
   
 write output to nc1:"/tmp/q5_local_supplier.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql
index 207b5c9..e95be99 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_01.aql
@@ -20,8 +20,8 @@
   rec: rectangle
 }
 
-create dataset MyData1(MyRecord) partitioned by key id;
-create dataset MyData2(MyRecord) partitioned by key id;
+create dataset MyData1(MyRecord) primary key id;
+create dataset MyData2(MyRecord) primary key id;
 
 create index rtree_index on MyData1(point) type rtree;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql
index e70bedf..c0a8634 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_02.aql
@@ -20,8 +20,8 @@
   rec: rectangle
 }
 
-create dataset MyData1(MyRecord) partitioned by key id;
-create dataset MyData2(MyRecord) partitioned by key id;
+create dataset MyData1(MyRecord) primary key id;
+create dataset MyData2(MyRecord) primary key id;
 
 create index rtree_index on MyData2(point) type rtree;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql
index 85fc22b..6fb79f3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-index-join/spatial-intersect-point_03.aql
@@ -20,7 +20,7 @@
   rec: rectangle
 }
 
-create dataset MyData(MyRecord) partitioned by key id;
+create dataset MyData(MyRecord) primary key id;
 
 create index rtree_index on MyData(point) type rtree;
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql
index 14416c8..b4a5796 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index-open.aql
@@ -17,7 +17,7 @@
 create nodegroup group1  if not exists on nc1, nc2;
 
 create dataset MyData(MyRecord)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql
index c8525c1..41a5a91 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/rtree-secondary-index.aql
@@ -17,7 +17,7 @@
 create nodegroup group1  if not exists on nc1, nc2;
 
 create dataset MyData(MyRecord)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/scan-delete-all.aql b/asterix-app/src/test/resources/optimizerts/queries/scan-delete-all.aql
index d30b7f8..7b8215f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/scan-delete-all.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/scan-delete-all.aql
@@ -30,9 +30,9 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems_q1(LineItemType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 delete $l from dataset LineItems_q1;
diff --git a/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql
index 4d5de58..a307a1d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/scan-delete-rtree-secondary-index.aql
@@ -17,7 +17,7 @@
 create nodegroup group1  if not exists on nc1, nc2;
 
 create dataset MyData(MyRecord)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/optimizerts/queries/scan-delete.aql b/asterix-app/src/test/resources/optimizerts/queries/scan-delete.aql
index 9bf6a4c..57e1bd3 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/scan-delete.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/scan-delete.aql
@@ -31,9 +31,9 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems_q1(LineItemType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 delete $l from dataset LineItems_q1 where $l.l_shipdate <= '1998-09-02';
diff --git a/asterix-app/src/test/resources/optimizerts/queries/scan-insert-secondary-index.aql b/asterix-app/src/test/resources/optimizerts/queries/scan-insert-secondary-index.aql
index afecc04..97bc8df 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/scan-insert-secondary-index.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/scan-insert-secondary-index.aql
@@ -30,10 +30,10 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems_q1(LineItemType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
   
 create index idx_LineID_partkey on LineID(l_partkey);
 create index idx_LineID_suppkey on LineID(l_suppkey);
diff --git a/asterix-app/src/test/resources/optimizerts/queries/scan-insert.aql b/asterix-app/src/test/resources/optimizerts/queries/scan-insert.aql
index beb73a7..1c26a46 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/scan-insert.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/scan-insert.aql
@@ -30,10 +30,10 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset LineItems_q1(LineItemType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey on group1;
+  primary key l_orderkey on group1;
 
 insert into dataset LineID (
 for $l in dataset('LineItems_q1')
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql
index 96d3b1a..4d63c15 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_01.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql
index e0ef1aa..762b41c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_02.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_02.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql
index 75a584e..e14f329 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_03.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_03.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql
index 2f42ab0..f539938 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_04.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_04.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql
index 73f8ddb..b126f67 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_05.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_05.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql
index 221bfb8..f32285e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_06.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_06.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql
index 949ed2c..2dff7e5 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_07.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_07.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql
index 3f899a2..9bc10e6 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-let-to-edit-distance-check_08.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-let-to-edit-distance-check_08.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql
index 0370fff..09e962c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_01.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql
index 77d78f8..35e28fc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_02.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_02.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql
index c34c28a..e05f85a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_03.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_03.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql
index 082dc39..b890967 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_04.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql
index 6d892df..bc66061 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_05.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_05.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql
index 20d4879..018d6d1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_06.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_06.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql
index 49871f9..cdaefa9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_07.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_07.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql
index ed6d406..745044f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/edit-distance-to-edit-distance-check_08.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_edit-distance-to-edit-distance-check_08.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql
index 702b739..f6e9d52 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-edit-distance-check.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_fuzzyeq-to-edit-distance-check.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql
index eaacc3e..5f57a3e 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/fuzzyeq-to-jaccard-check.aql
@@ -16,7 +16,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_fuzzyeq-to-jaccard-check.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql
index 8647565..733c6d9 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_01.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql
index b48eb24..a360ef1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_02.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql
index 74dcf9d..ad8abca 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_03.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql
index e17d458..fd236de 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_04.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql
index 266f369..b750a5d 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_05.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql
index 3beec4b..56b1471 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_06.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql
index 86401ac..6ae0444 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_07.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql
index 372a3e8..5d04402 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-let-to-jaccard-check_08.aql
@@ -18,7 +18,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-let-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql
index 8e8a0f8..33eb133 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_01.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_01.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql
index bee4595..3bdf01f 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_02.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_02.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql
index 591c8f0..3a22a16 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_03.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_02.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql
index 2d10e1d..bdce095 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_04.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_03.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql
index f091dcd..977f22a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_05.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_05.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql
index 7b98eaf..eb3f3ef 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_06.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_06.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql
index 71f087e..753ce3c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_07.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_07.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql
index 13d11ed..2d1bd93 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-to-jaccard-check_08.aql
@@ -17,7 +17,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 write output to nc1:"rttest/similarity_jaccard-to-jaccard-check_08.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/sort-cust.aql b/asterix-app/src/test/resources/optimizerts/queries/sort-cust.aql
index ec4f6f1..9605b37 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/sort-cust.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/sort-cust.aql
@@ -27,7 +27,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Customers(CustomerType)
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 write output to nc1:"/tmp/custlimit.adm";
 
diff --git a/asterix-app/src/test/resources/optimizerts/queries/unnest_list_in_subplan.aql b/asterix-app/src/test/resources/optimizerts/queries/unnest_list_in_subplan.aql
index 5a943f1..3f34242 100644
--- a/asterix-app/src/test/resources/optimizerts/queries/unnest_list_in_subplan.aql
+++ b/asterix-app/src/test/resources/optimizerts/queries/unnest_list_in_subplan.aql
@@ -17,8 +17,8 @@
 
 create nodegroup group1 if not exists on nc1, nc2;
 
-create dataset DBLP(DBLPType) partitioned by key id on group1;
-create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) partitioned by key rank on group1;
+create dataset DBLP(DBLPType) primary key id on group1;
+create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) primary key rank on group1;
 
 write output to nc1:'rttest/unnest_list_in_subplan.adm';
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql
index 3583ce0..2c4ba6a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/avg_empty_02.aql
@@ -13,7 +13,7 @@
   val: double
 }
 
-create dataset Test(TestType) partitioned by key id;
+create dataset Test(TestType) primary key id;
 
 write output to nc1:"rttest/aggregate_avg_empty_02.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql
index 0a6cc8e..9ab7168 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/count_empty_02.aql
@@ -13,7 +13,7 @@
   val: double
 }
 
-create dataset Test(TestType) partitioned by key id;
+create dataset Test(TestType) primary key id;
 
 write output to nc1:"rttest/aggregate_count_empty_02.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql
index 79ae1d8..8b954e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/max_empty_02.aql
@@ -13,7 +13,7 @@
   val: double
 }
 
-create dataset Test(TestType) partitioned by key id;
+create dataset Test(TestType) primary key id;
 
 write output to nc1:"rttest/aggregate_max_empty_02.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql
index 99d49f4..6aa122c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/min_empty_02.aql
@@ -13,7 +13,7 @@
   val: double
 }
 
-create dataset Test(TestType) partitioned by key id;
+create dataset Test(TestType) primary key id;
 
 write output to nc1:"rttest/aggregate_min_empty_02.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql
index a94457a..c3fd645 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_empty_02.aql
@@ -13,7 +13,7 @@
   val: double
 }
 
-create dataset Test(TestType) partitioned by key id;
+create dataset Test(TestType) primary key id;
 
 write output to nc1:"rttest/aggregate_sum_empty_02.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred.aql
index 10e952c..8c695c5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_null-with-pred.aql
@@ -16,7 +16,7 @@
 sal:int32?
 }
 
-create dataset tdst(TestType) partitioned by key id;
+create dataset tdst(TestType) primary key id;
 
 insert into dataset tdst({"id":123,"sal":1000});
 insert into dataset tdst({"id":113,"sal":2000});
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null.aql
index 9197e33..4c568b1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/sum_numeric_null.aql
@@ -15,7 +15,7 @@
 sal:int32?
 }
 
-create dataset tdst(TestType) partitioned by key id;
+create dataset tdst(TestType) primary key id;
 
 // In AQL
 // sum(numeric + null) => null
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range.aql
index 4268231..a1cbf52 100644
--- a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_range.aql
@@ -11,7 +11,7 @@
 }
 
 create dataset TwitterData(Tweet)
-  partitioned by key id;
+  primary key id;
 
 load dataset TwitterData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql
index e95d102..eaec65a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv01.aql
@@ -30,10 +30,10 @@
 dept : string
 }
 
-create dataset student.ugdstd(stdType) partitioned by key id;
-create dataset student.gdstd(stdType) partitioned by key id;
-create dataset teacher.prof(tchrType) partitioned by key id;
-create dataset teacher.pstdoc(tchrType) partitioned by key id;
+create dataset student.ugdstd(stdType) primary key id;
+create dataset student.gdstd(stdType) primary key id;
+create dataset teacher.prof(tchrType) primary key id;
+create dataset teacher.pstdoc(tchrType) primary key id;
 
 insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql
index 1257cac..4ab7c29 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv02.aql
@@ -30,10 +30,10 @@
 dept : string
 }
 
-create dataset student.ugdstd(stdType) partitioned by key id;
-create dataset student.gdstd(stdType) partitioned by key id;
-create dataset teacher.prof(tchrType) partitioned by key id;
-create dataset teacher.pstdoc(tchrType) partitioned by key id;
+create dataset student.ugdstd(stdType) primary key id;
+create dataset student.gdstd(stdType) primary key id;
+create dataset teacher.prof(tchrType) primary key id;
+create dataset teacher.pstdoc(tchrType) primary key id;
 
 insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"});
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql
index 0c80540..a68d428 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv03.aql
@@ -32,10 +32,10 @@
 dept : string
 }
 
-create dataset student.ugdstd(stdType) partitioned by key id;
-create dataset student.gdstd(stdType) partitioned by key id;
-create dataset teacher.prof(tchrType) partitioned by key id;
-create dataset teacher.pstdoc(tchrType) partitioned by key id;
+create dataset student.ugdstd(stdType) primary key id;
+create dataset student.gdstd(stdType) primary key id;
+create dataset teacher.prof(tchrType) primary key id;
+create dataset teacher.pstdoc(tchrType) primary key id;
 
 drop dataset student.ugdstd;
 drop dataset student.gdstd;
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql
index 20be103..55a3fa0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv04.aql
@@ -33,20 +33,20 @@
 dept : string
 }
 
-create dataset student.ugdstd(stdType) partitioned by key id;
-create dataset student.gdstd(stdType) partitioned by key id;
-create dataset teacher.prof(tchrType) partitioned by key id;
-create dataset teacher.pstdoc(tchrType) partitioned by key id;
+create dataset student.ugdstd(stdType) primary key id;
+create dataset student.gdstd(stdType) primary key id;
+create dataset teacher.prof(tchrType) primary key id;
+create dataset teacher.pstdoc(tchrType) primary key id;
 
 drop dataset student.ugdstd;
 drop dataset student.gdstd;
 drop dataset teacher.prof;
 drop dataset teacher.pstdoc;
 
-create dataset student.ugdstd(stdType) partitioned by key id;
-create dataset student.gdstd(stdType) partitioned by key id;
-create dataset teacher.prof(tchrType) partitioned by key id;
-create dataset teacher.pstdoc(tchrType) partitioned by key id;
+create dataset student.ugdstd(stdType) primary key id;
+create dataset student.gdstd(stdType) primary key id;
+create dataset teacher.prof(tchrType) primary key id;
+create dataset teacher.pstdoc(tchrType) primary key id;
 
 for $l in dataset('Metadata.Dataset')
 where $l.DataverseName='student' or $l.DataverseName='teacher'
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql
index 4bba053..25e5d67 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv07.aql
@@ -18,7 +18,7 @@
 dept:string
 }
 
-create dataset test.employee(Emp) partitioned by key id;
+create dataset test.employee(Emp) primary key id;
 
 load dataset test.employee
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql
index 10985e3..8b4a32d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv08.aql
@@ -22,8 +22,8 @@
 id : int32
 }
 
-create dataset test.t1(testtype) partitioned by key id;
-create dataset fest.t1(testtype) partitioned by key id;
+create dataset test.t1(testtype) primary key id;
+create dataset fest.t1(testtype) primary key id;
 
 insert into dataset test.t1({"id":24});
 insert into dataset test.t1({"id":23});
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql
index 26556e0..8e42043 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv17.aql
@@ -20,8 +20,8 @@
 id : int32
 }
 
-create dataset test.t1(testtype) partitioned by key id;
-create dataset fest.t1(testtype) partitioned by key id;
+create dataset test.t1(testtype) primary key id;
+create dataset fest.t1(testtype) primary key id;
 
 insert into dataset test.t1({"id":24});
 insert into dataset test.t1({"id":23});
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql
index 0d3bd53..69dd67d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv18.aql
@@ -21,8 +21,8 @@
 id : int32
 }
 
-create dataset test.t1(testtype) partitioned by key id;
-create dataset fest.t1(testtype) partitioned by key id;
+create dataset test.t1(testtype) primary key id;
+create dataset fest.t1(testtype) primary key id;
 
 insert into dataset test.t1({"id":24});
 insert into dataset test.t1({"id":23});
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql
index 335f11c..6a0cf97 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/cross-dv19.aql
@@ -33,17 +33,17 @@
   text: string
 }
 
-create dataset test1.t1(testtype) partitioned by key id;
+create dataset test1.t1(testtype) primary key id;
 
-create dataset test2.t2(testtype) partitioned by key id;
+create dataset test2.t2(testtype) primary key id;
 
-create dataset test2.t3(testtype) partitioned by key id;
+create dataset test2.t3(testtype) primary key id;
 
-create dataset test1.t2(testtype) partitioned by key id;
+create dataset test1.t2(testtype) primary key id;
 
-create dataset test1.t3(testtype) partitioned by key id;
+create dataset test1.t3(testtype) primary key id;
 
-create dataset test2.t4(testtype) partitioned by key id;
+create dataset test2.t4(testtype) primary key id;
 
 create external dataset test1.TwitterData(Tweet)
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql
index 7b14957..860dd74 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/drop_dataset.aql
@@ -20,7 +20,7 @@
 };
 
 create dataset test.Customers(CustomerType)
-partitioned by key cid;
+primary key cid;
 
 drop dataset test.Customers;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql
index 7eebbaf..2395a48 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_across_dataverses.aql
@@ -42,10 +42,10 @@
 };
 
 create dataset test1.Customers(CustomerType)
-partitioned by key cid;
+primary key cid;
 
 create dataset test2.Customers(CustomerType)
-partitioned by key cid;
+primary key cid;
 
 load dataset test1.Customers
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql
index 89180ef..3c96539 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/insert_from_source_dataset.aql
@@ -14,7 +14,7 @@
 
 write output to nc1:"rttest/cross-dataverse_insert_from_source_dataset.adm";
 
-create dataset test.t1(testtype) partitioned by key id;
+create dataset test.t1(testtype) primary key id;
 
 insert into dataset test.t1({"id":456,"name":"Roger"});
 insert into dataset test.t1({"id":351,"name":"Bob"});
@@ -22,7 +22,7 @@
 insert into dataset test.t1({"id":926,"name":"Richard"});
 insert into dataset test.t1({"id":482,"name":"Kevin"});
 
-create dataset test.t2(testtype) partitioned by key id;
+create dataset test.t2(testtype) primary key id;
 
 insert into dataset test.t2({"id":438,"name":"Ravi"});
 insert into dataset test.t2({"id":321,"name":"Bobby"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql
index d09755a..8266c79 100644
--- a/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/cross-dataverse/join_across_dataverses.aql
@@ -25,7 +25,7 @@
 };
 
 create dataset test1.Customers(CustomerType)
-partitioned by key cid;
+primary key cid;
 
 
 create type test2.OrderType as open {
@@ -39,7 +39,7 @@
 }
 
 create dataset test2.Orders(OrderType)
-partitioned by key oid;
+primary key oid;
 
 
 load dataset test1.Customers
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/co.aql b/asterix-app/src/test/resources/runtimets/queries/custord/co.aql
index 879b2b8..2b9cc6b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/co.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/co.aql
@@ -37,11 +37,11 @@
 }
 
 create dataset Customers3(CustomerType) 
-  partitioned by key cid;
+  primary key cid;
 create dataset Orders3(OrderType)
-  partitioned by key oid;
+  primary key oid;
 create dataset CustomerOrders3(CustomerOrdersType)
-  partitioned by key cid;
+  primary key cid;
 
 write output to nc1:"rttest/custord_co.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01.aql
index decc8bb..bcc4079 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_01.aql
@@ -37,11 +37,11 @@
 }
 
 create dataset Customers1(CustomerType) 
-  partitioned by key cid;
+  primary key cid;
 create dataset Orders1(OrderType)
-  partitioned by key oid;
+  primary key oid;
 create dataset CustomerOrders1(CustomerOrdersType)
-  partitioned by key cid;
+  primary key cid;
 
 load dataset Customers1 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02.aql
index 2ac6910..481adf4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_02.aql
@@ -37,11 +37,11 @@
 }
 
 create dataset Customers2(CustomerType) 
-  partitioned by key cid;
+  primary key cid;
 create dataset Orders2(OrderType)
-  partitioned by key oid;
+  primary key oid;
 create dataset CustomerOrders2(CustomerOrdersType)
-  partitioned by key cid;
+  primary key cid;
 
 load dataset Customers2 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03.aql b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03.aql
index 324dbb0..92a049d5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/denorm-cust-order_03.aql
@@ -37,11 +37,11 @@
 }
 
 create dataset Customers3(CustomerType) 
-  partitioned by key cid;
+  primary key cid;
 create dataset Orders3(OrderType)
-  partitioned by key oid;
+  primary key oid;
 create dataset CustomerOrders3(CustomerOrdersType)
-  partitioned by key cid;
+  primary key cid;
 
 load dataset Customers3 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk.aql b/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk.aql
index cd4ef0e..9bc318a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/freq-clerk.aql
@@ -28,7 +28,7 @@
 }
 
 create dataset CustomerOrders(CustomerOrderType) 
-  partitioned by key cid;
+  primary key cid;
 
 
 load dataset CustomerOrders
diff --git a/asterix-app/src/test/resources/runtimets/queries/custord/load-test.aql b/asterix-app/src/test/resources/runtimets/queries/custord/load-test.aql
index 5f73e4b..6cafbe0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/custord/load-test.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/custord/load-test.aql
@@ -21,9 +21,9 @@
 }
 
 create dataset c1(CustomerType) 
-  partitioned by key cid;
+  primary key cid;
 create dataset c2(CustomerType) 
-  partitioned by key cid;  
+  primary key cid;  
   
 load dataset c1 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dapd/q3.aql b/asterix-app/src/test/resources/runtimets/queries/dapd/q3.aql
index 23e4557..63b9119 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dapd/q3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dapd/q3.aql
@@ -24,7 +24,7 @@
 }
 
 create dataset User(UserType)
- partitioned by key name;
+ primary key name;
 
 load dataset User 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index.aql
index ab6b6c9..e642073 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset-with-index.aql
@@ -22,7 +22,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset.aql b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset.aql
index 1a445bf..ff66d65 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/delete-from-loaded-dataset.aql
@@ -22,7 +22,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes.aql
index 2534e51..b25f028 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-empty-secondary-indexes.aql
@@ -18,7 +18,7 @@
 
 write output to nc1:"rttest/dml_drop-empty-secondary-indexes.adm";
 
-create dataset t1(TestType) partitioned by key id;
+create dataset t1(TestType) primary key id;
 
 create index rtree_index_point on t1(locn) type rtree;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index.aql
index 0c87734..8b99487 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/drop-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/drop-index.aql
@@ -28,7 +28,7 @@
 string4:  string
 }
 
-create dataset t1(Schema) partitioned by key unique2;
+create dataset t1(Schema) primary key unique2;
 
 // Load data
 load dataset t1
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index.aql
index 4f22e84..45ec5e6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load-with-index.aql
@@ -29,7 +29,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create index part_index on LineItem(l_partkey);
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load.aql b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load.aql
index f9db086..63739d6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/empty-load.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/empty-load.aql
@@ -29,7 +29,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create index part_index on LineItem(l_partkey);
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index.aql
index 00b60cb..586226c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset-with-index.aql
@@ -16,7 +16,7 @@
 }
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create index idx_LineID_partkey on LineID(l_linenumber);
 create index idx_LineID_suppkey on LineID(l_suppkey);
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset.aql
index 253f5e7..58548b6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-empty-dataset.aql
@@ -16,7 +16,7 @@
 }
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 insert into dataset LineID (
 let $x:=1
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01.aql
index 7a3cce2..761066e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_01.aql
@@ -9,7 +9,7 @@
 }
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineID 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02.aql
index 04a5043..475e6ab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset-with-index_02.aql
@@ -28,10 +28,10 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01.aql
index 1f211e8..7ece2ab 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_01.aql
@@ -9,7 +9,7 @@
 }
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineID 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02.aql
index ef38109..f05844b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-into-loaded-dataset_02.aql
@@ -21,9 +21,9 @@
 string4:  string
 }
 
-create dataset onektup(Schema) partitioned by key unique2;
+create dataset onektup(Schema) primary key unique2;
 
-create dataset tenktup1(Schema) partitioned by key unique2;
+create dataset tenktup1(Schema) primary key unique2;
 
 load dataset onektup 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
@@ -33,7 +33,7 @@
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/wisc/tenktup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
-create dataset tmp(Schema) partitioned by key unique2;
+create dataset tmp(Schema) primary key unique2;
 
 load dataset tmp 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql
index c3dc7ba..7c055f7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql
@@ -20,8 +20,8 @@
   id: string
 }
 
-create dataset testds01(testtype01) partitioned by key id;
-create dataset testds02(testtype02) partitioned by key id;
+create dataset testds01(testtype01) primary key id;
+create dataset testds02(testtype02) primary key id;
 
 insert into dataset testds01 ({ "id": "001" });
 insert into dataset testds01 ({ "id": "002", "name": "John Doe" });
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert.aql
index 2b4622f..a0d4d5b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert.aql
@@ -28,10 +28,10 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc.aql
index 7e133ae..c646c4c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert_less_nc.aql
@@ -28,10 +28,10 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs.aql b/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs.aql
index 0411145..908f515 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/load-from-hdfs.aql
@@ -22,7 +22,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index.aql
index efab267..61b455c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/load-with-index.aql
@@ -22,7 +22,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create index idx_partkey on LineItem(l_partkey);
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive.aql
index 6c8264f..b2ec24f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o-recursive.aql
@@ -30,9 +30,9 @@
   id: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
-create dataset testds2(testtype2) partitioned by key id;
+create dataset testds2(testtype2) primary key id;
 
 insert into dataset testds (
 { "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697}, "department": {{ {"name":"CS", "id":299, "review":5}, {"name":"EE", "id":399} }} }
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o.aql
index a63e2df..29d7d61 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-c2o.aql
@@ -23,9 +23,9 @@
   id: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
-create dataset testds2(testtype2) partitioned by key id;
+create dataset testds2(testtype2) primary key id;
  
 insert into dataset testds (
 { "hobby": {{"music", "coding"}}, "id": "001", "name": "Person Three"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-optional.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-optional.aql
index 94991be..b510ba4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-optional.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-closed-optional.aql
@@ -13,7 +13,7 @@
   id: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
 insert into dataset testds (
 { "id": "001", "name": "Person One"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert.aql
index 12248dd..9301ac5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert.aql
@@ -13,7 +13,7 @@
   name: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
  
  insert into dataset testds (
  { "id": "001", "name": "Person Three", "hobbies": {{"scuba", "music"}}}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2.aql
index 1903bf2..e673c57 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-insert2.aql
@@ -13,7 +13,7 @@
 	id:int32
 }
 
-create dataset testds(TestType) partitioned by key id;
+create dataset testds(TestType) primary key id;
 
 insert into dataset testds( for $i in range(1,10) return { "id":$i,"name":"John Doe" });
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand.aql
index c6ff1cd..bc408be 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-noexpand.aql
@@ -14,7 +14,7 @@
   id: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
 insert into dataset testds (
 { "id": "001", "name": "Person One"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive.aql
index 2070e20..92d2bce 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c-recursive.aql
@@ -31,9 +31,9 @@
   department: {{Dept}}?
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
-create dataset testds2(testtype2) partitioned by key id;
+create dataset testds2(testtype2) primary key id;
 
 insert into dataset testds (
 { "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697}, "department": {{ {"name":"CS", "id":299}, {"name":"EE", "id":399} }} }
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c.aql
index 015aa7b..ae69e17 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2c.aql
@@ -21,9 +21,9 @@
   name: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
-create dataset testds2(testtype2) partitioned by key id; 
+create dataset testds2(testtype2) primary key id; 
  
 insert into dataset testds (
 { "id": "001",  "hobby": {{"music"}}, "name": "Person Three"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o.aql b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o.aql
index 545790b..c836a69 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/opentype-o2o.aql
@@ -21,9 +21,9 @@
   hobby: string
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
-create dataset testds2(testtype2) partitioned by key id;
+create dataset testds2(testtype2) primary key id;
  
 insert into dataset testds (
 { "name": "Person One",  "id": "001", "hobby": "music"}
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
index e0a0695..3a2ad40 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
@@ -21,7 +21,7 @@
 }
 
 create dataset Employees(EmployeeType)
-  partitioned by key id;
+  primary key id;
 
 insert into dataset Employees({"id":"1234", "stat":{ "age":50, "salary":120000}, "deptCode":32 });
 insert into dataset Employees({"id":"5678", "stat":{ "age":40, "salary":100000}, "deptCode":16 });
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable.aql
index a35c8e5..36df10a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-btree-secondary-index-nullable.aql
@@ -24,7 +24,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable.aql
index fc30529..c44c3e8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index-nullable.aql
@@ -21,7 +21,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
index 4e2ca6c..b6bc17b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-rtree-secondary-index.aql
@@ -15,7 +15,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable.aql
index d5d22d3..dde8892 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-btree-secondary-index-nullable.aql
@@ -24,8 +24,8 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset CustomersMini(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
+create dataset CustomersMini(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable.aql
index 161439a..a3d38eb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index-nullable.aql
@@ -26,14 +26,14 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialDataNulls.json"),("format"="adm")) pre-sorted;
 
 create dataset MyMiniData(MyMiniRecord)
-  partitioned by key id;
+  primary key id;
 
 create index rtree_index_point on MyMiniData(point) type rtree;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
index f1bc29d..0ed6488 100644
--- a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-rtree-secondary-index.aql
@@ -20,14 +20,14 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
 (("path"="nc1://data/spatial/spatialData.json"),("format"="adm")) pre-sorted;
 
 create dataset MyMiniData(MyMiniRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyMiniData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql
index 465d94f..f883454 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree.aql
@@ -12,7 +12,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql
index cd4a922..7bf558b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete.aql
@@ -23,7 +23,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree.aql
index 2ec32f4..9530df5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert-rtree.aql
@@ -17,7 +17,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
@@ -25,7 +25,7 @@
 
 
 create dataset MyMiniData(MyMiniRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyMiniData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/insert.aql b/asterix-app/src/test/resources/runtimets/queries/failure/insert.aql
index a0ce842..0309b7c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/insert.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/insert.aql
@@ -29,10 +29,10 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 create dataset LineID(LineIDType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure.aql b/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure.aql
index a0c7f87..58db4b8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/q1_pricing_summary_report_failure.aql
@@ -24,7 +24,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_01.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_01.aql
index d4dcd38..10a6335 100644
--- a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_01.aql
@@ -18,7 +18,7 @@
 create feed dataset TweetFeed(TweetType)
 using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
 (("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
-partitioned by key id;
+primary key id;
 
 write output to nc1:"rttest/feeds_feeds_01.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql
index 3129d63..d72e623 100644
--- a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_02.aql
@@ -19,7 +19,7 @@
 create feed dataset TweetFeed(TweetType)
 using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
 (("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
-partitioned by key id;
+primary key id;
 
 begin feed TweetFeed; 
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql
index a4b22d0..41b2115 100644
--- a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_03.aql
@@ -23,7 +23,7 @@
 using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
 (("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
 apply function feed_processor@1
-partitioned by key id;
+primary key id;
 
 write output to nc1:"rttest/feeds_feeds_03.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql
index c38cfd2..bea88fb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/feeds_04.aql
@@ -20,7 +20,7 @@
 create feed dataset TweetFeed(TweetType)
 using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
 (("fs"="hdfs"),("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/obamatweets.adm"),("format"="adm"),("input-format"="text-input-format"),("output-type-name"="TweetType"),("tuple-interval"="10"))
-partitioned by key id;
+primary key id;
 
 begin feed TweetFeed; 
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql b/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql
index a7dc4fa..a9f3236 100644
--- a/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/feeds/issue_230_feeds.aql
@@ -19,7 +19,7 @@
 create feed dataset TweetFeed(TweetType)
 using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
 (("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
-partitioned by key id;
+primary key id;
 
 begin feed feeds.TweetFeed; 
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1.aql
index 8438ae9..ffabe64 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1.aql
index d575424..a74bc3e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.aql
index f0b43d1..53771c1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.aql
index a96e933..923959b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1.aql
index f424166..3c7bb5b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2.aql
index 05304c5..d0eebcb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2.aql
@@ -17,8 +17,8 @@
   rank: int32
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) partitioned by key rank;
+create dataset DBLP(DBLPType) primary key id;
+create dataset TOKENSRANKEDADM(TOKENSRANKEDADMType) primary key rank;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1.aql
index be6073b..b5ae4c6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2.aql
index 9d31f4a..d50b67c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3.aql
index 4bc6836..2e57a79 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4.aql
index 149a9b4..7f59c30 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1.aql
index 90e1b15..4f53db6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2.aql
index 2771589..67bd952 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1.aql
index 57cdab4..9944c93 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.aql
index e4e8cfd..0319117 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.aql
index 8d3c4c3..9a10925 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1.aql
index e65952d..2de6807 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2.aql
index 4a98706..a3b5bc5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.aql
index d998928..26f5e46 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1.aql
index fa0bfac..dd88883 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql
index 7bf7d5f..abd3425 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-aqlplus_2.aql
@@ -15,7 +15,7 @@
   id: int32
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1.aql
index a899a80..288194c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2.aql
index 4c30bb7..0010b8b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3.aql
index 5c49fd2..aa3c661 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4.aql
index fa8501c..2aa331c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1.aql
index 97d163f..a8f5eec 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2.aql
index 0329a87..d724b57 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1.aql
index 9d9c141..57dbb53 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 
 load dataset DBLP
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.aql
index 11d4327..fa9f11c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.aql
index 603077e..40fd306 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1.aql
index 2a3f6ec..59a881b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2.aql
index e942aa0..9352c3b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3.aql
index dbbc1b1..c1c6322 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4.aql
index a703037..75fe12b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1.aql
index c6d61e2..bfed5c6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2.aql
index f881151..b683acb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1.aql
index b0884f2..3134c41 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.aql
index 46bd31d..97e16c9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1.aql
index c8ed34b..175e4b1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.aql
index e4eab9d..e471d69 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.aql
index 55d508b..588591d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1.aql
index 30445bf..0195185 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2.aql
index 01ee281..085d139 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_2.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3.aql
index 4439af1..d379cc4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-aqlplus_3.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1.aql
index 77e32a2..cb774be 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-dblp-aqlplus_1.aql
@@ -20,8 +20,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1.aql
index 274f0c2..edec926 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-lookup_1.aql
@@ -12,7 +12,7 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
 load dataset DBLP
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1.aql
index 500454f..b31ba58 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/events-users-aqlplus_1.aql
@@ -22,7 +22,7 @@
 }}
 }
 
-create dataset User(UserType) partitioned by key name;
+create dataset User(UserType) primary key name;
 
 load dataset User
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1.aql
index 7598987..af327b4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_1.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2.aql
index 5b3c828..2d81ddd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_2.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3.aql
index c131c75..9785f52 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-int-aqlplus_3.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1.aql
index 6a6248f..bdcaa36 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.1.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.aql
index 75eb9c8..db833d0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_1.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2.aql
index 39168c6..9f6e758 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_2.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3.aql
index c9e4ece..e438ec8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-lot-aqlplus_3.aql
@@ -9,7 +9,7 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
+create dataset Users(UserType) primary key uid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1.aql
index fa63e8e..6dd9cbc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-3_1.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1.aql
index 5cea93e..40fa07b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_1.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2.aql
index 6ec3fc6..e56c48c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_2.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3.aql
index baf6d12..01c172e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-aqlplus_3.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1.aql
index ff94813..0746be5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-int-vis-user-lot-aqlplus_1.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1.aql
index 9f2fd07..6654d07 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-3_1.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1.aql
index 1cfaccf..a289015 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_1.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2.aql
index b5eb560..59b7c9a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_2.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3.aql
index 5b557ee..861db2f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_3.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4.aql
index 1353960..49ac082 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_4.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5.aql
index 58cc81f..08e8bf8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-aqlplus_5.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1.aql
index 01ad330..4679eca 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_1.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2.aql
index 35fde70..669284c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/user-vis-lot-int-aqlplus_2.aql
@@ -18,8 +18,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 load dataset Users 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql
index 7a0494f..8271f1d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_02.aql
@@ -13,7 +13,7 @@
 };
 
 create external dataset TextDataset(LineType)
-using "hdfs"
+using hdfs
 (("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/textFileS"),("input-format"="sequence-input-format"),("format"="delimited-text"),("delimiter"="."));
 
 write output to nc1:"rttest/hdfs_hdfs_02.adm";
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql
index fc5b3ab..4ddf511 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/hdfs_03.aql
@@ -15,7 +15,7 @@
 };
 
 create external dataset TextDataset(LineType)
-using "hdfs"
+using hdfs
 (("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/large_text"),("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="."));
 
 write output to nc1:"rttest/hdfs_hdfs_03.adm";
diff --git a/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql b/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql
index c2a0963..4a42a20 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hdfs/issue_245_hdfs.aql
@@ -14,7 +14,7 @@
 };
 
 create external dataset TextDataset(LineType)
-using "hdfs"
+using hdfs
 (("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/asterix_info.txt"),("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="."));
 
 write output to nc1:"rttest/hdfs_issue_245_hdfs.adm";
diff --git a/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_5.aql b/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_5.aql
index 5e5ecc8..544b37c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_5.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_5.aql
@@ -20,7 +20,7 @@
 }
 
 create dataset DBLPadm(DBLPType) 
-partitioned by key id
+primary key id
 hints(cardinality=200);
 
 // drop dataset DBLPadm;
diff --git a/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_6.aql b/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_6.aql
index 889daa7..0b7c20d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_6.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_6.aql
@@ -14,7 +14,7 @@
 };
 
 create external dataset TextDataset(LineType)
-using "hdfs"
+using hdfs
 (("hdfs"="hdfs://127.0.0.1:31888"),("path"="/asterix/textFileS"),("input-format"="sequence-input-format"),("format"="delimited-text"),("delimiter"="."))
 hints(cardinality=10);
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_7.aql b/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_7.aql
index d06e2a7..8f4a74d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_7.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/hints/issue_251_dataset_hint_7.aql
@@ -20,7 +20,7 @@
 create feed dataset TweetFeed(TweetType)
 using "edu.uci.ics.asterix.tools.external.data.RateControlledFileSystemBasedAdapterFactory"
 (("fs"="localfs"),("path"="nc1://data/twitter/obamatweets.adm"),("format"="adm"),("output-type-name"="TweetType"),("tuple-interval"="10"))
-partitioned by key id
+primary key id
 hints(cardinality=200);
 
 begin feed feeds.TweetFeed; 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql
index 1015e82..0800784 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-primary-equi-join.aql
@@ -37,8 +37,8 @@
   items: [int32]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
-create dataset Orders(OrderType) partitioned by key oid;
+create dataset Customers(CustomerType) primary key cid;
+create dataset Orders(OrderType) primary key oid;
 
 load dataset Customers
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql
index d1e9824..1bf3490 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/btree-secondary-equi-join.aql
@@ -25,8 +25,8 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
-create dataset CSX(CSXType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
index ab79189..58fbf73 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-join/rtree-spatial-intersect-point.aql
@@ -21,8 +21,8 @@
   circle: circle
 }
 
-create dataset MyData1(MyRecord) partitioned by key id;
-create dataset MyData2(MyRecord) partitioned by key id;
+create dataset MyData1(MyRecord) primary key id;
+create dataset MyData2(MyRecord) primary key id;
 
 load dataset MyData1
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql
index dadb884..248c8ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-composite-key.aql
@@ -19,7 +19,7 @@
 dept:string
 }
 
-create dataset employee(Emp) partitioned by key id;
+create dataset employee(Emp) primary key id;
 
 load dataset employee
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql
index 7b72a80..e3214de 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/btree-index-rewrite-multiple.aql
@@ -22,7 +22,7 @@
   o_comment: string
 }
 
-create dataset Orders(OrderType) partitioned by key o_orderkey;
+create dataset Orders(OrderType) primary key o_orderkey;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable.aql
index 460a212..8fb416b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/cust-index-age-nullable.aql
@@ -17,7 +17,7 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains.aql
index ad85be7..e9b9540 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-contains.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic.aql
index b275423..3e637ed 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance-panic.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance.aql
index ddcdd4b..1fca0d4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-edit-distance.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard.aql
index 501ebce..1b8167b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ngram-jaccard.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic.aql
index deb51a7..79e728f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance-panic.aql
@@ -20,7 +20,7 @@
 create nodegroup group1 if not exists on nc1;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance.aql
index bb05fc1..793d578 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-edit-distance.aql
@@ -20,7 +20,7 @@
 create nodegroup group1 if not exists on nc1;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard.aql
index 8e2d1e7..aacb656 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-olist-jaccard.aql
@@ -20,7 +20,7 @@
 create nodegroup group1 if not exists on nc1;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard.aql
index 6a0e266..a6ea348 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-ulist-jaccard.aql
@@ -20,7 +20,7 @@
 create nodegroup group1 if not exists on nc1;
 
 create dataset Customers(CustomerType) 
-  partitioned by key cid on group1;
+  primary key cid on group1;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains.aql
index 348f686..f873dbb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-contains.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard.aql
index 9852e67..051f4f8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/inverted-index-word-jaccard.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open.aql
index 1a0ecbc..174c50f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive-open.aql
@@ -15,7 +15,7 @@
 }
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive.aql
index ceca42e..6e4e659 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-conjunctive.aql
@@ -15,7 +15,7 @@
 }
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open.aql
index 281f566..50088f4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey-open.aql
@@ -18,7 +18,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey.aql
index 365cfcb..9a950aa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/orders-index-custkey.aql
@@ -15,7 +15,7 @@
 }
 
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 
 load dataset Orders 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open.aql
index 099e2d2..9a1906c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search-open.aql
@@ -23,7 +23,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search.aql
index 62714ed..758e110 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/range-search.aql
@@ -23,7 +23,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable.aql
index 6ca6d28..d920cfce 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-nullable.aql
@@ -14,7 +14,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open.aql
index 44425cc..0a49ac1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index-open.aql
@@ -14,7 +14,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
index c1e1890..19df2db 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/rtree-secondary-index.aql
@@ -15,7 +15,7 @@
 }
 
 create dataset MyData(MyRecord)
-  partitioned by key id;
+  primary key id;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
index 0ea267c..c6e29e6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance-inline.aql
@@ -25,9 +25,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
index f7e3a8b..46cd05c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-edit-distance.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
index 734a269..f2f330e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline.aql
@@ -26,9 +26,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
index 2e1a635..1df7a5b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
index 3b46c7d..a72d292 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline.aql
@@ -25,9 +25,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
index 3f025ed..ea05e33 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
index ea28721..e8b4b05 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline.aql
@@ -25,9 +25,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
index 458d31c..d33fc87 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
index e11b2f0..c46d534 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline.aql
@@ -25,9 +25,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
index 9732a51..c7534f3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
index 1985878..ebec1d8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline.aql
@@ -26,9 +26,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql
index 013b51e..29e17bc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql
index a602ca1..75ebe7b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance-inline.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql
index 1c88536..9c305ec 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-edit-distance.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql
index cd88072..048aee8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql
index abb5e33..96c685d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql
index bdac6f1..41e1d9e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance-inline.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql
index 5e679e4..64e16ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-edit-distance.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
 
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql
index 8fd8632..ef2730b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard-inline.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql
index 50d13f1..d8af52c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/olist-jaccard.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql
index a62c66d..c6b2252 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard-inline.aql
@@ -24,9 +24,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql
index 8c6570f..efdb925 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ulist-jaccard.aql
@@ -23,9 +23,9 @@
   children: [ { name: string, age: int32? } ]
 }
 
-create dataset Customers(CustomerType) partitioned by key cid;
+create dataset Customers(CustomerType) primary key cid;
   
-create dataset Customers2(CustomerType) partitioned by key cid;
+create dataset Customers2(CustomerType) primary key cid;
 
 load dataset Customers 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql
index 3ac3583..b50a92b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard-inline.aql
@@ -25,9 +25,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql
index 7060fe6..6063e0b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/word-jaccard.aql
@@ -24,9 +24,9 @@
   misc: string
 }
 
-create dataset DBLP(DBLPType) partitioned by key id;
+create dataset DBLP(DBLPType) primary key id;
 
-create dataset CSX(CSXType) partitioned by key id;
+create dataset CSX(CSXType) primary key id;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql b/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql
index 9b25210..2127117 100644
--- a/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/load/issue14_query.aql
@@ -14,10 +14,10 @@
 }
 
 create dataset onektup(Schema) 
-partitioned by key id;
+primary key id;
 
 load dataset onektup 
-using "localfs"(("path"="nc1:///tmp/one.adm"));
+using localfs(("path"="nc1:///tmp/one.adm"));
 
 write output to nc1:"/tmp/foo.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql
index f148d2e..a2e2c1d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/nested-loop-join_01.aql
@@ -16,8 +16,8 @@
   interests: {{string}}
 }
 
-create dataset Users(UserType) partitioned by key uid;
-create dataset Visitors(VisitorType) partitioned by key vid;
+create dataset Users(UserType) primary key uid;
+create dataset Visitors(VisitorType) primary key vid;
 
 
 load dataset Users 
diff --git a/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord.aql b/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord.aql
index c0b5e06..e038aeb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/nestrecords/nestrecord.aql
@@ -20,7 +20,7 @@
   address: AddressType?
 }
 
-create dataset testds(testtype) partitioned by key id;
+create dataset testds(testtype) primary key id;
 
 insert into dataset testds (
 { "id": "001", "name": "Person One", "address": {"street": "3019 DBH",  "city": "Irvine", "zip": 92697} }
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(
    {
diff --git a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02.aql b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02.aql
index 18f1c20..6718ff0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/quantifiers/somesat_02.aql
@@ -30,9 +30,9 @@
 }
 
 create dataset CustomerSomeSat02(CustomerType)
-  partitioned by key cid;
+  primary key cid;
 create dataset OrdersSomeSat02(OrderType)
-  partitioned by key oid;
+  primary key oid;
 
 load dataset CustomerSomeSat02 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" 
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql b/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql
index 2592c67..1b7cf02 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/field-access-on-open-field.aql
@@ -13,7 +13,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", "address": { "zip": 92617} });
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/10.aql b/asterix-app/src/test/resources/runtimets/queries/scan/10.aql
index 2d71d87..b255178 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/10.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/10.aql
@@ -12,7 +12,7 @@
 }
 
 create dataset DBLP1(DBLPType) 
-  partitioned by key id;
+  primary key id;
 
 // drop dataset DBLP1;
 load dataset DBLP1
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/20.aql b/asterix-app/src/test/resources/runtimets/queries/scan/20.aql
index 675f26d..17da0b0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/20.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/20.aql
@@ -13,7 +13,7 @@
 }
 
 create dataset DBLPadm(DBLPType) 
-  partitioned by key id;
+  primary key id;
 
 // drop dataset DBLPadm;
 load dataset DBLPadm 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql
index ff04a36..86c8430 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_1.aql
@@ -21,7 +21,7 @@
 }
 
 create dataset DBLPadm(DBLPType) 
-  partitioned by key id;
+  primary key id;
 
 // drop dataset DBLPadm;
 load dataset DBLPadm 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql
index 297e2f2..7dd319a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/issue238_query_2.aql
@@ -21,7 +21,7 @@
 }
 
 create dataset DBLPadm(DBLPType) 
-  partitioned by key id;
+  primary key id;
 
 // drop dataset DBLPadm;
 load dataset DBLPadm 
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02.aql b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02.aql
index ea06b96..0997e4f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/spatial_types_02.aql
@@ -12,7 +12,7 @@
 }
 
 create dataset Spatial2(SpatialType) 
-	partitioned by key id;
+	primary key id;
 
 load dataset Spatial2 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02.aql b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02.aql
index 064385c..a8654bd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/temp_types_02.aql
@@ -11,7 +11,7 @@
 }
 
 create dataset Temp2(TempType) 
-	partitioned by key id;
+	primary key id;
 
 load dataset Temp2 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance.aql
index d3eed71..3d6dee4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-edit-distance.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard.aql
index 0c11edb..1bef743 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/fuzzyeq-similarity-jaccard.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query.aql
index 01bea0b..836fdb6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-check_query.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query.aql
index aa5b067..ba3b85e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query.aql
index a2373af..25cb071 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query.aql
index 05f3a61..20afc67 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset DBLP(DBLPType) 
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset DBLP 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/cell-aggregation-with-filtering.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/cell-aggregation-with-filtering.aql
index 0face3b..81b8bd2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/spatial/cell-aggregation-with-filtering.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/cell-aggregation-with-filtering.aql
@@ -13,7 +13,7 @@
 create nodegroup group1 if not exists on nc1, nc2;
 
 create dataset TwitterData(Tweet)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 
 load dataset TwitterData 
diff --git a/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql b/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
index e755aa9..3fe1355 100644
--- a/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/spatial/create-rtree-index.aql
@@ -17,7 +17,7 @@
   circle: circle
 }
 
-create dataset MyData(SpatialType) partitioned by key id;
+create dataset MyData(SpatialType) primary key id;
 create index rtree_index1 on MyData(point) type rtree;
 create index rtree_index2 on MyData(line1) type rtree;
 create index rtree_index3 on MyData(poly1) type rtree;
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql
index a66b00f..7516bea 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/cpttostr01.aql
@@ -16,7 +16,7 @@
 cpt:[int32]
 }
 
-create dataset testds(TestType) partitioned by key id;
+create dataset testds(TestType) primary key id;
 
 // insert codepoint data into internal dataset testds here into the cpt attribute
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql b/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql
index 832efbc..257d992 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/endwith03.aql
@@ -15,7 +15,7 @@
 name:string
 }
 
-create dataset testds(TestType) partitioned by key name;
+create dataset testds(TestType) primary key name;
 
 insert into dataset testds({"name":"Jim Jones"});
 insert into dataset testds({"name":"Ravi Kumar"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql b/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql
index 2f7b83e..4d9e5b2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/matches05.aql
@@ -16,7 +16,7 @@
 id:int32
 }
 
-create dataset testds1(TestType1) partitioned by key id;
+create dataset testds1(TestType1) primary key id;
 
 insert into dataset testds1({"fname":"Test","lname":"Test","id":123});
 insert into dataset testds1({"fname":"Testa","lname":"Test","id":124});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql b/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
index 8aed603..baa7d0b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
@@ -15,7 +15,7 @@
 name:string
 }
 
-create dataset testds(TestType) partitioned by key name;
+create dataset testds(TestType) primary key name;
 
 insert into dataset testds({"name":"John Smith"});
 insert into dataset testds({"name":"John Doe"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql
index 0b3941d..5266fa1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strconcat01.aql
@@ -17,7 +17,7 @@
 lname:string
 }
 
-create dataset testds(TestType) partitioned by key id;
+create dataset testds(TestType) primary key id;
 
 // insert string data into internal dataset testds into the name attribute
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql b/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql
index bba2a7f..ddff7ed 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/strlen03.aql
@@ -15,7 +15,7 @@
 name:string
 }
 
-create dataset testds(TestType) partitioned by key name;
+create dataset testds(TestType) primary key name;
 
 insert into dataset testds({"name":"Maradona"});
 insert into dataset testds({"name":"Pele"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql
index fbdcba4..1a33fdf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr05.aql
@@ -15,7 +15,7 @@
 name : string
 }
 
-create dataset testdst(TestType) partitioned by key name;
+create dataset testdst(TestType) primary key name;
 
 insert into dataset testdst({"name":"UC Berkeley"});
 insert into dataset testdst({"name":"UC Irvine"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql b/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql
index 82d21c2..bfeff2d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/substr06.aql
@@ -14,7 +14,7 @@
 name : string
 }
 
-create dataset testdst(TestType) partitioned by key name;
+create dataset testdst(TestType) primary key name;
 
 insert into dataset testdst({"name":"UC Berkeley"});
 insert into dataset testdst({"name":"UC Irvine"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql
index 411dacf..301af52 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/toLowerCase03.aql
@@ -17,7 +17,7 @@
 name:string
 }
 
-create dataset testds(TestType) partitioned by key name;
+create dataset testds(TestType) primary key name;
 
 insert into dataset testds({"name":"Maradona"});
 insert into dataset testds({"name":"Pele"});
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by.aql
index 95d715e..3e41042 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/distinct_by.aql
@@ -24,7 +24,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg.aql
index dedaa7f..8b941e4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/group_no_agg.aql
@@ -10,7 +10,7 @@
 }
 
 create dataset Regions_group_no_agg(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 
 write output to nc1:"rttest/tpch_group_no_agg.adm";
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item.aql
index 3b641a4..b775f09 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item.aql
@@ -89,21 +89,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64.aql
index cfac014..27fa512 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q10_returned_item_int64.aql
@@ -89,21 +89,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock.aql
index 245c7f5..9e4b165 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q11_important_stock.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping.aql
index 9dcade8..b541615 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q12_shipping.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution.aql
index 9a91177..c4a987a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q13_customer_distribution.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect.aql
index a38b1d6..4ea7988 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q14_promotion_effect.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier.aql
index 49b0c03..29830a9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q15_top_supplier.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship.aql
index ad16d3c..978fb0f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q16_parts_supplier_relationship.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue.aql
index 05cf693..92e4083 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q17_small_quantity_order_revenue.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer.aql
index 1347ff5..9ab4f83 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q18_large_volume_customer.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue.aql
index b856eed..c83f663 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql
index af39b3f..b6de1fa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt.aql
@@ -22,7 +22,7 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion.aql
index bdb591f..2143cfa 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q20_potential_part_promotion.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting.aql
index f544e09..32cf149 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q21_suppliers_who_kept_orders_waiting.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity.aql
index 29131c8..b2ac2d0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q22_global_sales_opportunity.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier.aql
index 5490213..c5e17d6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q2_minimum_cost_supplier.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt.aql
index 68fb864..c3fcc25 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q3_shipping_priority_nt.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority.aql
index 3f1c7ec..6d755d2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q4_order_priority.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume.aql
index d345b3b..e64d98a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q5_local_supplier_volume.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change.aql
index 3ca0424..dee85bb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q6_forecast_revenue_change.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping.aql
index c91eca5..6432361 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q7_volume_shipping.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share.aql
index 420a179..2e0eefb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q8_national_market_share.aql
@@ -90,21 +90,21 @@
 }
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset Partsupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt.aql
index 33c2aad..21cdcdd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q9_product_type_profit_nt.aql
@@ -91,21 +91,21 @@
 
 
 create dataset LineItem(LineItemType)
-  partitioned by key l_orderkey, l_linenumber;
+  primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)
-  partitioned by key o_orderkey;
+  primary key o_orderkey;
 create dataset Supplier(SupplierType)
-  partitioned by key s_suppkey;
+  primary key s_suppkey;
 create dataset Region(RegionType) 
-  partitioned by key r_regionkey;
+  primary key r_regionkey;
 create dataset Nation(NationType) 
-  partitioned by key n_nationkey;
+  primary key n_nationkey;
 create dataset Part(PartType)
-  partitioned by key p_partkey;
+  primary key p_partkey;
 create dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey;  
+  primary key ps_partkey, ps_suppkey;  
 create dataset Customer(CustomerType) 
-  partitioned by key c_custkey;
+  primary key c_custkey;
 
 load dataset LineItem 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql
index b16e2dd..8a09ea2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/udf09.aql
@@ -13,7 +13,7 @@
 id : int32
 }
 
-create dataset test.t1(TestType) partitioned by key id;
+create dataset test.t1(TestType) primary key id;
 
 insert into dataset test.t1({"id":345});
 insert into dataset test.t1({"id":315});
diff --git a/asterix-app/src/test/resources/spatial/local/spatial-drop.aql b/asterix-app/src/test/resources/spatial/local/spatial-drop.aql
index 61d4913..fc881ad 100644
--- a/asterix-app/src/test/resources/spatial/local/spatial-drop.aql
+++ b/asterix-app/src/test/resources/spatial/local/spatial-drop.aql
@@ -11,6 +11,6 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset MyData(MyRecord)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 drop dataset MyData;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/spatial/local/spatial-load.aql b/asterix-app/src/test/resources/spatial/local/spatial-load.aql
index 6c135f3..1df33c0 100644
--- a/asterix-app/src/test/resources/spatial/local/spatial-load.aql
+++ b/asterix-app/src/test/resources/spatial/local/spatial-load.aql
@@ -11,7 +11,7 @@
 set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
 
 declare dataset MyData(MyRecord)
-  partitioned by key id on group1;
+  primary key id on group1;
 
 load dataset MyData 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/enlist_data.aql b/asterix-app/src/test/resources/tpch/queries/asterix/enlist_data.aql
index 2eb06f5..b0396f9 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/enlist_data.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/enlist_data.aql
@@ -89,21 +89,21 @@
   asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 enlist dataset Customers;
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/inlined_q18_large_volume_customer.aql b/asterix-app/src/test/resources/tpch/queries/asterix/inlined_q18_large_volume_customer.aql
index 1ac9c1c..bb21d7e 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/inlined_q18_large_volume_customer.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/inlined_q18_large_volume_customer.aql
@@ -46,11 +46,11 @@
       asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to asterix-001:"/tmp/inlined_q18_large_volume_customer.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/load_data_adm.aql b/asterix-app/src/test/resources/tpch/queries/asterix/load_data_adm.aql
index e4b3a3b..7b872f0 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/load_data_adm.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/load_data_adm.aql
@@ -89,21 +89,21 @@
   asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 load dataset LineItems 
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_100x.aql b/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_100x.aql
index 1d40ba7..c4ccbe0 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_100x.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_100x.aql
@@ -89,21 +89,21 @@
   asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 load dataset Customers 
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_1x.aql b/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_1x.aql
index bb4a49d..654dcb6 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_1x.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/load_data_tbl_1x.aql
@@ -89,21 +89,21 @@
   asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 load dataset Customers 
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/q1_pricing_summary_report.aql b/asterix-app/src/test/resources/tpch/queries/asterix/q1_pricing_summary_report.aql
index b29e7a6..411fdbb 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/q1_pricing_summary_report.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/q1_pricing_summary_report.aql
@@ -23,7 +23,7 @@
       asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 
 write output to asterix-001:"/home/onose/hyracks-asterix/results/q1_pricing_summary_report.adm";
  
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/q3_shipping_priority.aql b/asterix-app/src/test/resources/tpch/queries/asterix/q3_shipping_priority.aql
index 71ed6db..6f52101 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/q3_shipping_priority.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/q3_shipping_priority.aql
@@ -46,11 +46,11 @@
       asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to asterix-001:"/home/onose/hyracks-asterix/results/q3_shipping_priority.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/q5_local_supplier_volume.aql b/asterix-app/src/test/resources/tpch/queries/asterix/q5_local_supplier_volume.aql
index 8d0d6dd..7544d19 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/q5_local_supplier_volume.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/q5_local_supplier_volume.aql
@@ -69,17 +69,17 @@
       asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
   
 write output to asterix-001:"/home/onose/hyracks-asterix/results/q5_local_supplier.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/asterix/q9_product_type_profit.aql b/asterix-app/src/test/resources/tpch/queries/asterix/q9_product_type_profit.aql
index 3067fbe..164869a 100644
--- a/asterix-app/src/test/resources/tpch/queries/asterix/q9_product_type_profit.aql
+++ b/asterix-app/src/test/resources/tpch/queries/asterix/q9_product_type_profit.aql
@@ -73,17 +73,17 @@
       asterix-005, asterix-006, asterix-007, asterix-008, asterix-009, asterix-010;
       
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
   
 write output to asterix-001:"/home/onose/hyracks-asterix/results/q9_product_type_profit.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/inlined_q18_large_volume_customer.aql b/asterix-app/src/test/resources/tpch/queries/local/inlined_q18_large_volume_customer.aql
index abd06af..280a1d0 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/inlined_q18_large_volume_customer.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/inlined_q18_large_volume_customer.aql
@@ -45,11 +45,11 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/tmp/inlined_q18_large_volume_customer.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/load_adm_data.aql b/asterix-app/src/test/resources/tpch/queries/local/load_adm_data.aql
index b7e5b3d..d31c421 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/load_adm_data.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/load_adm_data.aql
@@ -88,21 +88,21 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 load dataset LineItems 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_0.001x_2nodes.aql b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_0.001x_2nodes.aql
index 0d03e5d..47724fa 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_0.001x_2nodes.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_0.001x_2nodes.aql
@@ -88,21 +88,21 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 load dataset LineItems 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_10x_1node.aql b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_10x_1node.aql
index 7c8fc8c..49e2a9a 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_10x_1node.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_10x_1node.aql
@@ -88,21 +88,21 @@
 declare nodegroup group1 on nc1;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 load dataset LineItems 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_1x_1node.aql b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_1x_1node.aql
index b6cf6f8..3e6ccc4 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_1x_1node.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_1x_1node.aql
@@ -88,21 +88,21 @@
 declare nodegroup group1 on nc1;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 load dataset LineItems 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_20x_2node.aql b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_20x_2node.aql
index 606cde1..f44d388 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_20x_2node.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/load_tbl_data_20x_2node.aql
@@ -88,21 +88,21 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 load dataset LineItems 
 using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
diff --git a/asterix-app/src/test/resources/tpch/queries/local/orders-index-create.aql b/asterix-app/src/test/resources/tpch/queries/local/orders-index-create.aql
index e369f10..9c5e361 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/orders-index-create.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/orders-index-create.aql
@@ -17,6 +17,6 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 create index idx_Orders_Custkey on Orders(o_custkey);
diff --git a/asterix-app/src/test/resources/tpch/queries/local/orders-index-search.aql b/asterix-app/src/test/resources/tpch/queries/local/orders-index-search.aql
index f4c9fd9..66e88a5 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/orders-index-search.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/orders-index-search.aql
@@ -17,7 +17,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 
 declare index idx_Orders_Custkey on Orders(o_custkey);
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/q1_pricing_summary_report.aql b/asterix-app/src/test/resources/tpch/queries/local/q1_pricing_summary_report.aql
index a69528c..9ab0322 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/q1_pricing_summary_report.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/q1_pricing_summary_report.aql
@@ -22,7 +22,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 
 // for external datasets, use:
 //
diff --git a/asterix-app/src/test/resources/tpch/queries/local/q3_shipping_priority.aql b/asterix-app/src/test/resources/tpch/queries/local/q3_shipping_priority.aql
index b5c27cc..cadc5c9 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/q3_shipping_priority.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/q3_shipping_priority.aql
@@ -45,11 +45,11 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 
 write output to nc1:"/tmp/q3_shipping_priority.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/q5_local_supplier_volume.aql b/asterix-app/src/test/resources/tpch/queries/local/q5_local_supplier_volume.aql
index 9fe2ed6..724d58b 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/q5_local_supplier_volume.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/q5_local_supplier_volume.aql
@@ -68,17 +68,17 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
   
 write output to nc1:"/tmp/q5_local_supplier_volume.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/q9_product_type_profit.aql b/asterix-app/src/test/resources/tpch/queries/local/q9_product_type_profit.aql
index c0643b1..5407270 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/q9_product_type_profit.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/q9_product_type_profit.aql
@@ -72,17 +72,17 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
   
 write output to nc1:"/tmp/q9_product_type_profit.adm";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/scan_filter_lineitem.aql b/asterix-app/src/test/resources/tpch/queries/local/scan_filter_lineitem.aql
index 3855746..ccddad0 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/scan_filter_lineitem.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/scan_filter_lineitem.aql
@@ -22,7 +22,7 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 
 // load dataset LineItems from nc1:"/opt/tpch/tengigs/lineitem.tbl" delimited by "|";
 
diff --git a/asterix-app/src/test/resources/tpch/queries/local/write-custorder.aql b/asterix-app/src/test/resources/tpch/queries/local/write-custorder.aql
index 9757ff8..b767d57 100644
--- a/asterix-app/src/test/resources/tpch/queries/local/write-custorder.aql
+++ b/asterix-app/src/test/resources/tpch/queries/local/write-custorder.aql
@@ -50,13 +50,13 @@
 declare nodegroup group1 on nc1, nc2;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset CustOrder(CustOrderType)
-  partitioned by key co_custkey on group1;
+  primary key co_custkey on group1;
 
 write into dataset CustOrder 
 ( for $c in dataset('Customers')
diff --git a/asterix-app/src/test/resources/tpch/queries/rainbow/load_data_tbl_50x.aql b/asterix-app/src/test/resources/tpch/queries/rainbow/load_data_tbl_50x.aql
index 9635891..7d0295d 100644
--- a/asterix-app/src/test/resources/tpch/queries/rainbow/load_data_tbl_50x.aql
+++ b/asterix-app/src/test/resources/tpch/queries/rainbow/load_data_tbl_50x.aql
@@ -89,21 +89,21 @@
 rainbow-04, rainbow-05;
 
 declare dataset LineItems(LineItemType)
-  partitioned by key l_orderkey, l_linenumber on group1;
+  primary key l_orderkey, l_linenumber on group1;
 declare dataset Orders(OrderType)
-  partitioned by key o_orderkey on group1;
+  primary key o_orderkey on group1;
 declare dataset Customers(CustomerType) 
-  partitioned by key c_custkey on group1;
+  primary key c_custkey on group1;
 declare dataset Suppliers(SupplierType)
-  partitioned by key s_suppkey on group1;
+  primary key s_suppkey on group1;
 declare dataset Nations(NationType) 
-  partitioned by key n_nationkey on group1;
+  primary key n_nationkey on group1;
 declare dataset Regions(RegionType)
-  partitioned by key r_regionkey on group1;
+  primary key r_regionkey on group1;
 declare dataset Parts(PartType)
-  partitioned by key p_partkey on group1;
+  primary key p_partkey on group1;
 declare dataset PartSupp(PartSuppType)
-  partitioned by key ps_partkey, ps_suppkey on group1;  
+  primary key ps_partkey, ps_suppkey on group1;  
 
 
 load dataset Customers from