You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Sushanth Sowmyan <kh...@gmail.com> on 2014/03/13 23:15:48 UTC

create table like behaviour

Hi All,

Currently, if I do the following:

hive -e 'create table a(k1 string, k2 int) TBLPROPERTIES("pi" = "3.14159")'
hive -e 'create table b like a;'
hive -e 'describe extended a;'
hive -e 'describe extended b;'


We see that the table property is not copied over to the definition of
b. Does anyone know if this is by design (i.e. by a principle that
table properties are not table description and so should not be copied
over) or is it a bug? I also notice that there's HIVE-3527, which
added the ability to create TBLPROPERTIES on the table being created,
so I assume it's by design, but I wanted to check if anyone knew/had
strong feelings about it.

I can see a good reason for not copying over tableproperties if
they're used to store specific table state (say backup state/etc), but
I also see a good reason for copying over table properties, with
things like orc, which store table metadata of sorts(like
orc.compress, or stride size, etc) in table properties, which makes a
good case for copying them over  if a person wants to create a table
with similar definitions to the first.

-Sushanth

Re: create table like behaviour

Posted by Thejas Nair <th...@hortonworks.com>.
I think it is intuitive that all metadata gets copied over, for 'create
table like'.  I would treat the case of TBLPROPERTIES that should not be
copied over as a very special case, a case in which the user should be able
to remove the property.


On Thu, Mar 13, 2014 at 3:15 PM, Sushanth Sowmyan <kh...@gmail.com>wrote:

> Hi All,
>
> Currently, if I do the following:
>
> hive -e 'create table a(k1 string, k2 int) TBLPROPERTIES("pi" = "3.14159")'
> hive -e 'create table b like a;'
> hive -e 'describe extended a;'
> hive -e 'describe extended b;'
>
>
> We see that the table property is not copied over to the definition of
> b. Does anyone know if this is by design (i.e. by a principle that
> table properties are not table description and so should not be copied
> over) or is it a bug? I also notice that there's HIVE-3527, which
> added the ability to create TBLPROPERTIES on the table being created,
> so I assume it's by design, but I wanted to check if anyone knew/had
> strong feelings about it.
>
> I can see a good reason for not copying over tableproperties if
> they're used to store specific table state (say backup state/etc), but
> I also see a good reason for copying over table properties, with
> things like orc, which store table metadata of sorts(like
> orc.compress, or stride size, etc) in table properties, which makes a
> good case for copying them over  if a person wants to create a table
> with similar definitions to the first.
>
> -Sushanth
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.