blob: b16e2dd574af22e5d1d2fff1690d033472dda5f1 [file] [log] [blame]
jarodwencbbab142013-02-01 07:56:46 +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
10write output to nc1:"rttest/user-defined-functions_udf09.adm";
11
12create type test.TestType as open {
13id : int32
14}
15
16create dataset test.t1(TestType) partitioned by key id;
17
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);