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 dataset Customers(CustomerType) partitioned by key cid; | |
load dataset Customers | |
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" | |
(("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm")); | |
create index age_index on Customers(age); | |
write output to nc1:"rttest/index-selection_cust-index-age-nullable.adm"; | |
for $c in dataset('Customers') | |
where $c.age < 20 | |
order by $c.cid | |
return $c |