RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Create two UDFs in two different dataverses and create datasets in tose dvs |
| 3 | * : access the datasets from the UDF defined in the other dataverse and invoke one of the UDF |
| 4 | * Expected Res : Success |
| 5 | * Date : Sep 7th 2012 |
| 6 | */ |
| 7 | |
| 8 | // dv1 - udf1 - dataset1 |
| 9 | // dv2 - udf2 - dataset2 |
| 10 | |
| 11 | drop dataverse test if exists; |
| 12 | drop dataverse fest if exists; |
| 13 | |
| 14 | create dataverse test; |
| 15 | create dataverse fest; |
| 16 | |
| 17 | create type test.testtype as open { |
| 18 | id : int32 |
| 19 | } |
| 20 | |
| 21 | create type fest.testtype as open { |
| 22 | id : int32 |
| 23 | } |
| 24 | |
| 25 | create dataset test.t1(testtype) partitioned by key id; |
| 26 | create dataset fest.t1(testtype) partitioned by key id; |
| 27 | |
| 28 | insert into dataset test.t1({"id":24}); |
| 29 | insert into dataset test.t1({"id":23}); |
| 30 | insert into dataset test.t1({"id":21}); |
| 31 | insert into dataset test.t1({"id":44}); |
| 32 | insert into dataset test.t1({"id":64}); |
| 33 | |
| 34 | insert into dataset fest.t1({"id":24}); |
| 35 | insert into dataset fest.t1({"id":23}); |
| 36 | insert into dataset fest.t1({"id":21}); |
| 37 | insert into dataset fest.t1({"id":44}); |
| 38 | insert into dataset fest.t1({"id":64}); |
| 39 | |
| 40 | create function test.f1(){ |
| 41 | for $l in dataset('fest.t1') |
| 42 | return $l |
| 43 | } |
| 44 | |
| 45 | create function fest.f1(){ |
| 46 | for $m in dataset('test.t1') |
| 47 | return $m |
| 48 | } |
| 49 | |
| 50 | let $a := test.f1() |
| 51 | let $b := fest.f1() |
| 52 | return { "a" : $a, "b" : $b } |