blob: 38df3efb8d8d44d2d8a87796086e632a5e7706cb [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
24create nodegroup group1 if not exists on nc1, nc2;
25
26create dataset LineItem(LineItemType)
27 partitioned by key l_orderkey, l_linenumber on group1;
28
29create index idx_partkey on LineItem(l_partkey);
30
31load dataset LineItem
32using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
33(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
34
35write output to nc1:"rttest/dml_load-with-index.adm";
36
37for $c in dataset('LineItem')
38where $c.l_partkey = 100
39order by $c.l_orderkey, $c.l_linenumber
40return $c