hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giridhar Addepalli <giridhar1...@gmail.com>
Subject listPartitions method of HiveMetaStoreClient taking lot of time
Date Mon, 18 Mar 2013 09:47:42 GMT
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.

Mime
View raw message