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