blob: 354757dbcbc66f56352219aa27a54c5ef1aca3e7 [file] [log] [blame]
khfaraaz82@gmail.com6621b1d2012-05-25 07:26:35 +00001/*
2 * Testcase Name : c2c-w-optional.aql
3 * Description : Insert data into target datase by doing a select on source dataset.
4 * : Here both source and target datasets are internal datasets
5 * : The schema includes one optional field named optnl_fld.
6 * Success : Yes
7 * Date : 23rd May 2012
8 */
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type TestType as closed {
15id:int32,
16description:string,
17name:string,
18optnl_fld:string?
19}
20
21create dataset T1(TestType) partitioned by key id;
22
23create dataset T2(TestType) partitioned by key id;
24
25insert into dataset T1({
26"id":1234,
27"description":"donut",
28"name":"Cake",
29"optnl_fld":"optional data goes here"
30}
31);
32
33insert into dataset T2(for $l in dataset("T1") return $l );
34
35for $d in dataset("T2")
36order by $d.id
37return $d