blob: d82be3c105d3d311952c20c71f1d1993efb3c26d [file] [log] [blame]
alexander.behm6db7d302012-07-29 07:56:44 +00001drop dataverse index_search if exists;
2create dataverse index_search;
3use dataverse index_search;
4
5create type OrderType as closed {
6 o_orderkey: int32,
7 o_custkey: int32,
8 o_orderstatus: string,
9 o_totalprice: double,
10 o_orderdate: string,
11 o_orderpriority: string,
12 o_clerk: string,
13 o_shippriority: int32,
14 o_comment: string
15}
16
17create dataset Orders(OrderType) partitioned by key o_orderkey;
18
19create index idx_Custkey_Orderstatus on Orders(o_custkey, o_orderstatus);
20
21write output to nc1:"/tmp/index_search.adm";
22
23for $o in dataset('Orders')
24where
25 $o.o_custkey = 40 and $o.o_orderstatus = "P"
26return {
27 "o_orderkey": $o.o_orderkey,
28 "o_custkey": $o.o_custkey,
29 "o_orderstatus": $o.o_orderstatus
30}