blob: 666dc73f15227da89f62ab5664ea7a52d78cd52f [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
2
3create dataverse test;
4use dataverse test;
5
6create type LineItemType as closed {
7 l_orderkey: int32,
8 l_partkey: int32,
9 l_suppkey: int32,
10 l_linenumber: int32,
11 l_quantity: double,
12 l_extendedprice: double,
13 l_discount: double,
14 l_tax: double,
15 l_returnflag: string,
16 l_linestatus: string,
17 l_shipdate: string,
18 l_commitdate: string,
19 l_receiptdate: string,
20 l_shipinstruct: string,
21 l_shipmode: string,
22 l_comment: string
23}
24
vinayakb38b7ca42012-03-05 05:44:15 +000025create dataset LineItem(LineItemType)
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000026 partitioned by key l_orderkey, l_linenumber;
vinayakb38b7ca42012-03-05 05:44:15 +000027
28load dataset LineItem
29using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
30(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
31
32create index idx_LineItem_partkey on LineItem(l_linenumber);
33create index idx_LineItem_suppkey on LineItem(l_suppkey);
34
35write output to nc1:"rttest/index_range-search.adm";
36for $c in dataset('LineItem')
37where $c.l_suppkey < 100 and $c.l_suppkey>5
38order by $c.l_orderkey, $c.l_linenumber
39return $c
40