buyingyi | c1df196 | 2012-04-25 21:37:23 +0000 | [diff] [blame] | 1 | drop dataverse test if exists; |
| 2 | |
| 3 | create dataverse test; |
| 4 | use dataverse test; |
| 5 | |
| 6 | create type LineItemType as closed { |
| 7 | l_orderkey: int32, |
| 8 | l_partkey: int32, |
| 9 | l_suppkey: int32, |
| 10 | l_linenumber: int32, |
| 11 | l_quantity: double, |
| 12 | l_extendedprice: double, |
| 13 | l_discount: double, |
| 14 | l_tax: double, |
| 15 | l_returnflag: string, |
| 16 | l_linestatus: string, |
| 17 | l_shipdate: string, |
| 18 | l_commitdate: string, |
| 19 | l_receiptdate: string, |
| 20 | l_shipinstruct: string, |
| 21 | l_shipmode: string, |
| 22 | l_comment: string |
| 23 | } |
| 24 | |
buyingyi | c1df196 | 2012-04-25 21:37:23 +0000 | [diff] [blame] | 25 | create dataset LineItem(LineItemType) |
khfaraaz82@gmail.com | 502731f | 2012-05-02 20:38:16 +0000 | [diff] [blame] | 26 | partitioned by key l_orderkey, l_linenumber; |
buyingyi | c1df196 | 2012-04-25 21:37:23 +0000 | [diff] [blame] | 27 | |
| 28 | //load dataset LineItem |
| 29 | //using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 30 | //(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; |
| 31 | |
| 32 | load dataset LineItem |
| 33 | using "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter" |
| 34 | (("hdfs"="hdfs://localhost:10009"),("path"="/tpch/lineitem.tbl"), |
| 35 | ("input-format"="text-input-format"),("format"="delimited-text"),("delimiter"="|")); |
| 36 | |
| 37 | write output to nc1:"rttest/dml_load-from-hdfs.adm"; |
| 38 | for $c in dataset('LineItem') |
| 39 | order by $c.l_orderkey, $c.l_linenumber |
| 40 | return $c |
| 41 | |