blob: ae21794eadb07f8f0ddc0928d03a892575406785 [file] [log] [blame]
khfaraaz82@gmail.coma2716132012-04-30 06:20:50 +00001/*
2 * Test case name : open-closed-12.aql
3 * Description : Select from dataset two and insert into dataset one, both datasets are of open type.
4 * : In this case, both datasets are of same schema
5 * Success : Yes
6 * Date : 27 March 2012
7 */
8
9drop dataverse testdv2 if exists;
10
11create dataverse testdv2;
12
13use dataverse testdv2;
14
15create type testtype01 as open {
16 id: string,
17 name: string
18}
19
20create type testtype02 as open {
21id : string,
22name : string
23}
24
25create dataset testds01(testtype01) partitioned by key id;
26
27create dataset testds02(testtype02) partitioned by key id;
28
29insert into dataset testds02 (
30{ "id": "001", "name": "Person One", "hobbies": {{"scuba", "music"}}}
31);
32
33insert into dataset testds02 (
34{ "id": "002", "name": "Person Two", "hobbies": {{"fishing", "dance"}}}
35);
36
37insert into dataset testds02 (
38{ "id": "003", "name": "Person Three", "hobbies": {{"hiking", "surfing"}}}
39);
40
41insert into dataset testds01(
42for $d in dataset("testds02")
43return $d
44);
45
buyingyidd53f292012-05-20 23:40:25 +000046write output to nc1:"rttest/open-closed_open-closed-12.adm";
khfaraaz82@gmail.coma2716132012-04-30 06:20:50 +000047for $d in dataset("testds01")
buyingyi435234e2012-05-21 06:30:43 +000048order by $d.id
khfaraaz82@gmail.coma2716132012-04-30 06:20:50 +000049return $d
50