blob: c1c7ab279b1c27801734bd74164c23f47683bc11 [file] [log] [blame]
khfaraaz82@gmail.coma2716132012-04-30 06:20:50 +00001/*
2 * Test case name : open-closed-21.aql
3 * Description : Insert into open type internal dataset by querying another closed type internal dataset
4 * : In this case source dataset has (n+n) fields and the target dataset has only n fields, but has no intial records in it.
5 * Success : Yes
6 * Date : 29 April 2012
7 */
8
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type TestType as open {
15id:int32
16}
17
18create dataset dtst01(TestType) partitioned by key id;
19
20create type Emp as closed {
21id:int32,
22name:string,
23age:int8,
24sex:string,
25dob:date
26}
27
28create dataset employee(Emp) partitioned by key id;
29
30insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":"1-1-82"});
31insert into dataset employee({"id":202,"name":"John Smith","age":30,"sex":"M","dob":"1-1-82"});
32insert into dataset employee({"id":201,"name":"John Wayne","age":62,"sex":"M","dob":"1-1-82"});
33insert into dataset employee({"id":203,"name":"Roger Sanders","age":48,"sex":"M","dob":"1-1-82"});
34insert into dataset employee({"id":204,"name":"Raj Singh","age":37,"sex":"M","dob":"1-1-82"});
35insert into dataset employee({"id":205,"name":"Mike Tyson","age":44,"sex":"M","dob":"1-1-82"});
36insert into dataset employee({"id":206,"name":"Brett Lee","age":35,"sex":"M","dob":"1-1-82"});
37insert into dataset employee({"id":207,"name":"Chen Li","age":39,"sex":"M","dob":"1-1-82"});
38insert into dataset employee({"id":208,"name":"Mike Carey","age":42,"sex":"M","dob":"1-1-82"});
39insert into dataset employee({"id":209,"name":"Abdullah","age":29,"sex":"M","dob":"1-1-82"});
40insert into dataset employee({"id":221,"name":"Mariam","age":25,"sex":"F","dob":"1-1-82"});
41
42insert into dataset dtst01({for $l in dataset('employee') return $l});
43
44for $l in dataset('dtst01')
45retunr $l