| drop dataverse test if exists; |
| create type AddressType as open { |
| create type CustomerType as open { |
| 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 |
| return { "custage": $age, "count": count($c) } |