| 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 nodegroup group1 if not exists on nc1, nc2; |
| |
| create dataset LineID(LineIDType) |
| partitioned by key l_orderkey, l_linenumber on group1; |
| |
| load dataset LineID |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/tpch0.001/lineitem_0.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; |
| |
| |
| insert into dataset LineID ( |
| let $x:=1 |
| let $y:=2 |
| let $z:=3 |
| return { |
| "l_orderkey": $x, |
| "l_partkey": $y, |
| "l_suppkey": $z |
| } |
| ); |
| |
| insert into dataset LineID ( |
| let $x:=2 |
| let $y:=3 |
| let $z:=4 |
| return { |
| "l_orderkey": $x, |
| "l_partkey": $y, |
| "l_suppkey": $z |
| } |
| ); |
| |
| |
| write output to nc1:"rttest/dml_insert-tuple.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 |