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