Java Code Examples for org.apache.hadoop.hive.metastore.api.TableStatsRequest

The following examples show how to use org.apache.hadoop.hive.metastore.api.TableStatsRequest. These examples are extracted from open source projects. 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 Project: presto   Source File: ThriftHiveMetastoreClient.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public List<ColumnStatisticsObj> getTableColumnStatistics(String databaseName, String tableName, List<String> columnNames)
        throws TException
{
    TableStatsRequest tableStatsRequest = new TableStatsRequest(databaseName, tableName, columnNames);
    return client.get_table_statistics_req(tableStatsRequest).getTableStats();
}
 
Example 2
Source Project: waggle-dance   Source File: FederatedHMSHandler.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
public TableStatsResult get_table_statistics_req(TableStatsRequest request)
    throws NoSuchObjectException, MetaException, TException {
  DatabaseMapping mapping = databaseMappingService.databaseMapping(request.getDbName());
  return mapping.getClient().get_table_statistics_req(mapping.transformInboundTableStatsRequest(request));
}
 
Example 3
Source Project: waggle-dance   Source File: DatabaseMappingImplTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void transformInboundTableStatsRequest() throws Exception {
  TableStatsRequest tableStatsRequest = new TableStatsRequest();
  tableStatsRequest.setDbName(DB_NAME);
  TableStatsRequest result = databaseMapping.transformInboundTableStatsRequest(tableStatsRequest);
  assertThat(result, is(sameInstance(tableStatsRequest)));
  assertThat(result.getDbName(), is(IN_DB_NAME));
}
 
Example 4
Source Project: waggle-dance   Source File: FederatedHMSHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void get_table_statistics_req() throws TException {
  TableStatsRequest tableStatsRequest = new TableStatsRequest(DB_P, "table", Collections.emptyList());
  TableStatsRequest inboundTableStatsRequest = new TableStatsRequest();
  TableStatsResult expected = new TableStatsResult();
  when(primaryMapping.transformInboundTableStatsRequest(tableStatsRequest)).thenReturn(inboundTableStatsRequest);
  when(primaryClient.get_table_statistics_req(inboundTableStatsRequest)).thenReturn(expected);
  TableStatsResult result = handler.get_table_statistics_req(tableStatsRequest);
  assertThat(result, is(expected));
}
 
Example 5
Source Project: waggle-dance   Source File: DatabaseMappingImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public TableStatsRequest transformInboundTableStatsRequest(TableStatsRequest request) {
  request.setDbName(metaStoreMapping.transformInboundDatabaseName(request.getDbName()));
  return request;
}
 
Example 6
Source Project: waggle-dance   Source File: IdentityMapping.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public TableStatsRequest transformInboundTableStatsRequest(TableStatsRequest request) {
  return request;
}
 
Example 7
Source Project: waggle-dance   Source File: IdentityMappingTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void transformInboundTableStatsRequest() throws Exception {
  TableStatsRequest tableStatsRequest = new TableStatsRequest();
  TableStatsRequest result = databaseMapping.transformInboundTableStatsRequest(tableStatsRequest);
  assertThat(result, is(sameInstance(tableStatsRequest)));
}
 
Example 8
Source Project: metacat   Source File: CatalogThriftHiveMetastore.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public TableStatsResult get_table_statistics_req(final TableStatsRequest request) throws TException {
    throw unimplemented("get_table_statistics_req", new Object[]{request});
}
 
Example 9
Source Project: waggle-dance   Source File: DatabaseMapping.java    License: Apache License 2.0 votes vote down vote up
TableStatsRequest transformInboundTableStatsRequest(TableStatsRequest request);