blob: 460a21203a2acc2705cfb8b12e5cde038c2fe406 [file] [log] [blame]
alexander.behm42d11e82012-05-06 09:25:34 +00001drop dataverse test if exists;
2create dataverse test;
3use dataverse test;
4
5create type AddressType as open {
6 number: int32,
7 street: string,
8 city: string
9}
10
11create type CustomerType as open {
12 cid: int32,
13 name: string,
14 age: int32?,
15 address: AddressType?,
16 interests: {{string}},
17 children: [ { name: string, age: int32? } ]
18}
19
20create dataset Customers(CustomerType) partitioned by key cid;
21
22load dataset Customers
23using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
24(("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm"));
25
26create index age_index on Customers(age);
27
alexander.behmc576c602012-07-06 02:41:15 +000028write output to nc1:"rttest/index-selection_cust-index-age-nullable.adm";
alexander.behm42d11e82012-05-06 09:25:34 +000029
30for $c in dataset('Customers')
31where $c.age < 20
32order by $c.cid
33return $c