blob: dde8892664a657c1627bf549f60b85c234e6fd97 [file] [log] [blame]
alexander.behm812d3ae2012-05-13 07:07:02 +00001/*
2 * Test case Name : scan-delete-btree-secondary-index-nullable.aql
3 * Description : This test is intended to test insertion into secondary btree indexes that are built on nullable fields
4 * Expected Result : Success
5 * Date : May 12 2012
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
12create type AddressType as closed {
13 number: int32,
14 street: string,
15 city: string
16}
17
18create 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
ramangrover29669d8f62013-02-11 06:03:32 +000027create dataset Customers(CustomerType) primary key cid;
28create dataset CustomersMini(CustomerType) primary key cid;
alexander.behm812d3ae2012-05-13 07:07:02 +000029
30load dataset Customers
31using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
32(("path"="nc1://data/semistructured/co1k/customer.adm"),("format"="adm"));
33
34create index age_index on CustomersMini(age);
35
36insert into dataset CustomersMini
37(
38 for $c in dataset('Customers')
39 where $c.cid < 200
40 return {
41 "cid": $c.cid,
42 "name": $c.name,
43 "age": $c.age,
44 "address": $c.address,
45 "interests": $c.interests,
46 "children": $c.children
47 }
48);
49
50write output to nc1:"rttest/dml_scan-insert-btree-secondary-index-nullable.adm";
51
52for $c in dataset('CustomersMini')
53where $c.age < 20
54order by $c.cid
55return $c