| drop dataverse test if exists; |
| |
| create dataverse test; |
| use dataverse test; |
| |
| create type AddressType as open { |
| number: int32, |
| street: string, |
| city: string |
| } |
| |
| create type CustomerType as open { |
| cid: int32, |
| name: string, |
| age: int32?, |
| address: AddressType?, |
| lastorder: { |
| oid: int32, |
| total: float |
| } |
| } |
| |
| create dataset c1(CustomerType) |
| partitioned by key cid; |
| create dataset c2(CustomerType) |
| partitioned by key cid; |
| |
| load dataset c1 |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/custord-tiny/customer-tiny.adm"),("format"="adm")) pre-sorted; |
| |
| |
| write into dataset c2 ( |
| |
| for $c in dataset('c1') |
| return $c |
| |
| ); |
| |
| |
| write output to nc1:"rttest/custord_load-test.adm"; |
| |
| for $c in dataset('c2') |
| order by $c.cid |
| return $c |
| |
| |
| // write output to nc1:"rttest/denorm-cust-order_01.adm"; |
| |
| |
| |