Hive desc

Describe Database

hive> DESCRIBE DATABASE test;
test    ???     hdfs://ns1/user/hive/warehouse/test.db  wx    USER
hive> DESCRIBE DATABASE EXTENDED test;
test    ???     hdfs://ns1/user/hive/warehouse/test.db  wx    USER    {date=2015-07-18, creator=wx}

Describe Table/View/Column

hive> DESCRIBE  user_info_bucketed;

user_id                 bigint                                     

firstname               string                                     

lastname                string                                      

ds                      string                                     

                

# Partition Information         

# col_name              data_type               comment                          

ds                      string                                      

 

 

hive> DESCRIBE FORMATTED user_info_bucketed.firstname

hive> DESCRIBE FORMATTED user_info_bucketed firstname;

# col_name              data_type               min                     max                     num_nulls               distinct_count          avg_col_len           max_col_len              num_trues               num_falses              comment            

                                                                                 

firstname               string                                                                                                                                                                                                                   from deserializer  

 

hive> DESCRIBE EXTENDED user_info_bucketed.firstname;
firstname               string                  from deserializer  

 

hive> DESCRIBE FORMATTED user_info_bucketed;

# col_name              data_type               comment                       

user_id                 bigint                                     

firstname               string                                     

lastname                string                                     

                

# Partition Information         

# col_name              data_type               comment                         

ds                      string                                     

                

# Detailed Table Information            

Database:               test                    

Owner:                  huai                    

CreateTime:             Sat Jul 25 10:56:50 CST 2015    

LastAccessTime:         UNKNOWN                 

Protect Mode:           None                    

Retention:              0                       

Location:               hdfs://ns1/user/hive/warehouse/test.db/user_info_bucketed       

Table Type:             MANAGED_TABLE           

Table Parameters:               

        comment                 A bucketed copy of user_info

        transient_lastDdlTime   1437793010         

                

# Storage Information           

SerDe Library:          org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe      

InputFormat:            org.apache.hadoop.mapred.TextInputFormat        

OutputFormat:           org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat      

Compressed:             No                      

Num Buckets:            3                       

Bucket Columns:         [user_id]               

Sort Columns:           [Order(col:firstname, order:1)] 

Storage Desc Params:            

        serialization.format    1                  

 

 

hive> DESCRIBE EXTENDED user_info_bucketed;

user_id                 bigint                                     

firstname               string                                     

lastname                string                                     

ds                      string                                     

                

# Partition Information         

# col_name              data_type               comment             

                

ds                      string                                     

                

Detailed Table Information      Table(tableName:user_info_bucketed, dbName:test, owner:huai, createTime:1437793010, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:user_id, type:bigint, comment:null), FieldSchema(name:firstname, type:string, comment:null), FieldSchema(name:lastname, type:string, comment:null), FieldSchema(name:ds, type:string, comment:null)], location:hdfs://ns1/user/hive/warehouse/test.db/user_info_bucketed, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:3, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[user_id], sortCols:[Order(col:firstname, order:1)], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[FieldSchema(name:ds, type:string, comment:null)], parameters:{transient_lastDdlTime=1437793010, comment=A bucketed copy of user_info}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)

 

Describe Partition

hive> DESCRIBE FORMATTED user_info_bucketed PARTITION (ds='2015-07-25');

# col_name              data_type               comment                             

user_id                 bigint                                      

firstname               string                                     

lastname                string                                     

                

# Partition Information         

# col_name              data_type               comment                             

ds                      string                                     

                

# Detailed Partition Information                

Partition Value:        [2015-07-25]            

Database:               test                    

Table:                  user_info_bucketed      

CreateTime:             Sat Jul 25 10:59:28 CST 2015    

LastAccessTime:         UNKNOWN                 

Protect Mode:           None                     

Location:               hdfs://ns1/user/hive/warehouse/test.db/user_info_bucketed/ds=2015-07-25 

Partition Parameters:           

        COLUMN_STATS_ACCURATE   true               

        numFiles                3                  

        numRows                 4                  

        rawDataSize             68                 

        totalSize               72                 

        transient_lastDdlTime   1437793168         

                

# Storage Information           

SerDe Library:          org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe      

InputFormat:            org.apache.hadoop.mapred.TextInputFormat        

OutputFormat:           org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat      

Compressed:             No                      

Num Buckets:            3                       

Bucket Columns:         [user_id]               

Sort Columns:           [Order(col:firstname, order:1)] 

Storage Desc Params:            

        serialization.format    1                  

转载于:https://www.cnblogs.com/wwxbi/p/4676605.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值