blob: 2f7b83ef89a618ab51dd1782e5820fcbf3bf3416 [file] [log] [blame]
khfaraaz82@gmail.comc526fe92012-08-10 22:09:13 +00001/*
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
9drop dataverse test if exists;
10create dataverse test;
11use dataverse test;
12
13create type TestType1 as{
14fname:string,
15lname:string,
16id:int32
17}
18
19create dataset testds1(TestType1) partitioned by key id;
20
21insert into dataset testds1({"fname":"Test","lname":"Test","id":123});
22insert into dataset testds1({"fname":"Testa","lname":"Test","id":124});
23insert into dataset testds1({"fname":"Test1","lname":"Test1","id":125});
24insert into dataset testds1({"fname":"Test","lname":"Testb","id":126});
25insert into dataset testds1({"fname":"Test2","lname":"Test2","id":127});
26
27write output to nc1:"rttest/string_matches05.adm";
28
29//Perform the match for fname and lname
30for $l in dataset('testds1')
31order by $l.id
32where matches($l.fname,$l.lname)
33return $l
34