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 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 | |
| 17 | create nodegroup group1 if not exists on nc1, nc2; |
| 18 | create dataset Orders(OrderType) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 19 | primary key o_orderkey on group1; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 20 | |
| 21 | write output to nc1:"/tmp/push_limit.adm"; |
| 22 | |
| 23 | for $o in dataset('Orders') |
| 24 | where $o.o_totalprice > 100 |
| 25 | order by $o.o_orderkey |
| 26 | limit 10 offset 5 |
| 27 | return { "price": $o.o_totalprice, "date": $o.o_orderdate } |
| 28 | |