vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 2 | create dataverse test; |
| 3 | use dataverse test; |
| 4 | |
| 5 | create type LineIDType as closed { |
| 6 | l_orderkey: int32, |
| 7 | l_linenumber: int32, |
| 8 | l_suppkey: int32 |
| 9 | } |
| 10 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 11 | create dataset LineID(LineIDType) |
khfaraaz82@gmail.com | 502731f | 2012-05-02 20:38:16 +0000 | [diff] [blame] | 12 | partitioned by key l_orderkey, l_linenumber; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 13 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 14 | insert into dataset LineID ( |
| 15 | let $x:=1 |
| 16 | let $y:=2 |
| 17 | let $z:=3 |
| 18 | return { |
| 19 | "l_orderkey": $x, |
| 20 | "l_partkey": $y, |
| 21 | "l_suppkey": $z |
| 22 | } |
| 23 | ); |
| 24 | |
| 25 | insert into dataset LineID ( |
| 26 | let $x:=2 |
| 27 | let $y:=3 |
| 28 | let $z:=4 |
| 29 | return { |
| 30 | "l_orderkey": $x, |
| 31 | "l_partkey": $y, |
| 32 | "l_suppkey": $z |
| 33 | } |
| 34 | ); |
| 35 | |
alexander.behm | a098ddb | 2012-05-03 02:07:46 +0000 | [diff] [blame^] | 36 | write output to nc1:"rttest/dml_insert-into-empty-dataset.adm"; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 37 | for $c in dataset('LineID') |
| 38 | where $c.l_suppkey < 100 and $c.l_linenumber<5 |
| 39 | order by $c.l_orderkey, $c.l_linenumber |
| 40 | return $c |