blob: 03b175466f13eae9993b63f6fecd0edca98de747 [file] [log] [blame]
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +00001/*
2 * Test case Name : open-closed-31.aql
3 * Description :
4 * Success : Yes
5 * Date : 31st May 2012
6 */
7
8drop dataverse testdv2 if exists;
9create dataverse testdv2;
10use dataverse testdv2;
11
12create type testtype01 as open {
13 id: string
14}
15
16create type testtype02 as open {
17id : string,
18name : string
19}
20
21create dataset testds01(testtype01) partitioned by key id;
22
23create dataset testds02(testtype02) partitioned by key id;
24
25insert into dataset testds02 (
26{ "id": "011", "name": "John Doe", "hobbies": {{"scuba", "music"}}}
27);
28
29insert into dataset testds02 (
30{ "id": "102", "name": "Roger Sanders", "hobbies": {{"fishing", "dance"}}}
31);
32
33
34insert into dataset testds02 (
35{ "id": "203", "name": "Phil Smith", "hobbies": {{"hiking", "surfing"}}}
36);
37
38insert into dataset testds01(
39for $d in dataset("testds02")
40return $d
41);
42
buyingyibc282ae2012-06-05 21:41:14 +000043write output to nc1:"rttest/open-closed_open-closed-31.adm";
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000044for $d in dataset('testds01')
45where some $h in $d.hobbies satisfies $h='hiking'
buyingyibc282ae2012-06-05 21:41:14 +000046order by $d.id
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000047return $d.hobbies
48