blob: 31d41b6ec3dba0f366bfcf3ed96e5317b4d854ff [file] [log] [blame]
vinayakb5ee049d2013-04-06 21:21:29 +00001drop dataverse index_search if exists;
2
3create dataverse index_search;
4
5use dataverse index_search;
6
7create type OrderType as open {
8 o_orderkey: int32,
9 o_custkey: int32,
10 o_orderstatus: string,
11 o_totalprice: double,
12 o_orderdate: string,
13 o_orderpriority: string,
14 o_clerk: string,
15 o_shippriority: int32,
16 o_comment: string
17}
18
19
20create nodegroup group1 if not exists on nc1, nc2;
21
22create dataset Orders(OrderType)
23 primary key o_orderkey on group1;
24
25create index idx_Orders_Custkey on Orders(o_custkey);
26
27write output to nc1:"/tmp/index_search.adm";
28
29for $o in dataset('Orders')
30where
31 $o.o_custkey = 40
32return {
33 "o_orderkey": $o.o_orderkey,
34 "o_custkey": $o.o_custkey
35}