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));
}
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)));
}
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));
}
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)));
}
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));
}
Aggregations