You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Shushant Arora <sh...@gmail.com> on 2015/03/25 05:31:34 UTC
rename a database
Hi
Is there any way in hive0.10 to rename a database ?
Thanks
Re: rename a database
Posted by Slava Markeyev <sl...@upsight.com>.
Just to note the current patch for HIVE-4847
<https://issues.apache.org/jira/browse/HIVE-4847> doesn't handle errors
really well and you can potentially get in an inconsistent state if there
is a failure along the way. Also, iirc external tables aren't handled
properly either.
-Slava
On Fri, Mar 27, 2015 at 9:14 AM, @Sanjiv Singh <sa...@gmail.com>
wrote:
> There is already JIRA raised for this functionality and patch available
> with ticket.
>
> Patch moves the database directory on HDFS and changes its related
> metadata entities.
> Unit tests are also included.
>
> https://issues.apache.org/jira/browse/HIVE-4847
>
> I have not tried it yet.
>
> Regards,
> Sanjiv Singh
>
>
> Regards
> Sanjiv Singh
> Mob : +091 9990-447-339
>
> On Fri, Mar 27, 2015 at 9:31 PM, Dr Mich Talebzadeh <mi...@peridale.co.uk>
> wrote:
>
>>
>> yep it can can happen in any server hosting a database or schema.
>>
>> I believe you will need to rename the database directory underr hive
>> warehouse ditectory <DBNAME>.db.
>>
>> Then you can hack Hive metasttore database. Mine is on SAP ASE. Certain
>> tables like DBS etc in metastoreDB need to be changed. I cannot
>> fremember on top of my head. Best to basckup database before hacking it
>> and do it out of business hours.
>>
>> That is an approch. I am sure there are better ways.
>>
>> HTH,
>>
>> Mich
>>
>> On 27/3/2015, "Fabio C." <an...@gmail.com> wrote:
>>
>> >Maybe they just typed time_shit instead of time_shift and found it out
>> >after 3 hours of tables compression... I don't think it's too important,
>> >but which is the workaround? I'm also interested in this.
>> >Maybe it's just a matter of metastore and one could try to explore the
>> >metastore db to change how the database is referenced, possibly having to
>> >change also the DB folder name on HDFS... My two cents ;)
>> >
>> >Regards
>> >
>> >On Fri, Mar 27, 2015 at 3:10 PM, @Sanjiv Singh <sa...@gmail.com>
>> >wrote:
>> >
>> >> Can I know why do you want to do so?
>> >>
>> >> Currently There is no command or direct way to do that..then I can
>> suggest
>> >> workaround for this.
>> >>
>> >> Thanks,
>> >> Sanjiv Singh
>> >>
>> >>
>> >> Regards
>> >> Sanjiv Singh
>> >> Mob : +091 9990-447-339
>> >>
>> >> On Wed, Mar 25, 2015 at 10:01 AM, Shushant Arora <
>> >> shushantarora09@gmail.com> wrote:
>> >>
>> >>> Hi
>> >>>
>> >>> Is there any way in hive0.10 to rename a database ?
>> >>>
>> >>> Thanks
>> >>>
>> >>>
>> >>
>> >
>> >
>>
>
>
--
Slava Markeyev | Engineering | Upsight
<http://www.linkedin.com/in/slavamarkeyev>
<http://www.linkedin.com/in/slavamarkeyev>
Re: rename a database
Posted by "@Sanjiv Singh" <sa...@gmail.com>.
There is already JIRA raised for this functionality and patch available
with ticket.
Patch moves the database directory on HDFS and changes its related metadata
entities.
Unit tests are also included.
https://issues.apache.org/jira/browse/HIVE-4847
I have not tried it yet.
Regards,
Sanjiv Singh
Regards
Sanjiv Singh
Mob : +091 9990-447-339
On Fri, Mar 27, 2015 at 9:31 PM, Dr Mich Talebzadeh <mi...@peridale.co.uk>
wrote:
>
> yep it can can happen in any server hosting a database or schema.
>
> I believe you will need to rename the database directory underr hive
> warehouse ditectory <DBNAME>.db.
>
> Then you can hack Hive metasttore database. Mine is on SAP ASE. Certain
> tables like DBS etc in metastoreDB need to be changed. I cannot
> fremember on top of my head. Best to basckup database before hacking it
> and do it out of business hours.
>
> That is an approch. I am sure there are better ways.
>
> HTH,
>
> Mich
>
> On 27/3/2015, "Fabio C." <an...@gmail.com> wrote:
>
> >Maybe they just typed time_shit instead of time_shift and found it out
> >after 3 hours of tables compression... I don't think it's too important,
> >but which is the workaround? I'm also interested in this.
> >Maybe it's just a matter of metastore and one could try to explore the
> >metastore db to change how the database is referenced, possibly having to
> >change also the DB folder name on HDFS... My two cents ;)
> >
> >Regards
> >
> >On Fri, Mar 27, 2015 at 3:10 PM, @Sanjiv Singh <sa...@gmail.com>
> >wrote:
> >
> >> Can I know why do you want to do so?
> >>
> >> Currently There is no command or direct way to do that..then I can
> suggest
> >> workaround for this.
> >>
> >> Thanks,
> >> Sanjiv Singh
> >>
> >>
> >> Regards
> >> Sanjiv Singh
> >> Mob : +091 9990-447-339
> >>
> >> On Wed, Mar 25, 2015 at 10:01 AM, Shushant Arora <
> >> shushantarora09@gmail.com> wrote:
> >>
> >>> Hi
> >>>
> >>> Is there any way in hive0.10 to rename a database ?
> >>>
> >>> Thanks
> >>>
> >>>
> >>
> >
> >
>
Re: rename a database
Posted by Dr Mich Talebzadeh <mi...@peridale.co.uk>.
yep it can can happen in any server hosting a database or schema.
I believe you will need to rename the database directory underr hive
warehouse ditectory <DBNAME>.db.
Then you can hack Hive metasttore database. Mine is on SAP ASE. Certain
tables like DBS etc in metastoreDB need to be changed. I cannot
fremember on top of my head. Best to basckup database before hacking it
and do it out of business hours.
That is an approch. I am sure there are better ways.
HTH,
Mich
On 27/3/2015, "Fabio C." <an...@gmail.com> wrote:
>Maybe they just typed time_shit instead of time_shift and found it out
>after 3 hours of tables compression... I don't think it's too important,
>but which is the workaround? I'm also interested in this.
>Maybe it's just a matter of metastore and one could try to explore the
>metastore db to change how the database is referenced, possibly having to
>change also the DB folder name on HDFS... My two cents ;)
>
>Regards
>
>On Fri, Mar 27, 2015 at 3:10 PM, @Sanjiv Singh <sa...@gmail.com>
>wrote:
>
>> Can I know why do you want to do so?
>>
>> Currently There is no command or direct way to do that..then I can suggest
>> workaround for this.
>>
>> Thanks,
>> Sanjiv Singh
>>
>>
>> Regards
>> Sanjiv Singh
>> Mob : +091 9990-447-339
>>
>> On Wed, Mar 25, 2015 at 10:01 AM, Shushant Arora <
>> shushantarora09@gmail.com> wrote:
>>
>>> Hi
>>>
>>> Is there any way in hive0.10 to rename a database ?
>>>
>>> Thanks
>>>
>>>
>>
>
>
Re: rename a database
Posted by "Fabio C." <an...@gmail.com>.
Maybe they just typed time_shit instead of time_shift and found it out
after 3 hours of tables compression... I don't think it's too important,
but which is the workaround? I'm also interested in this.
Maybe it's just a matter of metastore and one could try to explore the
metastore db to change how the database is referenced, possibly having to
change also the DB folder name on HDFS... My two cents ;)
Regards
On Fri, Mar 27, 2015 at 3:10 PM, @Sanjiv Singh <sa...@gmail.com>
wrote:
> Can I know why do you want to do so?
>
> Currently There is no command or direct way to do that..then I can suggest
> workaround for this.
>
> Thanks,
> Sanjiv Singh
>
>
> Regards
> Sanjiv Singh
> Mob : +091 9990-447-339
>
> On Wed, Mar 25, 2015 at 10:01 AM, Shushant Arora <
> shushantarora09@gmail.com> wrote:
>
>> Hi
>>
>> Is there any way in hive0.10 to rename a database ?
>>
>> Thanks
>>
>>
>
Re: rename a database
Posted by "@Sanjiv Singh" <sa...@gmail.com>.
Can I know why do you want to do so?
Currently There is no command or direct way to do that..then I can suggest
workaround for this.
Thanks,
Sanjiv Singh
Regards
Sanjiv Singh
Mob : +091 9990-447-339
On Wed, Mar 25, 2015 at 10:01 AM, Shushant Arora <sh...@gmail.com>
wrote:
> Hi
>
> Is there any way in hive0.10 to rename a database ?
>
> Thanks
>
>