You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Jon Bender <jo...@gmail.com> on 2014/07/01 02:14:57 UTC

Alter location of database in Hive

Hey all,

I'm on Hive 0.10.0 on one of my clusters.  We had a namenode hostname
change, so I'm trying to point all of our tables, partitions and databases
to the new locations.

When i describe database mydb, the location shows up as
"hdfs://<old_hostname>/user/hive/warehouse/mydb.db", and i want to set it
to "hdfs://<new_hostname>/user/hive/warehouse/mydb.db"

Is there a way to do this.  Or do I need to go poking around in the mysql
metadata to actually carry this out?

Regards,
Jon

Re: Alter location of database in Hive

Posted by Matouk IFTISSEN <ma...@ysance.com>.
Hello If you do alter location 'new-location' in your all tables it does
not work ?
Le 1 juil. 2014 03:15, "Prem Yadav" <ip...@gmail.com> a écrit :

> I think you should be able to copy the data to a different location and
> then drop the old db, and create a new one with the new location.
>
>
> On Tue, Jul 1, 2014 at 1:54 AM, Jon Bender <jo...@gmail.com>
> wrote:
>
>> Answered my own question, no there is not.  The way to do is is to modify
>> the DB_LOCATION_URI field in metastore.DBS (at least if you're using MySQL)
>>
>>
>> On Mon, Jun 30, 2014 at 5:14 PM, Jon Bender <jo...@gmail.com>
>> wrote:
>>
>>> Hey all,
>>>
>>> I'm on Hive 0.10.0 on one of my clusters.  We had a namenode hostname
>>> change, so I'm trying to point all of our tables, partitions and databases
>>> to the new locations.
>>>
>>> When i describe database mydb, the location shows up as
>>> "hdfs://<old_hostname>/user/hive/warehouse/mydb.db", and i want to set it
>>> to "hdfs://<new_hostname>/user/hive/warehouse/mydb.db"
>>>
>>> Is there a way to do this.  Or do I need to go poking around in the
>>> mysql metadata to actually carry this out?
>>>
>>> Regards,
>>> Jon
>>>
>>
>>
>

Re: Alter location of database in Hive

Posted by Prem Yadav <ip...@gmail.com>.
I think you should be able to copy the data to a different location and
then drop the old db, and create a new one with the new location.


On Tue, Jul 1, 2014 at 1:54 AM, Jon Bender <jo...@gmail.com>
wrote:

> Answered my own question, no there is not.  The way to do is is to modify
> the DB_LOCATION_URI field in metastore.DBS (at least if you're using MySQL)
>
>
> On Mon, Jun 30, 2014 at 5:14 PM, Jon Bender <jo...@gmail.com>
> wrote:
>
>> Hey all,
>>
>> I'm on Hive 0.10.0 on one of my clusters.  We had a namenode hostname
>> change, so I'm trying to point all of our tables, partitions and databases
>> to the new locations.
>>
>> When i describe database mydb, the location shows up as
>> "hdfs://<old_hostname>/user/hive/warehouse/mydb.db", and i want to set it
>> to "hdfs://<new_hostname>/user/hive/warehouse/mydb.db"
>>
>> Is there a way to do this.  Or do I need to go poking around in the mysql
>> metadata to actually carry this out?
>>
>> Regards,
>> Jon
>>
>
>

Re: Alter location of database in Hive

Posted by Jon Bender <jo...@gmail.com>.
Answered my own question, no there is not.  The way to do is is to modify
the DB_LOCATION_URI field in metastore.DBS (at least if you're using MySQL)


On Mon, Jun 30, 2014 at 5:14 PM, Jon Bender <jo...@gmail.com>
wrote:

> Hey all,
>
> I'm on Hive 0.10.0 on one of my clusters.  We had a namenode hostname
> change, so I'm trying to point all of our tables, partitions and databases
> to the new locations.
>
> When i describe database mydb, the location shows up as
> "hdfs://<old_hostname>/user/hive/warehouse/mydb.db", and i want to set it
> to "hdfs://<new_hostname>/user/hive/warehouse/mydb.db"
>
> Is there a way to do this.  Or do I need to go poking around in the mysql
> metadata to actually carry this out?
>
> Regards,
> Jon
>