khfaraaz82@gmail.com | c51d71d | 2012-08-07 20:36:21 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 10 | drop dataverse test if exists; |
| 11 | create dataverse test; |
| 12 | use dataverse test; |
| 13 | |
| 14 | create type Emp as closed { |
| 15 | id:int32, |
| 16 | fname:string, |
| 17 | lname:string, |
| 18 | age:int32, |
| 19 | dept:string |
| 20 | } |
| 21 | |
| 22 | create dataset employee(Emp) partitioned by key id; |
| 23 | |
| 24 | load dataset employee |
| 25 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 26 | (("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|")); |
| 27 | |
| 28 | create index idx_employee_f_l_name on employee(fname,lname); |
| 29 | |
| 30 | write output to nc1:"rttest/index-selection_btree-index-composite-key.adm"; |
| 31 | |
| 32 | for $l in dataset('employee') |
| 33 | where $l.fname="Julio" and $l.lname="Isa" |
| 34 | return $l |
| 35 | |