hive partition 分区详解一

一.查看分区命令

1.show partitions xxx

hive> show partitions xxx;
OK
day=20150908
day=20151020
day=20151021
day=20151022

...

day=20160318
Time taken: 0.139 seconds, Fetched: 144 row(s)

由此可见上述命令显示了基本的分区情况

2.desc xxx partition(day=20160315

hive> desc xxx partition(day=20160315);
OK
list_time               string
cookie                  string
device_id               string
os                      string
device_brand            string
search_id               string
search_guid             string
...
filter                  string
day                     string

# Partition Information
# col_name                data_type               comment

day                     string
Time taken: 0.359 seconds, Fetched: 36 row(s)

此命令显示了表结构与partition information

3.

hive>  desc extended ods_search_log_app partition(day=20160315);
OK
list_time               string
cookie                  string
device_id               string
os                      string
device_brand            string
search_id               string
search_guid             string
...
coupon                  string
filter                  string
day                     string

# Partition Information
# col_name                data_type               comment

day                     string

Detailed Partition Information    Partition(values:[20160315], dbName:xxx, tableName:xxx, ............. location:hdfs://mycluster/data/hive/warehouse/xxx/xxx/day=20160315, 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=1}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), parameters:{transient_lastDdlTime=1458083053})
Time taken: 0.369 seconds, Fetched: 38 row(s)

多了个Detailed Partition Information,最初使用这条命令的初衷,是查找分区对应的location,使用这条命令可以找到

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值