Search in sources :

Example 76 with GetTableLayoutRequest

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

the class DocDBMetadataHandlerTest method doGetTableLayout.

@Test
public void doGetTableLayout() throws Exception {
    Schema schema = SchemaBuilder.newBuilder().build();
    GetTableLayoutRequest req = new GetTableLayoutRequest(IDENTITY, QUERY_ID, DEFAULT_CATALOG, TABLE_NAME, new Constraints(new HashMap<>()), schema, Collections.EMPTY_SET);
    GetTableLayoutResponse res = handler.doGetTableLayout(allocator, req);
    logger.info("doGetTableLayout - {}", res);
    Block partitions = res.getPartitions();
    for (int row = 0; row < partitions.getRowCount() && row < 10; row++) {
        logger.info("doGetTableLayout:{} {}", row, BlockUtils.rowToString(partitions, row));
    }
    assertTrue(partitions.getRowCount() > 0);
}
Also used : Constraints(com.amazonaws.athena.connector.lambda.domain.predicate.Constraints) GetTableLayoutResponse(com.amazonaws.athena.connector.lambda.metadata.GetTableLayoutResponse) HashMap(java.util.HashMap) Schema(org.apache.arrow.vector.types.pojo.Schema) GetTableLayoutRequest(com.amazonaws.athena.connector.lambda.metadata.GetTableLayoutRequest) Block(com.amazonaws.athena.connector.lambda.data.Block) Test(org.junit.Test)

Aggregations

GetTableLayoutRequest (com.amazonaws.athena.connector.lambda.metadata.GetTableLayoutRequest)76 Test (org.junit.Test)71 TableName (com.amazonaws.athena.connector.lambda.domain.TableName)54 Constraints (com.amazonaws.athena.connector.lambda.domain.predicate.Constraints)47 GetTableLayoutResponse (com.amazonaws.athena.connector.lambda.metadata.GetTableLayoutResponse)42 Schema (org.apache.arrow.vector.types.pojo.Schema)39 BlockAllocator (com.amazonaws.athena.connector.lambda.data.BlockAllocator)33 BlockAllocatorImpl (com.amazonaws.athena.connector.lambda.data.BlockAllocatorImpl)27 ResultSet (java.sql.ResultSet)22 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)22 GetSplitsRequest (com.amazonaws.athena.connector.lambda.metadata.GetSplitsRequest)17 GetSplitsResponse (com.amazonaws.athena.connector.lambda.metadata.GetSplitsResponse)17 PreparedStatement (java.sql.PreparedStatement)17 HashMap (java.util.HashMap)16 HashSet (java.util.HashSet)16 ArrayList (java.util.ArrayList)15 BlockWriter (com.amazonaws.athena.connector.lambda.data.BlockWriter)14 Map (java.util.Map)14 SchemaBuilder (com.amazonaws.athena.connector.lambda.data.SchemaBuilder)12 ValueSet (com.amazonaws.athena.connector.lambda.domain.predicate.ValueSet)11