Added asterix project
git-svn-id: https://asterixdb.googlecode.com/svn/trunk/asterix@12 eaa15691-b419-025a-1212-ee371bd00084
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
new file mode 100644
index 0000000..8d764c3
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/local/01-load-cust.aql
@@ -0,0 +1,28 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+declare nodegroup group1 on nc1, nc2;
+
+declare dataset Customers(CustomerType)
+ partitioned by key cid on group1;
+
+load dataset Customers
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1:///tmp/customerData.adm"),("format"="json")) pre-sorted;
+
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
new file mode 100644
index 0000000..24c5827
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/local/02-filter-cust.aql
@@ -0,0 +1,30 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+declare nodegroup group1 on nc1, nc2;
+
+declare dataset Customers(CustomerType)
+ partitioned by key cid on group1;
+
+write output to nc1:"/tmp/mycustomers.adm";
+
+for $c in dataset('Customers')
+where $c.age < 21
+// where $c.name = 'Noreen Doe'
+ return { "custname":$c.name }
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
new file mode 100644
index 0000000..7db4f4e
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/local/03-load-ord.aql
@@ -0,0 +1,19 @@
+use dataverse demo1112;
+
+declare type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+declare nodegroup group1 on nc1, nc2;
+
+declare dataset Orders(OrderType)
+ partitioned by key oid on group1;
+
+load dataset Orders
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1:///tmp/orderData.adm"),("format"="adm")) pre-sorted;
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
new file mode 100644
index 0000000..1238e7e
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/local/04-join-custord.aql
@@ -0,0 +1,42 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+
+declare type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+declare nodegroup group1 on nc1, nc2;
+
+declare dataset Customers(CustomerType)
+ partitioned by key cid on group1;
+declare dataset Orders(OrderType)
+ partitioned by key oid on group1;
+
+write output to nc1:"/tmp/custorder.adm";
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid = $o.cid and $c.age < 21
+return {"cust":$c.name, "custage": $c.age, "ordertot":$o.total}
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
new file mode 100644
index 0000000..ccb959d
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/rainbow/01-load-cust.aql
@@ -0,0 +1,26 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
+
+declare dataset Customers(CustomerType)
+ partitioned by 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
new file mode 100644
index 0000000..2c08f34
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/rainbow/02-filter-cust.aql
@@ -0,0 +1,30 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
+
+declare dataset Customers(CustomerType)
+ partitioned by key cid on group1;
+
+write output to rainbow-01:"/home/onose/hyracks-rainbow/results/mycustomers.adm";
+
+for $c in dataset('Customers')
+// where $c.age < 21
+where $c.name = 'Noreen Doe'
+ return $c
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
new file mode 100644
index 0000000..1329aa4
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/rainbow/03-load-ord.aql
@@ -0,0 +1,17 @@
+use dataverse demo1112;
+
+declare type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
+
+declare dataset Orders(OrderType)
+ partitioned by 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
new file mode 100644
index 0000000..63c4670
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/rainbow/04-join-custord.aql
@@ -0,0 +1,42 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+
+declare type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
+
+declare dataset Customers(CustomerType)
+ partitioned by key cid on group1;
+declare dataset Orders(OrderType)
+ partitioned by key oid on group1;
+
+write output to rainbow-01:"/home/onose/hyracks-rainbow/results/custorder.adm";
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid = $o.cid and $c.age < 21
+return {"cust":$c.name, "custage": $c.age, "ordertot":$o.total}
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
new file mode 100644
index 0000000..dcbea09
--- /dev/null
+++ b/asterix-app/src/test/resources/demo1112/rainbow/05-count-custord.aql
@@ -0,0 +1,43 @@
+use dataverse demo1112;
+
+declare type CustomerType as open {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ lastorder: {
+ oid: int32,
+ total: float
+ }
+}
+
+declare type AddressType as open {
+ number: int32,
+ street: string,
+ city: string
+}
+
+
+declare type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float
+}
+
+declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
+
+declare dataset Customers(CustomerType)
+ partitioned by key cid on group1;
+declare dataset Orders(OrderType)
+ partitioned by key oid on group1;
+
+write output to rainbow-01:"/home/onose/hyracks-rainbow/results/custorder.adm";
+
+for $c in dataset('Customers')
+for $o in dataset('Orders')
+where $c.cid = $o.cid and $o.total > 70
+group by $age := $c.age with $c
+return {"custage": $age, "count":count($c)}
\ No newline at end of file