Hive 查询元数据库获取某个分区的count数



=========查询分区的大小========= select d.NAME,t.TBL_NAME,p.PART_NAME,prm.PARAM_KEY,prm.PARAM_VALUE from TBLS t left join DBS d on t.DB_ID = d.DB_ID left join PARTITIONS p on t.TBL_ID = p.TBL_ID left join PARTITION_PARAMS prm on p.PART_ID=prm.PART_ID where d.NAME='novel' and t.TBL_NAME='textfile_table' and p.PART_NAME like 'event_day=20180402/event_hour=%' and prm.PARAM_KEY = 'totalSize'; =========查询分区信息========= select d.NAME,t.TBL_NAME,p.PART_NAME,p.PART_ID from TBLS t left join DBS d on t.DB_ID = d.DB_ID left join PARTITIONS p on t.TBL_ID = p.TBL_ID where d.NAME='novel' and t.TBL_NAME='textfile_table'

  

参考并改进:https://blog.csdn.net/bdchome/article/details/46965335

 

posted @ 2018-04-03 11:13  buoge  阅读(5375)  评论(0编辑  收藏  举报