pouria.pirzadeh@gmail.com | fa89074 | 2013-03-07 23:59:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Test variant syntax for delete |
| 3 | * : Ending semi-colon is optional for delete |
| 4 | * Expected Res : Success |
| 5 | * Date : 6th March 2013 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse test if exists; |
| 9 | create dataverse test; |
| 10 | use dataverse test; |
| 11 | |
| 12 | create type LineItemType as closed { |
| 13 | l_orderkey: int32, |
| 14 | l_partkey: int32, |
| 15 | l_suppkey: int32, |
| 16 | l_linenumber: int32, |
| 17 | l_quantity: int32, |
| 18 | l_extendedprice: double, |
| 19 | l_discount: double, |
| 20 | l_tax: double, |
| 21 | l_returnflag: string, |
| 22 | l_linestatus: string, |
| 23 | l_shipdate: string, |
| 24 | l_commitdate: string, |
| 25 | l_receiptdate: string, |
| 26 | l_shipinstruct: string, |
| 27 | l_shipmode: string, |
| 28 | l_comment: string |
| 29 | } |
| 30 | |
| 31 | create dataset LineItem(LineItemType) |
| 32 | primary key l_orderkey, l_linenumber; |
| 33 | |
| 34 | load dataset LineItem |
Ian Maxon | f18bba2 | 2015-08-21 12:35:14 -0700 | [diff] [blame] | 35 | using "org.apache.asterix.external.dataset.adapter.NCFileSystemAdapter" |
pouria.pirzadeh@gmail.com | fa89074 | 2013-03-07 23:59:21 +0000 | [diff] [blame] | 36 | (("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; |
| 37 | |
| 38 | delete $l from dataset LineItem where $l.l_orderkey>=10 |
| 39 | |
| 40 | write output to nc1:"rttest/dml_delete-syntax-change.adm"; |
| 41 | for $c in dataset('LineItem') |
| 42 | order by $c.l_orderkey, $c.l_linenumber |
| 43 | return $c |