Search in sources :

Example 41 with GetTableRequest

use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.

the class HiveMuxMetadataHandlerTest method doGetTable.

@Test
public void doGetTable() throws Exception {
    GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
    Mockito.when(getTableRequest.getCatalogName()).thenReturn("metaHive");
    this.jdbcMetadataHandler.doGetTable(this.allocator, getTableRequest);
    Mockito.verify(this.hiveMetadataHandler, Mockito.times(1)).doGetTable(Mockito.eq(this.allocator), Mockito.eq(getTableRequest));
}
Also used : GetTableRequest(com.amazonaws.athena.connector.lambda.metadata.GetTableRequest) Test(org.junit.Test)

Example 42 with GetTableRequest

use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.

the class AwsCmdbMetadataHandlerTest method doGetTable.

@Test
public void doGetTable() {
    GetTableRequest request = new GetTableRequest(identity, queryId, catalog, new TableName("schema1", "table1"));
    when(mockTableProvider1.getTable(eq(blockAllocator), eq(request))).thenReturn(mock(GetTableResponse.class));
    GetTableResponse response = handler.doGetTable(blockAllocator, request);
    assertNotNull(response);
    verify(mockTableProvider1, times(1)).getTable(eq(blockAllocator), eq(request));
}
Also used : GetTableRequest(com.amazonaws.athena.connector.lambda.metadata.GetTableRequest) TableName(com.amazonaws.athena.connector.lambda.domain.TableName) GetTableResponse(com.amazonaws.athena.connector.lambda.metadata.GetTableResponse) Test(org.junit.Test)

Example 43 with GetTableRequest

use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.

the class ImpalaMuxMetadataHandlerTest method doGetTable.

@Test
public void doGetTable() {
    GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
    Mockito.when(getTableRequest.getCatalogName()).thenReturn("metaImpala");
    this.jdbcMetadataHandler.doGetTable(this.allocator, getTableRequest);
    Mockito.verify(this.impalaMetadataHandler, Mockito.times(1)).doGetTable(Mockito.eq(this.allocator), Mockito.eq(getTableRequest));
}
Also used : GetTableRequest(com.amazonaws.athena.connector.lambda.metadata.GetTableRequest) Test(org.junit.Test)

Example 44 with GetTableRequest

use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.

the class MetricsMetadataHandlerTest method doGetMetricsTable.

@Test
public void doGetMetricsTable() {
    logger.info("doGetMetricsTable - enter");
    GetTableRequest metricsTableReq = new GetTableRequest(identity, "queryId", "default", new TableName(defaultSchema, "metrics"));
    GetTableResponse metricsTableRes = handler.doGetTable(allocator, metricsTableReq);
    logger.info("doGetMetricsTable - {} {}", metricsTableRes.getTableName(), metricsTableRes.getSchema());
    assertEquals(new TableName(defaultSchema, "metrics"), metricsTableRes.getTableName());
    assertNotNull(metricsTableRes.getSchema());
    assertEquals(6, metricsTableRes.getSchema().getFields().size());
    logger.info("doGetMetricsTable - exit");
}
Also used : GetTableRequest(com.amazonaws.athena.connector.lambda.metadata.GetTableRequest) TableName(com.amazonaws.athena.connector.lambda.domain.TableName) GetTableResponse(com.amazonaws.athena.connector.lambda.metadata.GetTableResponse) Test(org.junit.Test)

Example 45 with GetTableRequest

use of com.amazonaws.athena.connector.lambda.metadata.GetTableRequest in project aws-athena-query-federation by awslabs.

the class DataLakeGen2MuxMetadataHandlerTest method doGetTable.

@Test
public void doGetTable() {
    GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
    Mockito.when(getTableRequest.getCatalogName()).thenReturn("fakedatabase");
    this.jdbcMetadataHandler.doGetTable(this.allocator, getTableRequest);
    Mockito.verify(this.dataLakeGen2MetadataHandler, Mockito.times(1)).doGetTable(Mockito.eq(this.allocator), Mockito.eq(getTableRequest));
}
Also used : GetTableRequest(com.amazonaws.athena.connector.lambda.metadata.GetTableRequest) Test(org.junit.Test)

Aggregations

GetTableRequest (com.amazonaws.athena.connector.lambda.metadata.GetTableRequest)51 Test (org.junit.Test)48 GetTableResponse (com.amazonaws.athena.connector.lambda.metadata.GetTableResponse)33 TableName (com.amazonaws.athena.connector.lambda.domain.TableName)30 ArrayList (java.util.ArrayList)13 GetTableResult (com.amazonaws.services.glue.model.GetTableResult)11 Column (com.amazonaws.services.glue.model.Column)10 Schema (org.apache.arrow.vector.types.pojo.Schema)10 StorageDescriptor (com.amazonaws.services.glue.model.StorageDescriptor)9 Table (com.amazonaws.services.glue.model.Table)8 InvocationOnMock (org.mockito.invocation.InvocationOnMock)8 SchemaBuilder (com.amazonaws.athena.connector.lambda.data.SchemaBuilder)7 Constraints (com.amazonaws.athena.connector.lambda.domain.predicate.Constraints)7 HashMap (java.util.HashMap)7 BlockAllocatorImpl (com.amazonaws.athena.connector.lambda.data.BlockAllocatorImpl)6 ResultSet (java.sql.ResultSet)6 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)6 Field (org.apache.arrow.vector.types.pojo.Field)6 ReadRecordsRequest (com.amazonaws.athena.connector.lambda.records.ReadRecordsRequest)5 ReadRecordsResponse (com.amazonaws.athena.connector.lambda.records.ReadRecordsResponse)4