Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
New Contributor
 
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;