vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | create dataverse test; |
| 3 | use dataverse test; |
| 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 | interests: {{string}}, |
| 18 | children: [ { name: string, age: int32? } ] |
| 19 | } |
| 20 | |
| 21 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 22 | create external dataset Customers(CustomerType) |
| 23 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 24 | (("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm")); |
| 25 | |
| 26 | write output to nc1:"rttest/semistructured_count-nullable.adm"; |
| 27 | |
| 28 | for $c in dataset('Customers') |
| 29 | group by $age := $c.age with $c |
| 30 | order by $age |
| 31 | return { "custage": $age, "count": count($c) } |