pouria.pirzadeh@gmail.com | fa89074 | 2013-03-07 23:59:21 +0000 | [diff] [blame] | 1 | /* |
Ian Maxon | 857dc13 | 2015-09-25 17:13:19 -0700 | [diff] [blame] | 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | /* |
pouria.pirzadeh@gmail.com | fa89074 | 2013-03-07 23:59:21 +0000 | [diff] [blame] | 20 | * Description : Test variant syntax for delete |
| 21 | * : Ending semi-colon is optional for delete |
| 22 | * Expected Res : Success |
| 23 | * Date : 6th March 2013 |
| 24 | */ |
| 25 | |
| 26 | drop dataverse test if exists; |
| 27 | create dataverse test; |
| 28 | use dataverse test; |
| 29 | |
| 30 | create type LineItemType as closed { |
| 31 | l_orderkey: int32, |
| 32 | l_partkey: int32, |
| 33 | l_suppkey: int32, |
| 34 | l_linenumber: int32, |
| 35 | l_quantity: int32, |
| 36 | l_extendedprice: double, |
| 37 | l_discount: double, |
| 38 | l_tax: double, |
| 39 | l_returnflag: string, |
| 40 | l_linestatus: string, |
| 41 | l_shipdate: string, |
| 42 | l_commitdate: string, |
| 43 | l_receiptdate: string, |
| 44 | l_shipinstruct: string, |
| 45 | l_shipmode: string, |
| 46 | l_comment: string |
| 47 | } |
| 48 | |
| 49 | create dataset LineItem(LineItemType) |
| 50 | primary key l_orderkey, l_linenumber; |
| 51 | |
| 52 | load dataset LineItem |
Ian Maxon | f18bba2 | 2015-08-21 12:35:14 -0700 | [diff] [blame] | 53 | using "org.apache.asterix.external.dataset.adapter.NCFileSystemAdapter" |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 54 | (("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted; |
pouria.pirzadeh@gmail.com | fa89074 | 2013-03-07 23:59:21 +0000 | [diff] [blame] | 55 | |
| 56 | delete $l from dataset LineItem where $l.l_orderkey>=10 |
| 57 | |
Ian Maxon | f7b6453 | 2015-12-09 17:28:18 -0800 | [diff] [blame] | 58 | write output to asterix_nc1:"rttest/dml_delete-syntax-change.adm"; |
pouria.pirzadeh@gmail.com | fa89074 | 2013-03-07 23:59:21 +0000 | [diff] [blame] | 59 | for $c in dataset('LineItem') |
| 60 | order by $c.l_orderkey, $c.l_linenumber |
| 61 | return $c |