blob: 8b9a79212e6a351cf6ab2bc3482da5eac60c853e [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
23create dataset testds01(testtype01) partitioned by key id;
24
25create dataset testds02(testtype02) partitioned by key id;
26
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
46
47for $d in dataset('testds01')
48where some $h in $d.hobbies satisfies $h='hiking'
49return $d