khfaraaz82@gmail.com | a271613 | 2012-04-30 06:20:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Testcase name : open-closed-14.aql |
| 3 | * Description : insert into target dataset - select * from source dataset |
| 4 | * : in this case dataset1 and dataset2 are fo different schema. |
| 5 | * Success : This test should succeed. |
| 6 | * Date : March 27 2012 |
| 7 | */ |
| 8 | |
| 9 | drop dataverse testdv2 if exists; |
| 10 | create dataverse testdv2; |
| 11 | use dataverse testdv2; |
| 12 | |
| 13 | create type testtype01 as closed { |
| 14 | id: string, |
| 15 | name: string? |
| 16 | } |
| 17 | |
| 18 | create type testtype02 as closed { |
| 19 | id: string |
| 20 | } |
| 21 | |
| 22 | create dataset testds01(testtype01) partitioned by key id; |
| 23 | |
| 24 | create dataset testds02(testtype02) partitioned by key id; |
| 25 | |
| 26 | insert into dataset testds01 ( |
| 27 | { "id": "001" } |
| 28 | ); |
| 29 | |
| 30 | insert into dataset testds01 ( |
| 31 | { "id": "002", "name": "John Doe" } |
| 32 | ); |
| 33 | |
| 34 | insert into dataset testds02 ( |
| 35 | { "id": "003" } |
| 36 | ); |
| 37 | |
| 38 | insert into dataset testds02 ( |
| 39 | { "id": "004" } |
| 40 | ); |
| 41 | |
| 42 | insert into dataset testds02 ( |
| 43 | { "id": "005" } |
| 44 | ); |
| 45 | |
| 46 | insert into dataset testds01( |
| 47 | for $d in dataset("testds02") |
| 48 | return $d |
| 49 | ); |
| 50 | |
| 51 | for $d in dataset("testds01") |
| 52 | return $d |
| 53 | |