| 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 nodegroup group1 on nc1, nc2; |
| |
| set format "edu.uci.ics.asterix.runtime.formats.nontagged.NonTaggedDataFormat"; |
| |
| declare dataset Customers(CustomerType) |
| primary key cid on group1; |
| |
| write output to nc1:"/home/yasser/Dropbox/Research/data/results/result_cust_q1.adm"; |
| |
| for $c in dataset('Customers') |
| let $rec := { "budget":$c.budget, "budget+5": $c.budget+5, "budget-5": $c.budget -5, "budget*5": $c.budget*5, "budget/5": $c.budget/ 5, "-budget": -$c.budget} |
| where $c.cid >= int32("3") |
| return { "id": $c.cid, "custname":$c.name, "age" : $c.age, "MathBudget": $rec } |