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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM