Re: move tables into different database

2012-01-30 Thread hadoop hive
thanks Sriram On Tue, Jan 31, 2012 at 12:17 PM, Sriram Krishnan wrote: > I had to resort to a shell script, the crux of it was something like > this: > > -- > echo "Getting the DB_ID for the source database:" > source_db_id=`mysql -u $mysql_user -h $mysql_host -p$mysql_passwd > $mysql_db -e "s

Re: move tables into different database

2012-01-30 Thread Sriram Krishnan
I had to resort to a shell script, the crux of it was something like this: -- echo "Getting the DB_ID for the source database:" source_db_id=`mysql -u $mysql_user -h $mysql_host -p$mysql_passwd $mysql_db -e "select DBS.DB_ID from TBLS, DBS where TBLS.TBL_NAME=\"$tbl_name\" and TBLS.DB_ID = DBS.D

Re: move tables into different database

2012-01-30 Thread hadoop hive
Thanks All, *Sriram *can you explain about that shell script which directly update the metadata. Actually data is in large amount , having many tables which is not possible to move the data and create each table into different database; table also have some partitions. Regards Vikas Srivastava

Re: move tables into different database

2012-01-30 Thread Matt Tucker
Someone recently posted a command to convert a managed table to an external table. If you also use that command, there's no expensive copy operation. You'd probably want to move the data into a different HDFS directory though, to keep your namespace as consistent as possible, Matt On Jan 30,

Re: move tables into different database

2012-01-30 Thread Sriram Krishnan
You could do that if you don't mind moving the data (which may be expensive depending on how much data you have). Also if your table is partitioned, you may have to do another additional step (to recover partitions). Sriram From: Aniket Mokashi mailto:aniket...@gmail.com>> Reply-To: mailto:user

Re: move tables into different database

2012-01-30 Thread Aniket Mokashi
If you are on hdfs How about-- use db1; create table table1 like db2.table1; and move the data? Thanks, Aniket On Mon, Jan 30, 2012 at 8:09 AM, Sriram Krishnan wrote: > AFAIK there is no way in HiveQL to do this. We had a similar requirement > in the past, and we wrote a shell script to upda

Re: move tables into different database

2012-01-30 Thread Sriram Krishnan
AFAIK there is no way in HiveQL to do this. We had a similar requirement in the past, and we wrote a shell script to update the MySQL metastore directly (obviously not the cleanest or recommended way to go). Cheers, Sriram From: hadoop hive mailto:hadooph...@gmail.com>> Reply-To: mailto:user@hi