blob: 0a0945e1d4e394326ad26d09f284685f8c788283 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
2create dataverse test;
3use dataverse test;
4
5
6create type AddressType as open {
7 number: int32,
8 street: string,
9 city: string
10}
11
12create 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
vinayakb38b7ca42012-03-05 05:44:15 +000022create external dataset Customers(CustomerType)
23using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
24(("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm"));
25
26write output to nc1:"rttest/semistructured_count-nullable.adm";
27
28for $c in dataset('Customers')
29group by $age := $c.age with $c
30order by $age
31return { "custage": $age, "count": count($c) }