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;