blob: dcbea098d6337fe8ab1d521a013168017e0f97fd [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001use dataverse demo1112;
2
3declare type CustomerType as open {
4 cid: int32,
5 name: string,
6 age: int32?,
7 address: AddressType?,
8 lastorder: {
9 oid: int32,
10 total: float
11 }
12}
13
14declare type AddressType as open {
15 number: int32,
16 street: string,
17 city: string
18}
19
20
21declare type OrderType as open {
22 oid: int32,
23 cid: int32,
24 orderstatus: string,
25 orderpriority: string,
26 clerk: string,
27 total: float
28}
29
30declare nodegroup group1 on rainbow-01, rainbow-02, rainbow-03, rainbow-04, rainbow-05;
31
32declare dataset Customers(CustomerType)
33 partitioned by key cid on group1;
34declare dataset Orders(OrderType)
35 partitioned by key oid on group1;
36
37write output to rainbow-01:"/home/onose/hyracks-rainbow/results/custorder.adm";
38
39for $c in dataset('Customers')
40for $o in dataset('Orders')
41where $c.cid = $o.cid and $o.total > 70
42group by $age := $c.age with $c
43return {"custage": $age, "count":count($c)}