kalyan kumar kalvagadda created SENTRY-2430:
-----------------------------------------------
Summary: Avoid getting the complete partition objects and fetch
the location information only.
Key: SENTRY-2430
URL: https://issues.apache.org/jira/browse/SENTRY-2430
Project: Sentry
Issue Type: Sub-task
Components: Sentry
Environment: {code:java}
// code placeholder
{code}
Reporter: kalyan kumar kalvagadda
With the changes added as part of HIVE-20306, HiveMetaStoreClient now exposes
new API "
"getPartitionsWithSpecs" using which sentry can request specific information
for partition.
In simple words sentry could say fetch me the location information for the
partitions in given table. Here is simple example on how it can be used.
{code:java}
GetPartitionsRequest request = new GetPartitionsRequest();
GetPartitionsProjectSpec projectSpec = new GetPartitionsProjectSpec();
projectSpec.setFieldList(Arrays.asList("sd.location"));
GetPartitionsFilterSpec filter = new GetPartitionsFilterSpec();
filter.setDbName("compdb");
filter.setTblName("comptbl");
request.setFilterSpec(filter);
request.setProjectionSpec(projectSpec);
GetPartitionsResponse response;
try {
response = client.getPartitionsWithSpecs(request);
} catch (Exception ex) {
ex.printStackTrace();
LOG.error("Exception while retrieving partitions", ex);
throw ex;
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)