You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Mark Tozzi <ma...@gmail.com> on 2010/06/09 20:09:32 UTC

Hive command to dump table create statements?

Hi All,

For an existing mysql database, I have a tool which dumps out the
create table statements for all tables, and checks them into SVN on a
daily basis, to keep the schema under version control.  For various
reasons, this works better for my team than a change script model.  We
have recently started using hive as a primary data store, and I would
like to apply a similar idea to the hive schema.  Ideally, I would
like a command to directly dump the create table statements, but I can
also construct them out of several outputs if all the data is
available.  In particular, I'm having a hard time finding the row
format and partition information.

I'm also interested in hearing what schema versioning techniques have
worked for anyone else.

Thanks in advance,

--Mark Tozzi

Re: Hive command to dump table create statements?

Posted by Edward Capriolo <ed...@gmail.com>.
On Wed, Jun 9, 2010 at 2:34 PM, Edward Capriolo <ed...@gmail.com>wrote:

>
>
> On Wed, Jun 9, 2010 at 2:09 PM, Mark Tozzi <ma...@gmail.com> wrote:
>
>> Hi All,
>>
>> For an existing mysql database, I have a tool which dumps out the
>> create table statements for all tables, and checks them into SVN on a
>> daily basis, to keep the schema under version control.  For various
>> reasons, this works better for my team than a change script model.  We
>> have recently started using hive as a primary data store, and I would
>> like to apply a similar idea to the hive schema.  Ideally, I would
>> like a command to directly dump the create table statements, but I can
>> also construct them out of several outputs if all the data is
>> available.  In particular, I'm having a hard time finding the row
>> format and partition information.
>>
>> I'm also interested in hearing what schema versioning techniques have
>> worked for anyone else.
>>
>> Thanks in advance,
>>
>> --Mark Tozzi
>>
> Hey Mark :)
>
> show create table is in the works:
>
> https://issues.apache.org/jira/browse/HIVE-967
>
> You can also take a look at some web interface code. Which shows how to
> walk the metastore programatically.
>
> <trunk>hwi/web/show_table.jsp
>
>
>
>
>
> And the most obvious solution... describe EXTENDED table has all the
information. It is not the create syntax but it has all the relevant
information.

Re: Hive command to dump table create statements?

Posted by Edward Capriolo <ed...@gmail.com>.
On Wed, Jun 9, 2010 at 2:09 PM, Mark Tozzi <ma...@gmail.com> wrote:

> Hi All,
>
> For an existing mysql database, I have a tool which dumps out the
> create table statements for all tables, and checks them into SVN on a
> daily basis, to keep the schema under version control.  For various
> reasons, this works better for my team than a change script model.  We
> have recently started using hive as a primary data store, and I would
> like to apply a similar idea to the hive schema.  Ideally, I would
> like a command to directly dump the create table statements, but I can
> also construct them out of several outputs if all the data is
> available.  In particular, I'm having a hard time finding the row
> format and partition information.
>
> I'm also interested in hearing what schema versioning techniques have
> worked for anyone else.
>
> Thanks in advance,
>
> --Mark Tozzi
>
Hey Mark :)

show create table is in the works:

https://issues.apache.org/jira/browse/HIVE-967

You can also take a look at some web interface code. Which shows how to walk
the metastore programatically.

<trunk>hwi/web/show_table.jsp