blob: 099e2d2767a84db592a7e463876f7ef860a1bd43 [file] [log] [blame]
alexander.behm96e3f3f2012-05-06 05:58:21 +00001drop dataverse test if exists;
2
3create dataverse test;
4use dataverse test;
5
6create type LineItemType as open {
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 dataset LineItem(LineItemType)
26 partitioned by key l_orderkey, l_linenumber;
27
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
alexander.behmc576c602012-07-06 02:41:15 +000035write output to nc1:"rttest/index-selection_range-search-open.adm";
36
alexander.behm96e3f3f2012-05-06 05:58:21 +000037for $c in dataset('LineItem')
38where $c.l_suppkey < 100 and $c.l_suppkey>5
39order by $c.l_orderkey, $c.l_linenumber
40return $c
41