alexander.behm | 42d11e8 | 2012-05-06 09:25:34 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | create dataverse test; |
| 3 | use dataverse test; |
| 4 | |
| 5 | create type AddressType as open { |
| 6 | number: int32, |
| 7 | street: string, |
| 8 | city: string |
| 9 | } |
| 10 | |
| 11 | create 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 | |
| 20 | create dataset Customers(CustomerType) partitioned by key cid; |
| 21 | |
| 22 | load dataset Customers |
| 23 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 24 | (("path"="nc1://data/semistructured/tiny01/customer.adm"),("format"="adm")); |
| 25 | |
| 26 | create index age_index on Customers(age); |
| 27 | |
alexander.behm | c576c60 | 2012-07-06 02:41:15 +0000 | [diff] [blame] | 28 | write output to nc1:"rttest/index-selection_cust-index-age-nullable.adm"; |
alexander.behm | 42d11e8 | 2012-05-06 09:25:34 +0000 | [diff] [blame] | 29 | |
| 30 | for $c in dataset('Customers') |
| 31 | where $c.age < 20 |
| 32 | order by $c.cid |
| 33 | return $c |