blob: ab6b6c99fb395773e8ed21069fc337f89dbb8d01 [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
vinayakb38b7ca42012-03-05 05:44:15 +00002create dataverse test;
3use dataverse test;
4
5create 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
vinayakb38b7ca42012-03-05 05:44:15 +000024create dataset LineItem(LineItemType)
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000025 partitioned by key l_orderkey, l_linenumber;
vinayakb38b7ca42012-03-05 05:44:15 +000026
27load dataset LineItem
28using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
29(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
30
vinayakb38b7ca42012-03-05 05:44:15 +000031create index idx_LineItem_partkey on LineItem(l_linenumber);
32create index idx_LineItem_suppkey on LineItem(l_suppkey);
33
34delete $l from dataset LineItem where $l.l_suppkey>=2 or $l.l_linenumber>1;
35
alexander.behma098ddb2012-05-03 02:07:46 +000036write output to nc1:"rttest/dml_delete-from-loaded-dataset-with-index.adm";
vinayakb38b7ca42012-03-05 05:44:15 +000037for $c in dataset('LineItem')
38where $c.l_suppkey<150
39order by $c.l_orderkey, $c.l_linenumber
40return $c