blob: 8fdab7501454554bf3a97b8a8dff685bfc6bbc1a [file] [log] [blame]
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +00001/*
2 * Testcase Name : open-closed-28.aql
3 * Description : Query for undeclared data from an open type internal dataset
4 * : use the every 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
buyingyibc282ae2012-06-05 21:41:14 +000047write output to nc1:"rttest/open-closed_open-closed-28.adm";
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000048for $d in dataset('testds01')
49where every $h in $d.hobbies satisfies $h='hiking'
buyingyibc282ae2012-06-05 21:41:14 +000050order by $d.id
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000051return $d