| /* |
| * Test case Name : insert-into-empty-dataset.aql |
| * Description : Check that we can insert into an empty dataset |
| * Expected Result : Success |
| * Date : May 2 2012 |
| */ |
| |
| drop dataverse test if exists; |
| create dataverse test; |
| use dataverse test; |
| |
| create type LineIDType as closed { |
| l_orderkey: int32, |
| l_linenumber: int32, |
| l_suppkey: int32 |
| } |
| |
| create dataset LineID(LineIDType) |
| primary key l_orderkey, l_linenumber; |
| |
| insert into dataset LineID ( |
| let $x:=1 |
| let $y:=2 |
| let $z:=3 |
| return { |
| "l_orderkey": $x, |
| "l_linenumber": $y, |
| "l_suppkey": $z |
| } |
| ); |
| |
| insert into dataset LineID ( |
| let $x:=2 |
| let $y:=3 |
| let $z:=4 |
| return { |
| "l_orderkey": $x, |
| "l_linenumber": $y, |
| "l_suppkey": $z |
| } |
| ); |
| |
| write output to nc1:"rttest/dml_insert-into-empty-dataset.adm"; |
| for $c in dataset('LineID') |
| where $c.l_suppkey < 100 and $c.l_linenumber<5 |
| order by $c.l_orderkey, $c.l_linenumber |
| return $c |