Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9944F10295 for ; Fri, 31 May 2013 20:04:46 +0000 (UTC) Received: (qmail 57723 invoked by uid 500); 31 May 2013 20:04:44 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 57671 invoked by uid 500); 31 May 2013 20:04:44 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 57660 invoked by uid 99); 31 May 2013 20:04:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 May 2013 20:04:44 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Sanjay.Subramanian@wizecommerce.com designates 207.46.163.25 as permitted sender) Received: from [207.46.163.25] (HELO co9outboundpool.messaging.microsoft.com) (207.46.163.25) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 May 2013 20:04:37 +0000 Received: from mail205-co9-R.bigfish.com (10.236.132.231) by CO9EHSOBE002.bigfish.com (10.236.130.65) with Microsoft SMTP Server id 14.1.225.23; Fri, 31 May 2013 20:04:13 +0000 Received: from mail205-co9 (localhost [127.0.0.1]) by mail205-co9-R.bigfish.com (Postfix) with ESMTP id 80B6C440203 for ; Fri, 31 May 2013 20:04:13 +0000 (UTC) X-Forefront-Antispam-Report: CIP:157.56.232.197;KIP:(null);UIP:(null);IPV:NLI;H:BLUPRD0411HT004.namprd04.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: -7 X-BigFish: PS-7(zzbb2dI98dI9371I181fM1432Ic540Idd85kzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2fh2a8h668h839h946he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1155h) Received-SPF: pass (mail205-co9: domain of wizecommerce.com designates 157.56.232.197 as permitted sender) client-ip=157.56.232.197; envelope-from=Sanjay.Subramanian@wizecommerce.com; helo=BLUPRD0411HT004.namprd04.prod.outlook.com ;.outlook.com ; Received: from mail205-co9 (localhost.localdomain [127.0.0.1]) by mail205-co9 (MessageSwitch) id 1370030651203977_27094; Fri, 31 May 2013 20:04:11 +0000 (UTC) Received: from CO9EHSMHS017.bigfish.com (unknown [10.236.132.227]) by mail205-co9.bigfish.com (Postfix) with ESMTP id 2FDDBA00076 for ; Fri, 31 May 2013 20:04:11 +0000 (UTC) Received: from BLUPRD0411HT004.namprd04.prod.outlook.com (157.56.232.197) by CO9EHSMHS017.bigfish.com (10.236.130.27) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 31 May 2013 20:04:10 +0000 Received: from BLUPRD0411MB426.namprd04.prod.outlook.com ([169.254.10.213]) by BLUPRD0411HT004.namprd04.prod.outlook.com ([10.255.127.39]) with mapi id 14.16.0311.000; Fri, 31 May 2013 20:04:09 +0000 From: Sanjay Subramanian To: "user@hive.apache.org" Subject: Re: Update statment on Hive Thread-Topic: Update statment on Hive Thread-Index: AQHOXjUNRp0ehlVPsk66SJymlhh8mZkfQkCA Date: Fri, 31 May 2013 20:04:08 +0000 Message-ID: In-Reply-To: <1370028452.24112.5.camel@oc5123520263.ibm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.255.127.4] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wizecommerce.com X-Virus-Checked: Checked by ClamAV on apache.org Hi Hive reads and writes to HDFS=8Aand by definition HDFS is write once and immutable after that. So like an RDBMS there is no concept of an update rows. However if u want to delete some records based on a criteria, yesterday there was a smart post about it, basically selecting the inverse and doing an INSERT OVERWRITE on the table INSERT OVERWRITE TABLE will write to the Hive managed HDFS location of that table and "replace" all that is there with your latest INSERT OVERWRITE DIRECTORY will write to your HDFS location of choice and "replace" all that is there with your latest. You can use this directory as LOCATION to which your PARTITION may point later Note that INSERT OVERWRITE TABLE will follow the field separator of the destination table that u specified while creating the table However INSERT OVERWRITE DIRECTORY will have Hive's default "CtrlA" as the field separator ( I use 0.10.x)=8Aperhaps this is changed in 0.11 u need to verify In summary , u have to look at updates and deletes very differently from RDBMS Good luck sanjay On 5/31/13 12:27 PM, "Renata Ghisloti Duarte de Souza" wrote: >Hello, > >I was wondering about the "update" statement on Hive. Is it something >Hive needs? Or can "insert overwrite" be always used instead? > >Thank you in advance for the clarification, > >Renata. > > > CONFIDENTIALITY NOTICE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This email message and any attachments are for the exclusive use of the int= ended recipient(s) and may contain confidential and privileged information.= Any unauthorized review, use, disclosure or distribution is prohibited. If= you are not the intended recipient, please contact the sender by reply ema= il and destroy all copies of the original message along with any attachment= s, from your computer system. If you are the intended recipient, please be = advised that the content of this message is subject to access, review and d= isclosure by the sender's Email System Administrator.