Search in sources :

Example 16 with LogicalPlanPersistence

use of org.apache.drill.common.config.LogicalPlanPersistence in project drill by apache.

the class TestHBaseTableProvider method testTableProvider.

@Test
public void testTableProvider() throws StoreException {
    LogicalPlanPersistence lp = PhysicalPlanReaderTestFactory.defaultLogicalPlanPersistence(config);
    PersistentStore<String> hbaseStore = provider.getOrCreateStore(PersistentStoreConfig.newJacksonBuilder(lp.getMapper(), String.class).name("hbase").build());
    hbaseStore.put("", "v0");
    hbaseStore.put("k1", "v1");
    hbaseStore.put("k2", "v2");
    hbaseStore.put("k3", "v3");
    hbaseStore.put("k4", "v4");
    hbaseStore.put("k5", "v5");
    hbaseStore.put(".test", "testValue");
    assertEquals("v0", hbaseStore.get(""));
    assertEquals("testValue", hbaseStore.get(".test"));
    assertTrue(hbaseStore.contains(""));
    assertFalse(hbaseStore.contains("unknown_key"));
    assertEquals(7, Lists.newArrayList(hbaseStore.getAll()).size());
    PersistentStore<String> hbaseTestStore = provider.getOrCreateStore(PersistentStoreConfig.newJacksonBuilder(lp.getMapper(), String.class).name("hbase.test").build());
    hbaseTestStore.put("", "v0");
    hbaseTestStore.put("k1", "v1");
    hbaseTestStore.put("k2", "v2");
    hbaseTestStore.put("k3", "v3");
    hbaseTestStore.put("k4", "v4");
    hbaseTestStore.put(".test", "testValue");
    assertEquals("v0", hbaseStore.get(""));
    assertEquals("testValue", hbaseStore.get(".test"));
    assertEquals(6, Lists.newArrayList(hbaseTestStore.getAll()).size());
}
Also used : LogicalPlanPersistence(org.apache.drill.common.config.LogicalPlanPersistence) HbaseStorageTest(org.apache.drill.categories.HbaseStorageTest) Test(org.junit.Test) SlowTest(org.apache.drill.categories.SlowTest)

Aggregations

LogicalPlanPersistence (org.apache.drill.common.config.LogicalPlanPersistence)16 DrillConfig (org.apache.drill.common.config.DrillConfig)10 ScanResult (org.apache.drill.common.scanner.persistence.ScanResult)8 Test (org.junit.Test)8 LogicalPlan (org.apache.drill.common.logical.LogicalPlan)4 ExecTest (org.apache.drill.exec.ExecTest)4 PhysicalPlan (org.apache.drill.exec.physical.PhysicalPlan)4 SystemOptionManager (org.apache.drill.exec.server.options.SystemOptionManager)4 LocalPersistentStoreProvider (org.apache.drill.exec.store.sys.store.provider.LocalPersistentStoreProvider)4 MetricRegistry (com.codahale.metrics.MetricRegistry)2 ObjectReader (com.fasterxml.jackson.databind.ObjectReader)2 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 SchemaPlus (org.apache.calcite.schema.SchemaPlus)2 HbaseStorageTest (org.apache.drill.categories.HbaseStorageTest)2 PlannerTest (org.apache.drill.categories.PlannerTest)2 SlowTest (org.apache.drill.categories.SlowTest)2 FunctionImplementationRegistry (org.apache.drill.exec.expr.fn.FunctionImplementationRegistry)2 QueryContext (org.apache.drill.exec.ops.QueryContext)2