vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse tpch if exists; |
| 2 | create dataverse tpch; |
| 3 | use dataverse tpch; |
| 4 | |
| 5 | create type LineItemType as closed { |
| 6 | l_orderkey: int32, |
| 7 | l_partkey: int32, |
| 8 | l_suppkey: int32, |
| 9 | l_linenumber: int32, |
| 10 | l_quantity: double, |
| 11 | l_extendedprice: double, |
| 12 | l_discount: double, |
| 13 | l_tax: double, |
| 14 | l_returnflag: string, |
| 15 | l_linestatus: string, |
| 16 | l_shipdate: string, |
| 17 | l_commitdate: string, |
| 18 | l_receiptdate: string, |
| 19 | l_shipinstruct: string, |
| 20 | l_shipmode: string, |
| 21 | l_comment: string |
| 22 | } |
| 23 | |
| 24 | create type LineIDType as closed { |
| 25 | l_orderkey: int32, |
| 26 | l_partkey: int32, |
| 27 | l_suppkey: int32 |
| 28 | } |
| 29 | |
| 30 | create nodegroup group1 if not exists on nc1, nc2; |
| 31 | |
| 32 | create dataset LineItems_q1(LineItemType) |
vinayakb | 5ee049d | 2013-04-06 21:21:29 +0000 | [diff] [blame^] | 33 | primary key l_orderkey on group1; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 34 | |
| 35 | create dataset LineID(LineIDType) |
vinayakb | 5ee049d | 2013-04-06 21:21:29 +0000 | [diff] [blame^] | 36 | primary key l_orderkey on group1; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 37 | |
| 38 | create index idx_LineID_partkey on LineID(l_partkey); |
| 39 | create index idx_LineID_suppkey on LineID(l_suppkey); |
| 40 | |
| 41 | insert into dataset LineID ( |
| 42 | for $l in dataset('LineItems_q1') |
| 43 | // where $l.l_shipdate <= '1998-09-02' |
| 44 | return { |
| 45 | "l_orderkey": $l.l_orderkey, |
| 46 | "l_partkey": $l.l_partkey, |
| 47 | "l_suppkey": $l.l_partkey |
| 48 | } |
| 49 | ); |