You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Giridhar Addepalli <gi...@gmail.com> on 2013/03/18 10:47:42 UTC

listPartitions method of HiveMetaStoreClient taking lot of time

Hi,

i am interested in getting CREATE_TIME of all partitions in a given table.
Hence used, HiveMetaStoreClient.listPartitions method to get List of
'Partition' objects.
This method is taking lot of time, when we ran profiler we see lot of SQL
queries in the background.
Looks like there is separate query for every Partition.

"SELECT
`A0`.`SD_ID`,`B0`.`INPUT_FORMAT`,`B0`.`IS_COMPRESSED`,`B0`.`LOCATION`,`B0`.`NUM_BUCKETS`,`B0`.`OUTPUT_FORMAT`,`B0`.`SD_ID`,`A0`.`TBL_ID`,`C0`.`CREATE_TIME`,`C0`.`LAST_ACCESS_TIME`,`C0`.`OWNER`,`C0`.`RETENTION`,`C0`.`TBL_NAME`,`C0`.`TBL_TYPE`,`C0`.`TBL_ID`
FROM  `PARTITIONS` `A0`
LEFT OUTER JOIN `SDS` `B0` ON `A0`.`SD_ID` = `B0`.`SD_ID`
LEFT OUTER JOIN `TBLS` `C0` ON `A0`.`TBL_ID` = `C0`.`TBL_ID`
WHERE `A0`.`PART_ID` = ?
"

Is there a way to get all information in a single query.

Since coming up with single query is not difficult, how should i proceed to
run this query ?

Thanks,
Giridhar.