| 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; |
| |
| |
| create index idx_LineID_partkey on LineID(l_linenumber); |
| create index idx_LineID_suppkey on LineID(l_suppkey); |
| |
| 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-with-index.adm"; |
| for $c in dataset('LineID') |
| where $c.l_suppkey = 3 and $c.l_linenumber=2 |
| order by $c.l_orderkey, $c.l_linenumber |
| return $c |