hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vidhya Venkataraman <>
Subject Create external table like.
Date Fri, 27 Jul 2012 16:51:16 GMT
  I am using Hive 0.7.x on my dev machine (yeah we will be upgrading soon
:) )

  I used the statement indicated in the subject to create an external table:

*create external table ext_sample_v1 like sample_v1 location
Since sample_v1 had partitions, I added some of them to ext_sample_v1 as

*alter table ext_sample_v1 add partition (dt='8/1/2012');*

Select * on ext_sample_v1 yields the correct result.

One odd thing is:
*hive > describe extended ext_sample_v1;*
key_index int
userid bigint
otherid bigint
dt string

Detailed Table Information Table(tableName:ext_sample_v1, dbName:default,
owner:vidhya, createTime:1343406972, lastAccessTime:0, retention:0,
sd:StorageDescriptor(cols:[FieldSchema(name:key_index, type:int,
comment:null), FieldSchema(name:userid, type:bigint, comment:null),
FieldSchema(name:otherid, type:bigint, comment:null), FieldSchema(name:dt,
type:string, comment:null)],
compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null,
parameters:{serialization.format=1}), bucketCols:[], sortCols:[],
parameters:{}), partitionKeys:[FieldSchema(name:dt, type:string,
comment:null)], parameters:{last_modified_by=vidhya, external=true,
last_modified_time=1343407191, transient_lastDdlTime=1343407191},
viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)

Notice the MANAGED_TABLE value! So, it doesn't treat this table as an
external table. In fact when I drop ext_sample_v1, it also deletes the data
associated with it. I didn't look into Hive source, but is this expected?
Is this corrected in a future version?


View raw message