khfaraaz82@gmail.com | a271613 | 2012-04-30 06:20:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Testcase Name : open-closed-17.aql |
| 3 | * Description : Test open type dataset by inserting additional data along with inserting data for existing fields. |
| 4 | * Success : Yes |
| 5 | * Date : March 30th 2012 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse test if exists; |
| 9 | create dataverse test; |
| 10 | use dataverse test; |
| 11 | |
| 12 | create type Schema as open{ |
| 13 | id_8: int8, |
| 14 | id_16: int16, |
| 15 | id_32: int32, |
| 16 | id_64: int64, |
| 17 | fp : float, |
| 18 | name: string, |
| 19 | dt: date, |
| 20 | tm: time, |
| 21 | dt_tm: datetime, |
| 22 | lat_lon: point |
| 23 | } |
| 24 | |
| 25 | create dataset tdtst(Schema) partitioned by key id_32; |
| 26 | |
| 27 | insert into dataset tdtst( |
| 28 | let $f1:=time("10:50:56:200+05:00") |
| 29 | let $f2:=datetime("2011-12-31T14:00:00-10:00") |
| 30 | let $f3:=point("100.0,200.0") |
| 31 | return { |
| 32 | "id_8":100, |
| 33 | "id_16":1011, |
| 34 | "id_32":23455, |
| 35 | "id_64":34567, |
| 36 | "fp":87.61863f, |
| 37 | "name":"John", |
| 38 | "dt":"03-21-1982", |
| 39 | "tm": $f1, |
| 40 | "dt_tm": $f2, |
| 41 | "lat_lon": $f3, |
| 42 | "mydata":{{"this is my additional data"}} |
| 43 | } |
| 44 | ); |
| 45 | |
| 46 | for $l in dataset('tdtst') |
| 47 | return $l |