vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse custord if exists; |
| 2 | create dataverse custord; |
| 3 | use dataverse custord; |
| 4 | |
| 5 | |
| 6 | create type AddressType as open { |
| 7 | number: int32, |
| 8 | street: string, |
| 9 | city: string |
| 10 | } |
| 11 | |
| 12 | create type CustomerType as open { |
| 13 | cid: int32, |
| 14 | name: string, |
| 15 | age: int32?, |
| 16 | address: AddressType?, |
| 17 | lastorder: { |
| 18 | oid: int32, |
| 19 | total: float |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | |
| 24 | create nodegroup group1 if not exists on nc1, nc2; |
| 25 | |
| 26 | create dataset Customers(CustomerType) |
| 27 | partitioned by key cid on group1; |
| 28 | |
| 29 | load dataset Customers |
| 30 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 31 | (("path"="nc1://data/custord-tiny/customer-tiny.adm"),("format"="adm")) pre-sorted; |