Details
Description
When a new table is created by using CREATE.. TABLE.. LIKE.. the new table inherits the existing owner of the table, this is issue is potentially conflicting for multiuser environments where Hive authorization is planned for future use.
– alice creates table
CREATE EXTERNAL TABLE foo(bar double)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
STORED AS TEXTFILE LOCATION '/user/alice/foo';
– table owner is alice as expected
hive> DESCRIBE EXTENDED foo;
OK
bar double
Detailed Table Information Table(tableName:foo, dbName:default, owner:alice , createTime:1309996190, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:bar, type:double, comment:null)], location:hdfs://localhost/user/alice/foo, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=,, field.delim=,, line.delim=
}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:
, viewOriginalText:null, viewExpandedText:null, tableType:EXTERNAL_TABLE)
– bob calls CREATE..TABLE..LIKE
CREATE TABLE foo_like LIKE foo;
– bob created a new table using like but the owner stills alice
– but the expected is owner:bob
hive> DESCRIBE EXTENDED foo_like;
OK
bar double
Detailed Table Information Table(tableName:foo_like, dbName:default, owner:alice , createTime:1309996554, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:bar, type:double, comment:null)], location:hdfs://localhost/user/hive/warehouse/foo_like, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=,, field.delim=,, line.delim=
}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:
, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)
Attachments
Attachments
Issue Links
- is blocked by
-
HIVE-1218 CREATE TABLE t LIKE some_view should create a new empty base table, but instead creates a copy of view
- Closed