Search in sources :

Example 1 with AccumuloTableProperties

use of com.facebook.presto.accumulo.conf.AccumuloTableProperties in project presto by prestodb.

the class TestAccumuloClient method testCreateTableEmptyAccumuloColumn.

@Test
public void testCreateTableEmptyAccumuloColumn() {
    SchemaTableName tableName = new SchemaTableName("default", "test_create_table_empty_accumulo_column");
    try {
        List<ColumnMetadata> columns = ImmutableList.of(new ColumnMetadata("id", BIGINT), new ColumnMetadata("a", BIGINT), new ColumnMetadata("b", BIGINT), new ColumnMetadata("c", BIGINT), new ColumnMetadata("d", BIGINT));
        Map<String, Object> properties = new HashMap<>();
        new AccumuloTableProperties().getTableProperties().forEach(meta -> properties.put(meta.getName(), meta.getDefaultValue()));
        properties.put("external", true);
        properties.put("column_mapping", "a:a:a,b::b,c:c:,d::");
        client.createTable(new ConnectorTableMetadata(tableName, columns, properties));
        assertNotNull(client.getTable(tableName));
    } finally {
        AccumuloTable table = zooKeeperMetadataManager.getTable(tableName);
        if (table != null) {
            client.dropTable(table);
        }
    }
}
Also used : AccumuloTable(com.facebook.presto.accumulo.metadata.AccumuloTable) ColumnMetadata(com.facebook.presto.spi.ColumnMetadata) HashMap(java.util.HashMap) AccumuloTableProperties(com.facebook.presto.accumulo.conf.AccumuloTableProperties) SchemaTableName(com.facebook.presto.spi.SchemaTableName) ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata) Test(org.testng.annotations.Test)

Aggregations

AccumuloTableProperties (com.facebook.presto.accumulo.conf.AccumuloTableProperties)1 AccumuloTable (com.facebook.presto.accumulo.metadata.AccumuloTable)1 ColumnMetadata (com.facebook.presto.spi.ColumnMetadata)1 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)1 SchemaTableName (com.facebook.presto.spi.SchemaTableName)1 HashMap (java.util.HashMap)1 Test (org.testng.annotations.Test)1