blob: 90d4cb994fc8205c2d74c20c2e0f427e74e05c5b [file] [log] [blame]
salsubaiee3c59d762013-02-06 09:10:05 +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 > "Mattocks" and
5 * $l.fname <= "Micco" and $l.lname < "Vangieson"
6 * Expected Result : Success
7 * Issue : Issue 174
8 * Date : 5th Feb, 2013
9 */
10
11drop dataverse test if exists;
12create dataverse test;
13use dataverse test;
14
15create type Emp as closed {
16id:int32,
17fname:string,
18lname:string,
19age:int32,
20dept:string
21}
22
kisskysf4c33242013-03-13 06:11:01 +000023create dataset employee(Emp) primary key id;
salsubaiee3c59d762013-02-06 09:10:05 +000024
25load dataset employee
26using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
27(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
28
29create index idx_employee_f_l_name on employee(fname,lname);
30
31write output to nc1:"rttest/index-selection_btree-index-composite-key-mixed-intervals.adm";
32
33for $l in dataset('employee')
34where $l.fname > "Julio" and $l.lname > "Mattocks" and $l.fname <= "Micco" and $l.lname < "Vangieson"
35order by $l.id
36return $l
37