Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

is there a way in hive to list all the table locations along with the partition location.

avatar
 
1 ACCEPTED SOLUTION

avatar
Super Guru

if you are using mysql database as metastore then you can use following query to get partition locations directly from metastore.

select TBLS.TBL_NAME,PARTITIONS.PART_NAME,SDS.LOCATIONfrom SDS,TBLS,PARTITIONSwhere PARTITIONS.SD_ID = SDS.SD_IDand TBLS.TBL_ID=PARTITIONS.TBL_IDorder by 1,2;

View solution in original post

1 REPLY 1

avatar
Super Guru

if you are using mysql database as metastore then you can use following query to get partition locations directly from metastore.

select TBLS.TBL_NAME,PARTITIONS.PART_NAME,SDS.LOCATIONfrom SDS,TBLS,PARTITIONSwhere PARTITIONS.SD_ID = SDS.SD_IDand TBLS.TBL_ID=PARTITIONS.TBL_IDorder by 1,2;