RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Create UDF to read from internal dataset |
| 3 | * Expected Res : Success |
| 4 | * Date : Sep 4th 2012 |
| 5 | */ |
| 6 | |
| 7 | drop dataverse test if exists; |
| 8 | create dataverse test; |
| 9 | |
RamanGrover29@gmail.com | 2471039 | 2012-11-11 18:57:42 +0000 | [diff] [blame] | 10 | write output to nc1:"rttest/user-defined-functions_udf09.adm"; |
RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 11 | |
| 12 | create type test.TestType as open { |
| 13 | id : int32 |
| 14 | } |
| 15 | |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 16 | create dataset test.t1(TestType) primary key id; |
RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 17 | |
| 18 | insert into dataset test.t1({"id":345}); |
| 19 | insert into dataset test.t1({"id":315}); |
| 20 | insert into dataset test.t1({"id":245}); |
| 21 | insert into dataset test.t1({"id":385}); |
| 22 | insert into dataset test.t1({"id":241}); |
| 23 | insert into dataset test.t1({"id":745}); |
| 24 | insert into dataset test.t1({"id":349}); |
| 25 | insert into dataset test.t1({"id":845}); |
| 26 | |
| 27 | create function test.readDataset($a) { |
| 28 | $a |
| 29 | } |
| 30 | |
| 31 | test.readDataset(for $a in dataset('test.t1') order by $a.id return $a); |