RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Decription : Create UDF to query two different datasets that are in tow different dataverses. |
| 3 | * Expected Res : Success |
| 4 | * Date : Sep 7 2012 |
| 5 | */ |
| 6 | |
| 7 | // this test currently gives ParseException |
| 8 | |
| 9 | drop dataverse test if exists; |
| 10 | drop dataverse fest if exists; |
| 11 | |
| 12 | create dataverse test; |
| 13 | create dataverse fest; |
| 14 | |
| 15 | create type test.testtype as open { |
| 16 | id : int32 |
| 17 | } |
| 18 | |
| 19 | create type fest.testtype as open { |
| 20 | id : int32 |
| 21 | } |
| 22 | |
| 23 | create dataset test.t1(testtype) partitioned by key id; |
| 24 | create dataset fest.t1(testtype) partitioned by key id; |
| 25 | |
| 26 | insert into dataset test.t1({"id":24}); |
| 27 | insert into dataset test.t1({"id":23}); |
| 28 | insert into dataset test.t1({"id":21}); |
| 29 | insert into dataset test.t1({"id":44}); |
| 30 | insert into dataset test.t1({"id":64}); |
| 31 | |
| 32 | insert into dataset fest.t1({"id":24}); |
| 33 | insert into dataset fest.t1({"id":23}); |
| 34 | insert into dataset fest.t1({"id":21}); |
| 35 | insert into dataset fest.t1({"id":44}); |
| 36 | insert into dataset fest.t1({"id":64}); |
| 37 | |
| 38 | create function fest.f1(){ |
| 39 | for $m in dataset('test.t1') |
| 40 | for $l in dataset('fest.t1') |
| 41 | order by $m,$l |
| 42 | return { "l":$l,"m":$m } |
| 43 | } |
| 44 | |
| 45 | write output to nc1:"rttest/cross-dataverse_cross-dv17.adm"; |
| 46 | |
| 47 | fest.f1(); |
| 48 | |