org.apache.hadoop.hive.metastore.api.PartitionsStatsRequest Java Examples

The following examples show how to use org.apache.hadoop.hive.metastore.api.PartitionsStatsRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThriftHiveMetastoreClient.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
public Map<String, List<ColumnStatisticsObj>> getPartitionColumnStatistics(String databaseName, String tableName, List<String> partitionNames, List<String> columnNames)
        throws TException
{
    PartitionsStatsRequest partitionsStatsRequest = new PartitionsStatsRequest(databaseName, tableName, columnNames, partitionNames);
    return client.get_partitions_statistics_req(partitionsStatsRequest).getPartStats();
}
 
Example #2
Source File: FederatedHMSHandler.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Override
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
public PartitionsStatsResult get_partitions_statistics_req(PartitionsStatsRequest request)
    throws NoSuchObjectException, MetaException, TException {
  DatabaseMapping mapping = databaseMappingService.databaseMapping(request.getDbName());
  return mapping.getClient().get_partitions_statistics_req(mapping.transformInboundPartitionsStatsRequest(request));
}
 
Example #3
Source File: FederatedHMSHandler.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Override
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
public AggrStats get_aggr_stats_for(PartitionsStatsRequest request)
    throws NoSuchObjectException, MetaException, TException {
  DatabaseMapping mapping = databaseMappingService.databaseMapping(request.getDbName());
  return mapping.getClient().get_aggr_stats_for(mapping.transformInboundPartitionsStatsRequest(request));
}
 
Example #4
Source File: DatabaseMappingImplTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void transformInboundPartitionsStatsRequest() throws Exception {
  PartitionsStatsRequest partitionStatsRequest = new PartitionsStatsRequest();
  partitionStatsRequest.setDbName(DB_NAME);
  PartitionsStatsRequest result = databaseMapping.transformInboundPartitionsStatsRequest(partitionStatsRequest);
  assertThat(result, is(sameInstance(partitionStatsRequest)));
  assertThat(result.getDbName(), is(IN_DB_NAME));
}
 
Example #5
Source File: FederatedHMSHandlerTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void get_partitions_statistics_req() throws TException {
  PartitionsStatsRequest request = new PartitionsStatsRequest(DB_P, "table", Collections.emptyList(),
      Collections.emptyList());
  PartitionsStatsRequest inboundRequest = new PartitionsStatsRequest();
  PartitionsStatsResult expected = new PartitionsStatsResult();
  when(primaryMapping.transformInboundPartitionsStatsRequest(request)).thenReturn(inboundRequest);
  when(primaryClient.get_partitions_statistics_req(inboundRequest)).thenReturn(expected);
  PartitionsStatsResult result = handler.get_partitions_statistics_req(request);
  assertThat(result, is(expected));
}
 
Example #6
Source File: FederatedHMSHandlerTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void get_aggr_stats_for() throws TException {
  PartitionsStatsRequest request = new PartitionsStatsRequest(DB_P, "table", Collections.emptyList(),
      Collections.emptyList());
  PartitionsStatsRequest inboundRequest = new PartitionsStatsRequest();
  AggrStats expected = new AggrStats();
  when(primaryMapping.transformInboundPartitionsStatsRequest(request)).thenReturn(inboundRequest);
  when(primaryClient.get_aggr_stats_for(inboundRequest)).thenReturn(expected);
  AggrStats result = handler.get_aggr_stats_for(request);
  assertThat(result, is(expected));
}
 
Example #7
Source File: DatabaseMappingImpl.java    From waggle-dance with Apache License 2.0 4 votes vote down vote up
@Override
public PartitionsStatsRequest transformInboundPartitionsStatsRequest(PartitionsStatsRequest request) {
  request.setDbName(metaStoreMapping.transformInboundDatabaseName(request.getDbName()));
  return request;
}
 
Example #8
Source File: IdentityMapping.java    From waggle-dance with Apache License 2.0 4 votes vote down vote up
@Override
public PartitionsStatsRequest transformInboundPartitionsStatsRequest(PartitionsStatsRequest request) {
  return request;
}
 
Example #9
Source File: IdentityMappingTest.java    From waggle-dance with Apache License 2.0 4 votes vote down vote up
@Test
public void transformInboundPartitionsStatsRequest() throws Exception {
  PartitionsStatsRequest partitionStatsRequest = new PartitionsStatsRequest();
  PartitionsStatsRequest result = databaseMapping.transformInboundPartitionsStatsRequest(partitionStatsRequest);
  assertThat(result, is(sameInstance(partitionStatsRequest)));
}
 
Example #10
Source File: CatalogThriftHiveMetastore.java    From metacat with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public AggrStats get_aggr_stats_for(final PartitionsStatsRequest request) throws TException {
    throw unimplemented("get_aggr_stats_for", new Object[]{request});
}
 
Example #11
Source File: CatalogThriftHiveMetastore.java    From metacat with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public PartitionsStatsResult get_partitions_statistics_req(final PartitionsStatsRequest request) throws TException {
    throw unimplemented("get_partitions_statistics_req", new Object[]{request});
}
 
Example #12
Source File: DatabaseMapping.java    From waggle-dance with Apache License 2.0 votes vote down vote up
PartitionsStatsRequest transformInboundPartitionsStatsRequest(PartitionsStatsRequest request);