| 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?, |
| interests: {{string}}, |
| children: [ { name: string, age: int32? } ] |
| } |
| |
| |
| create external dataset Customers(CustomerType) |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm")); |
| |
| write output to nc1:"rttest/semistructured_count-nullable.adm"; |
| |
| for $c in dataset('Customers') |
| group by $age := $c.age with $c |
| order by $age |
| return { "custage": $age, "count": count($c) } |