blob: 5047342cdd7356ec7f2db4219e8526cc46630f50 [file] [log] [blame]
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +00001/*
2 * Testcase Name : open-closed-29.aql
3 * Description : Query for undeclared data from an open type internal dataset
4 * : use the some keyword in the where clause
5 * Status : Yes
6 * Date : 31st May 2012
7 */
8
9drop dataverse testdv2 if exists;
10create dataverse testdv2;
11use dataverse testdv2;
12
13create type testtype01 as open {
14 id: string,
15 name: string
16}
17
18create type testtype02 as open {
19id : string,
20name : string
21}
22
ramangrover29669d8f62013-02-11 06:03:32 +000023create dataset testds01(testtype01) primary key id;
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000024
ramangrover29669d8f62013-02-11 06:03:32 +000025create dataset testds02(testtype02) primary key id;
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000026
27insert into dataset testds02 (
28{ "id": "001", "name": "Person One", "hobbies": {{"scuba", "music"}}}
29);
30
31insert into dataset testds02 (
32{ "id": "002", "name": "Person Two", "hobbies": {{"fishing", "dance"}}}
33);
34
35
36insert into dataset testds02 (
37{ "id": "003", "name": "Person Three", "hobbies": {{"hiking", "surfing"}}}
38);
39
40insert into dataset testds01(
41for $d in dataset("testds02")
42return $d
43);
44
45// select all hobbies where hiking is one of the hobbies
buyingyibc282ae2012-06-05 21:41:14 +000046write output to nc1:"rttest/open-closed_open-closed-29.adm";
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000047for $d in dataset('testds01')
48where some $h in $d.hobbies satisfies $h='hiking'
buyingyibc282ae2012-06-05 21:41:14 +000049order by $d.id
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000050return $d