Search in sources :

Example 1 with ColumnListsCache

use of org.apache.drill.exec.store.hive.ColumnListsCache in project drill by axbaretto.

the class TestColumnListCache method testTableColumnsIndex.

@Test
public void testTableColumnsIndex() {
    ColumnListsCache cache = new ColumnListsCache();
    List<FieldSchema> columns = Lists.newArrayList();
    columns.add(new FieldSchema("f1", "int", null));
    columns.add(new FieldSchema("f2", "int", null));
    assertEquals(0, cache.addOrGet(columns));
}
Also used : FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) ColumnListsCache(org.apache.drill.exec.store.hive.ColumnListsCache) SlowTest(org.apache.drill.categories.SlowTest) Test(org.junit.Test)

Example 2 with ColumnListsCache

use of org.apache.drill.exec.store.hive.ColumnListsCache in project drill by axbaretto.

the class TestColumnListCache method testColumnListUnique.

@Test
public void testColumnListUnique() {
    ColumnListsCache cache = new ColumnListsCache();
    List<FieldSchema> columns = Lists.newArrayList();
    columns.add(new FieldSchema("f1", "int", null));
    columns.add(new FieldSchema("f2", "int", null));
    cache.addOrGet(columns);
    cache.addOrGet(Lists.newArrayList(columns));
    assertEquals(0, cache.addOrGet(Lists.newArrayList(columns)));
}
Also used : FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) ColumnListsCache(org.apache.drill.exec.store.hive.ColumnListsCache) SlowTest(org.apache.drill.categories.SlowTest) Test(org.junit.Test)

Example 3 with ColumnListsCache

use of org.apache.drill.exec.store.hive.ColumnListsCache in project drill by axbaretto.

the class TestColumnListCache method testPartitionColumnListAccess.

@Test
public void testPartitionColumnListAccess() {
    ColumnListsCache cache = new ColumnListsCache();
    List<FieldSchema> columns = Lists.newArrayList();
    columns.add(new FieldSchema("f1", "int", null));
    columns.add(new FieldSchema("f2", "int", null));
    cache.addOrGet(columns);
    cache.addOrGet(columns);
    columns.add(new FieldSchema("f3", "int", null));
    cache.addOrGet(columns);
    cache.addOrGet(columns);
    columns.add(new FieldSchema("f4", "int", null));
    cache.addOrGet(columns);
    cache.addOrGet(columns);
    assertEquals(columns, cache.getColumns(2));
}
Also used : FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) ColumnListsCache(org.apache.drill.exec.store.hive.ColumnListsCache) SlowTest(org.apache.drill.categories.SlowTest) Test(org.junit.Test)

Example 4 with ColumnListsCache

use of org.apache.drill.exec.store.hive.ColumnListsCache in project drill by apache.

the class TestColumnListCache method testColumnListUnique.

@Test
public void testColumnListUnique() {
    ColumnListsCache cache = new ColumnListsCache();
    List<FieldSchema> columns = Lists.newArrayList();
    columns.add(new FieldSchema("f1", "int", null));
    columns.add(new FieldSchema("f2", "int", null));
    cache.addOrGet(columns);
    cache.addOrGet(Lists.newArrayList(columns));
    assertEquals(0, cache.addOrGet(Lists.newArrayList(columns)));
}
Also used : FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) ColumnListsCache(org.apache.drill.exec.store.hive.ColumnListsCache) BaseTest(org.apache.drill.test.BaseTest) SlowTest(org.apache.drill.categories.SlowTest) Test(org.junit.Test)

Example 5 with ColumnListsCache

use of org.apache.drill.exec.store.hive.ColumnListsCache in project drill by apache.

the class TestColumnListCache method testTableColumnsIndex.

@Test
public void testTableColumnsIndex() {
    ColumnListsCache cache = new ColumnListsCache();
    List<FieldSchema> columns = Lists.newArrayList();
    columns.add(new FieldSchema("f1", "int", null));
    columns.add(new FieldSchema("f2", "int", null));
    assertEquals(0, cache.addOrGet(columns));
}
Also used : FieldSchema(org.apache.hadoop.hive.metastore.api.FieldSchema) ColumnListsCache(org.apache.drill.exec.store.hive.ColumnListsCache) BaseTest(org.apache.drill.test.BaseTest) SlowTest(org.apache.drill.categories.SlowTest) Test(org.junit.Test)

Aggregations

ColumnListsCache (org.apache.drill.exec.store.hive.ColumnListsCache)11 SlowTest (org.apache.drill.categories.SlowTest)10 FieldSchema (org.apache.hadoop.hive.metastore.api.FieldSchema)10 Test (org.junit.Test)10 BaseTest (org.apache.drill.test.BaseTest)5 HiveReadEntry (org.apache.drill.exec.store.hive.HiveReadEntry)1 HiveTableWithColumnCache (org.apache.drill.exec.store.hive.HiveTableWithColumnCache)1 HiveTableWrapper (org.apache.drill.exec.store.hive.HiveTableWrapper)1 Partition (org.apache.hadoop.hive.metastore.api.Partition)1 Table (org.apache.hadoop.hive.metastore.api.Table)1