blob: dadb8845f16abce39ec6b63969e832aacf0742cb [file] [log] [blame]
khfaraaz82@gmail.comc51d71d2012-08-07 20:36:21 +00001/*
2 * Description : Test that BTree index is used in query plan
3 * : define the BTree index on a composite key (fname,lanme)
4 * : predicate => where $l.fname="Julio" and $l.lname="Isa"
5 * Expected Result : Success
6 * Issue : Issue 162
7 * Date : 7th August 2012
8 */
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type Emp as closed {
15id:int32,
16fname:string,
17lname:string,
18age:int32,
19dept:string
20}
21
22create dataset employee(Emp) partitioned by key id;
23
24load dataset employee
25using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
26(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
27
28create index idx_employee_f_l_name on employee(fname,lname);
29
30write output to nc1:"rttest/index-selection_btree-index-composite-key.adm";
31
32for $l in dataset('employee')
33where $l.fname="Julio" and $l.lname="Isa"
34return $l
35