blob: 587fa4d2b1cf5cdd15023fd5c2fcc572698a3626 [file] [log] [blame]
use dataverse demo1112;
declare type CustomerType as closed {
cid: int32,
name: string,
budget: int32,
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,
hoList: [int32]
}
declare nodegroup group1 on nc1, nc2;
set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat";
declare dataset Customers(CustomerType)
primary key cid on group1;
declare dataset Orders(OrderType)
primary key oid on group1;
write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_join_1.adm";
for $c in dataset('Customers')
for $o in dataset('Orders')
where $c.cid = $o.cid
return {"cust":$c.name, "custage": $c.age, "ordertot":$o.total, "ordertot":[$o.oid, $o.cid], "unordertot":{{$o.oid, $o.cid}}}