Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-2268

CREATE.. TABLE.. LIKE should not inherit the original owner of the table.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.7.0, 0.7.1, 0.8.0
    • None
    • Metastore, Security

    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:

      {EXTERNAL=TRUE, transient_lastDdlTime=1309996190}

      , 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:

      {transient_lastDdlTime=1309996554}

      , viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)

      Attachments

        1. hive-2268.1.patch
          0.6 kB
          Franklin Hu

        Issue Links

          Activity

            People

              ccy Charles Chen
              esteban Esteban Gutierrez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: