blob: efab26750462588e4f12a1b7813541568f63f49d [file] [log] [blame]
alexander.behmf01733d2012-04-11 05:03:06 +00001drop dataverse test if exists;
2create 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: double,
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
alexander.behmf01733d2012-04-11 05:03:06 +000024create dataset LineItem(LineItemType)
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000025 partitioned by key l_orderkey, l_linenumber;
alexander.behmf01733d2012-04-11 05:03:06 +000026
27create index idx_partkey on LineItem(l_partkey);
28
29load dataset LineItem
30using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
31(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
32
33write output to nc1:"rttest/dml_load-with-index.adm";
34
35for $c in dataset('LineItem')
36where $c.l_partkey = 100
37order by $c.l_orderkey, $c.l_linenumber
38return $c