khfaraaz82@gmail.com | c526fe9 | 2012-08-10 22:09:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Testcase Name : matches05.aql |
| 3 | * Description : Positive tests |
| 4 | * : Create two internal datasets and insert string data and perform match of fname using matches function. |
| 5 | * Success : Yes |
| 6 | * Date : 25th April 2012 |
| 7 | */ |
| 8 | |
| 9 | drop dataverse test if exists; |
| 10 | create dataverse test; |
| 11 | use dataverse test; |
| 12 | |
| 13 | create type TestType1 as{ |
| 14 | fname:string, |
| 15 | lname:string, |
| 16 | id:int32 |
| 17 | } |
| 18 | |
| 19 | create dataset testds1(TestType1) partitioned by key id; |
| 20 | |
| 21 | insert into dataset testds1({"fname":"Test","lname":"Test","id":123}); |
| 22 | insert into dataset testds1({"fname":"Testa","lname":"Test","id":124}); |
| 23 | insert into dataset testds1({"fname":"Test1","lname":"Test1","id":125}); |
| 24 | insert into dataset testds1({"fname":"Test","lname":"Testb","id":126}); |
| 25 | insert into dataset testds1({"fname":"Test2","lname":"Test2","id":127}); |
| 26 | |
| 27 | write output to nc1:"rttest/string_matches05.adm"; |
| 28 | |
| 29 | //Perform the match for fname and lname |
| 30 | for $l in dataset('testds1') |
| 31 | order by $l.id |
| 32 | where matches($l.fname,$l.lname) |
| 33 | return $l |
| 34 | |