blob: 73ec06227b80da4930e9a2555bb03bec4a81b7b4 [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
ramangrover29669d8f62013-02-11 06:03:32 +000017create dataset Orders(OrderType) primary key o_orderkey;
alexander.behm6db7d302012-07-29 07:56:44 +000018
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}