alexander.behm | 812d3ae | 2012-05-13 07:07:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Test case Name : scan-delete-btree-secondary-index-nullable.aql |
| 3 | * Description : This test is intended to test deletion from secondary btree indexes that are built on nullable fields |
| 4 | * Expected Result : Success |
| 5 | * Date : May 12 2012 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse test if exists; |
| 9 | create dataverse test; |
| 10 | use dataverse test; |
| 11 | |
| 12 | create type AddressType as closed { |
| 13 | number: int32, |
| 14 | street: string, |
| 15 | city: string |
| 16 | } |
| 17 | |
| 18 | create type CustomerType as closed { |
| 19 | cid: int32, |
| 20 | name: string, |
| 21 | age: int32?, |
| 22 | address: AddressType?, |
| 23 | interests: {{string}}, |
| 24 | children: [ { name: string, age: int32? } ] |
| 25 | } |
| 26 | |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 27 | create dataset Customers(CustomerType) primary key cid; |
alexander.behm | 812d3ae | 2012-05-13 07:07:02 +0000 | [diff] [blame] | 28 | |
| 29 | load dataset Customers |
| 30 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 31 | (("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm")); |
| 32 | |
| 33 | create index age_index on Customers(age); |
| 34 | |
| 35 | delete $c from dataset Customers where $c.cid>=200; |
| 36 | |
| 37 | write output to nc1:"rttest/dml_scan-delete-btree-secondary-index-nullable.adm"; |
| 38 | |
| 39 | for $c in dataset('Customers') |
| 40 | where $c.age < 20 |
| 41 | order by $c.cid |
| 42 | return $c |