use of alluxio.grpc.table.Schema in project alluxio by Alluxio.
the class AlluxioCatalogTest method testGetColumnStats.
@Test
public void testGetColumnStats() throws Exception {
Schema s = schemaFromColNames("c1", "c2", "c3");
// setup
// Why does this API seem so counter intuitive?
UdbTable tbl = createMockUdbTable("test", s);
Database db = createMockDatabase("noop", "test", Collections.emptyList());
addTableToDb(db, Table.create(db, tbl, null));
addDbToCatalog(db);
// basic, filter on each col
assertEquals(1, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList("c1")).size());
assertEquals(1, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList("c2")).size());
assertEquals(1, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList("c3")).size());
// try two
assertEquals(2, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList("c1", "c2")).size());
// flip order
assertEquals(2, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList("c2", "c1")).size());
// non existing
assertEquals(0, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList("doesnotexist")).size());
// empty
assertEquals(0, mCatalog.getTableColumnStatistics("test", "test", Lists.newArrayList()).size());
}
use of alluxio.grpc.table.Schema in project alluxio by Alluxio.
the class AlluxioCatalogTest method testGetPartitionUnpartitonedUdbTable.
@Test
public void testGetPartitionUnpartitonedUdbTable() throws Exception {
Schema s = schemaFromColNames("c1", "c2", "c3");
// setup
UdbTable tbl = createMockUdbTable("test", s);
Database db = createMockDatabase("noop", "test", Collections.emptyList());
addTableToDb(db, Table.create(db, tbl, null));
addDbToCatalog(db);
assertEquals(1, mCatalog.getTable("test", "test").getPartitions().size());
}
use of alluxio.grpc.table.Schema in project alluxio by Alluxio.
the class AlluxioCatalogTest method testGetPartitionPartitonedUdbTable.
@Test
public void testGetPartitionPartitonedUdbTable() throws Exception {
Schema s = schemaFromColNames("c1", "c2", "c3");
// setup
UdbTable tbl = createMockPartitionedUdbTable("test", s);
Database db = createMockDatabase("noop", "test", Collections.emptyList());
addTableToDb(db, Table.create(db, tbl, null));
addDbToCatalog(db);
assertEquals(2, mCatalog.getTable("test", "test").getPartitions().size());
}
Aggregations