`

hive查看建立表的类型是内部还是外部表

    博客分类:
  • hive
 
阅读更多

 

 

 

方式1, 进入mysql在 TBLS 表中, 有表名称和表类型。

 

方式2, 更直观, hive (default)> desc extended t;  查看 tableType:的结果,一般都在展示结果的最后显示

 

eg:

 

hive (default)> desc extended t;
OK
col_name        data_type       comment
name1   string
id1     string
                 
Detailed Table Information      Table(tableName:t, dbName:default, owner:root, createTime:1440586891, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:name1, type:string, comment:null), FieldSchema(name:id1, type:string, comment:null)], location:hdfs://chinadaas109:8020/hive1/user/hive/warehouse/t, 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=,}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{last_modified_by=root, last_modified_time=1440587032, transient_lastDdlTime=1440587032}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)

 

 

方式3:  hive (default)> desc formatted t;  一个格式化方式查看方式2中的信息,更容易看到 比如如下:

Table Type:             MANAGED_TABLE

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics