blob: 46b2403b152d50ad7fcd44dfb7dd53b4ee946eac [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 nc1, nc2;
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 nc1:"/tmp/split01.adm";
38
39let $os := for $o in dataset('Orders') return $o
40for $o1 in $os
41for $o2 in $os
42where $o1.cid = $o2.cid
43return { "o1": $o1.oid, "o2": $o2.oid, "cid": $o1.cid }