khfaraaz82@gmail.com | 71e7148 | 2012-08-18 00:25:07 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Description : BTree Index verification (usage) test |
| 3 | * : This test is intended to verify that the primary 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 | |
| 9 | drop dataverse test if exists; |
| 10 | create dataverse test; |
| 11 | use dataverse test; |
| 12 | |
| 13 | write output to nc1:"rttest/btree-index_btree-primary-20.adm"; |
| 14 | |
| 15 | create type TestType as open { |
| 16 | fname : string, |
| 17 | lname : string |
| 18 | } |
| 19 | |
| 20 | // create internal dataset with primary index defined on fname,lname fields |
| 21 | create dataset testdst(TestType) partitioned by key fname,lname; |
| 22 | |
| 23 | // load valid data with fname and lname entries |
| 24 | |
| 25 | load dataset testdst |
| 26 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 27 | (("path"="nc1://data/fn-ln.adm"),("format"="delimited-text"),("delimiter"="|")); |
| 28 | |
| 29 | // Query the data that was loaded above. |
| 30 | |
| 31 | for $emp in dataset('testdst') |
| 32 | where $emp.fname >= "Craig" and $emp.lname >= "Kevin" and $emp.fname < "Mary" and $emp.lname < "Tomes" |
| 33 | return $emp |