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 5FAAC7A18 for ; Mon, 22 Aug 2011 01:51:32 +0000 (UTC) Received: (qmail 92911 invoked by uid 500); 22 Aug 2011 01:51:31 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 92796 invoked by uid 500); 22 Aug 2011 01:51:30 -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 92788 invoked by uid 99); 22 Aug 2011 01:51:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2011 01:51:30 +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 burley@geek.net designates 74.125.149.209 as permitted sender) Received: from [74.125.149.209] (HELO na3sys009aog113.obsmtp.com) (74.125.149.209) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2011 01:51:23 +0000 Received: from mail-wy0-f176.google.com ([74.125.82.176]) (using TLSv1) by na3sys009aob113.postini.com ([74.125.148.12]) with SMTP ID DSNKTlG2BRrMC5gctT2kPuqmptNa0W9uhtPX@postini.com; Sun, 21 Aug 2011 18:51:03 PDT Received: by wyg30 with SMTP id 30so3437168wyg.7 for ; Sun, 21 Aug 2011 18:51:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.169.13 with SMTP id m13mr1576141wel.32.1313977860419; Sun, 21 Aug 2011 18:51:00 -0700 (PDT) Received: by 10.216.44.205 with HTTP; Sun, 21 Aug 2011 18:51:00 -0700 (PDT) In-Reply-To: References: Date: Sun, 21 Aug 2011 21:51:00 -0400 Message-ID: Subject: Re: Alter table Set Locations for all partitions From: David Burley To: user@hive.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Bhupesh, The following worked for us on a MySQL metastore: mysqldump metastore > metastore-backup-`date +%Y%m%d`.sql mysql metastore UPDATE SDS SET LOCATION=REPLACE(LOCATION, 'hdfs://hadoop-namenode-1', 'hdfs://hadoop-namenode-2'); UPDATE DBS SET `DESC`=REPLACE(`DESC`, 'hdfs://hadoop-namenode-1', 'hdfs://hadoop-namenode-2'); But I think you noted you are using Derby. If I were using Derby, I'd switch to MySQL to make the management less painful, and then do the above. I provided some info on migrating from Derby to MySQL here: http://search-hadoop.com/m/J15J0FwAg1/v=plain If you must run Derby -- I'd think you could use the same tool, RazorSQL to load up the metastore and then tweak the underlying data. Good Luck! --David On Fri, Aug 19, 2011 at 5:26 PM, Bhupesh Bansal wrote: > Hey Folks, > > I am wondering what is the easiest way to migrate data off one hadoop/hive > cluster to another. > > I distcp all data to new cluster, and then copied the metadata directory to > new cluster. > hive comes up fine and show tables etc but the hive location is still > pointing to old cluster > > There is one command > alter table table_name set location new_location > > but it doesnt work for partitioned tables, is there a way we can do it for > *ALL* partitions easily ?? > > Best > Bhupesh > > > ==== This e- mail message is intended only for the named recipient(s) above. It may contain confidential and privileged information. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and delete the message and any attachment(s) from your system. Thank you.