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 LineItemType as closed { |
| 6 | l_orderkey: int32, |
| 7 | l_partkey: int32, |
| 8 | l_suppkey: int32, |
| 9 | l_linenumber: int32, |
| 10 | l_quantity: int32, |
| 11 | l_extendedprice: double, |
| 12 | l_discount: double, |
| 13 | l_tax: double, |
| 14 | l_returnflag: string, |
| 15 | l_linestatus: string, |
| 16 | l_shipdate: string, |
| 17 | l_commitdate: string, |
| 18 | l_receiptdate: string, |
| 19 | l_shipinstruct: string, |
| 20 | l_shipmode: string, |
| 21 | l_comment: string |
| 22 | } |
| 23 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 24 | create dataset LineItem(LineItemType) |
khfaraaz82@gmail.com | 502731f | 2012-05-02 20:38:16 +0000 | [diff] [blame] | 25 | partitioned by key l_orderkey, l_linenumber; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 26 | |
| 27 | load dataset LineItem |
| 28 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 29 | (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; |
| 30 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 31 | create index idx_LineItem_partkey on LineItem(l_linenumber); |
| 32 | create index idx_LineItem_suppkey on LineItem(l_suppkey); |
| 33 | |
| 34 | delete $l from dataset LineItem where $l.l_suppkey>=2 or $l.l_linenumber>1; |
| 35 | |
alexander.behm | a098ddb | 2012-05-03 02:07:46 +0000 | [diff] [blame^] | 36 | write output to nc1:"rttest/dml_delete-from-loaded-dataset-with-index.adm"; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 37 | for $c in dataset('LineItem') |
| 38 | where $c.l_suppkey<150 |
| 39 | order by $c.l_orderkey, $c.l_linenumber |
| 40 | return $c |