khfaraaz82@gmail.com | a271613 | 2012-04-30 06:20:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Test case name : open-closed-12.aql |
| 3 | * Description : Select from dataset two and insert into dataset one, both datasets are of open type. |
| 4 | * : In this case, both datasets are of same schema |
| 5 | * Success : Yes |
| 6 | * Date : 27 March 2012 |
| 7 | */ |
| 8 | |
| 9 | drop dataverse testdv2 if exists; |
| 10 | |
| 11 | create dataverse testdv2; |
| 12 | |
| 13 | use dataverse testdv2; |
| 14 | |
| 15 | create type testtype01 as open { |
| 16 | id: string, |
| 17 | name: string |
| 18 | } |
| 19 | |
| 20 | create type testtype02 as open { |
| 21 | id : string, |
| 22 | name : string |
| 23 | } |
| 24 | |
| 25 | create dataset testds01(testtype01) partitioned by key id; |
| 26 | |
| 27 | create dataset testds02(testtype02) partitioned by key id; |
| 28 | |
| 29 | insert into dataset testds02 ( |
| 30 | { "id": "001", "name": "Person One", "hobbies": {{"scuba", "music"}}} |
| 31 | ); |
| 32 | |
| 33 | insert into dataset testds02 ( |
| 34 | { "id": "002", "name": "Person Two", "hobbies": {{"fishing", "dance"}}} |
| 35 | ); |
| 36 | |
| 37 | insert into dataset testds02 ( |
| 38 | { "id": "003", "name": "Person Three", "hobbies": {{"hiking", "surfing"}}} |
| 39 | ); |
| 40 | |
| 41 | insert into dataset testds01( |
| 42 | for $d in dataset("testds02") |
| 43 | return $d |
| 44 | ); |
| 45 | |
| 46 | for $d in dataset("testds01") |
| 47 | return $d |
| 48 | |