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