Search in sources :

Example 21 with ListTablesRequest

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

the class OracleMuxJdbcMetadataHandlerTest method doListTables.

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

Example 22 with ListTablesRequest

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

the class RedshiftMuxJdbcMetadataHandlerTest method doListTables.

@Test
public void doListTables() {
    ListTablesRequest listTablesRequest = Mockito.mock(ListTablesRequest.class);
    Mockito.when(listTablesRequest.getCatalogName()).thenReturn("redshift");
    this.jdbcMetadataHandler.doListTables(this.allocator, listTablesRequest);
    Mockito.verify(this.redshiftMetadataHandler, Mockito.times(1)).doListTables(Mockito.eq(this.allocator), Mockito.eq(listTablesRequest));
}
Also used : ListTablesRequest(com.amazonaws.athena.connector.lambda.metadata.ListTablesRequest) Test(org.junit.Test)

Example 23 with ListTablesRequest

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

the class SynapseMuxMetadataHandlerTest method doListTables.

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

Example 24 with ListTablesRequest

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

the class SqlServerMuxMetadataHandlerTest method doListTables.

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

Example 25 with ListTablesRequest

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

the class TPCDSMetadataHandlerTest method doListTables.

@Test
public void doListTables() {
    logger.info("doListTables - enter");
    ListTablesRequest req = new ListTablesRequest(identity, "queryId", "default", "tpcds1", null, UNLIMITED_PAGE_SIZE_VALUE);
    ListTablesResponse res = handler.doListTables(allocator, req);
    logger.info("doListTables - {}", res.getTables());
    assertTrue(res.getTables().contains(new TableName("tpcds1", "customer")));
    assertTrue(res.getTables().size() == 25);
    logger.info("doListTables - exit");
}
Also used : TableName(com.amazonaws.athena.connector.lambda.domain.TableName) ListTablesRequest(com.amazonaws.athena.connector.lambda.metadata.ListTablesRequest) ListTablesResponse(com.amazonaws.athena.connector.lambda.metadata.ListTablesResponse) Test(org.junit.Test)

Aggregations

ListTablesRequest (com.amazonaws.athena.connector.lambda.metadata.ListTablesRequest)33 Test (org.junit.Test)31 ListTablesResponse (com.amazonaws.athena.connector.lambda.metadata.ListTablesResponse)17 TableName (com.amazonaws.athena.connector.lambda.domain.TableName)13 ArrayList (java.util.ArrayList)5 ImmutableList (com.google.common.collect.ImmutableList)4 SchemaBuilder (com.amazonaws.athena.connector.lambda.data.SchemaBuilder)3 BlockAllocatorImpl (com.amazonaws.athena.connector.lambda.data.BlockAllocatorImpl)2 GetTablesResult (com.amazonaws.services.glue.model.GetTablesResult)2 Table (com.amazonaws.services.glue.model.Table)2 Matchers.anyString (org.mockito.Matchers.anyString)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 AmazonServiceException (com.amazonaws.AmazonServiceException)1 BlockAllocator (com.amazonaws.athena.connector.lambda.data.BlockAllocator)1 Split (com.amazonaws.athena.connector.lambda.domain.Split)1 Constraints (com.amazonaws.athena.connector.lambda.domain.predicate.Constraints)1 EquatableValueSet (com.amazonaws.athena.connector.lambda.domain.predicate.EquatableValueSet)1 Range (com.amazonaws.athena.connector.lambda.domain.predicate.Range)1 SortedRangeSet (com.amazonaws.athena.connector.lambda.domain.predicate.SortedRangeSet)1 ValueSet (com.amazonaws.athena.connector.lambda.domain.predicate.ValueSet)1