blob: e95d1026babe8f6108828a8cc07763b2cde8aa7a [file] [log] [blame]
RamanGrover29@gmail.com58cf3302012-11-09 00:27:45 +00001/*
2 * Description : Test cross dataverse functionality
3 * : use dataverse statement is now optional.
4 * : Use fully qualified names to access datasets.
5 * Expected Res : Success
6 * Date : 29th Aug 2012
7 */
8
9drop dataverse student if exists;
10drop dataverse teacher if exists;
11
12create dataverse student;
13create dataverse teacher;
14
15write output to nc1:"rttest/cross-dataverse_cross-dv01.adm";
16
17create type student.stdType as open {
18id : int32,
19name : string,
20age : int32,
21sex : string,
22dept : string
23}
24
25create type teacher.tchrType as open {
26id : int32,
27name : string,
28age : int32,
29sex : string,
30dept : string
31}
32
33create dataset student.ugdstd(stdType) partitioned by key id;
34create dataset student.gdstd(stdType) partitioned by key id;
35create dataset teacher.prof(tchrType) partitioned by key id;
36create dataset teacher.pstdoc(tchrType) partitioned by key id;
37
38insert into dataset student.ugdstd({"id":457,"name":"John Doe","age":22,"sex":"M","dept":"Dance"});
39
40insert into dataset student.gdstd({"id":418,"name":"John Smith","age":26,"sex":"M","dept":"Economics"});
41
42insert into dataset teacher.prof({"id":152,"name":"John Meyer","age":42,"sex":"M","dept":"History"});
43
44insert into dataset teacher.pstdoc({"id":259,"name":"Sophia Reece","age":36,"sex":"F","dept":"Anthropology"});
45
46for $s in dataset('student.ugdstd')
47for $p in dataset('teacher.prof')
48for $a in dataset('student.gdstd')
49for $b in dataset('teacher.pstdoc')
50return {"ug-student":$s,"prof":$p,"grd-student":$a,"postdoc":$b}