blob: e2ab245c605a7e786f46baca76a059e627f46564 [file] [log] [blame]
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_cust-filter.adm";
for $c in dataset('Customers')
where $c.age < 21
order by $c.cid
return { "custname":$c.name, "custage": $c.age }