blob: 42aa2e62153a5c133d6df3521b9b2f3b4581f084 [file] [log] [blame]
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +00001/*
2 * Test case Name : open-closed-30.aql
3 * Description : Query undeclared data using every in the WHERE clause
4 * : where every $h in $d.hobbies satisfies $h='hiking'
5 * Success : 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}
16
17create type testtype02 as open {
18id : string,
19name : string
20}
21
22create dataset testds01(testtype01) partitioned by key id;
23
24create dataset testds02(testtype02) partitioned by key id;
25
26insert into dataset testds02 (
27{ "id": "011", "name": "John Doe", "hobbies": {{"scuba", "music"}}}
28);
29
30insert into dataset testds02 (
31{ "id": "102", "name": "Roger Sanders", "hobbies": {{"fishing", "dance"}}}
32);
33
34
35insert into dataset testds02 (
36{ "id": "203", "name": "Phil Smith", "hobbies": {{"hiking", "surfing"}}}
37);
38
39insert into dataset testds01(
40for $d in dataset("testds02")
41return $d
42);
43
buyingyibc282ae2012-06-05 21:41:14 +000044write output to nc1:"rttest/open-closed_open-closed-30.adm";
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000045for $d in dataset('testds01')
46where every $h in $d.hobbies satisfies $h='hiking'
buyingyibc282ae2012-06-05 21:41:14 +000047order by $d.id
khfaraaz82@gmail.comc26a6982012-06-01 02:35:40 +000048return $d.hobbies
49