blob: 9bd5b5ac47a0e14afe016324db14d7cc8a8a0d9a [file] [log] [blame]
khfaraaz82@gmail.com552e4c82012-08-19 07:37:50 +00001/*
2 * Description : BTree Index verification (usage) test
3 * : This test is intended to verify that the secondary BTree index is used
4 * : in the optimized query plan for predicates like (predicate1 and predicate2 and predicate3 and predicate4).
5 * Expected Result : Success
6 * Date : 13th Aug 2012
7 */
8
9drop dataverse test if exists;
10create dataverse test;
11use dataverse test;
12
13write output to nc1:"rttest/btree-index_btree-secondary-50.adm";
14
15create type TestType as open {
16 id : int32,
17 fname : string,
18 lname : string
19}
20
21// create internal dataset
22create dataset testdst(TestType) partitioned by key id;
23
24// create secondary index
25create index sec_Idx on testdst(fname,lname);
26
27// load valid data with fname and lname entries
28
29load dataset testdst
30using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
31(("path"="nc1://data/id-fn-ln.adm"),("format"="delimited-text"),("delimiter"="|"));
32
33// Query the data that was loaded above.
34
35for $emp in dataset('testdst')
36where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes"
37return $emp