ResultSet res = tpch.execute(
"create table " + tableName + " as select l_orderkey from lineitem");
assertFalse(res.next());
res.close();
TajoTestingCluster cluster = tpch.getTestingCluster();
CatalogService catalog = cluster.getMaster().getCatalog();
assertTrue(catalog.existsTable(DEFAULT_DATABASE_NAME, tableName));
TableDesc orderKeys = catalog.getTableDesc(DEFAULT_DATABASE_NAME, tableName);
if (!cluster.isHCatalogStoreRunning()) {
assertEquals(5, orderKeys.getStats().getNumRows().intValue());
}
// this query will result in the two rows.
res = tpch.execute(
"insert overwrite into " + tableName + " select l_orderkey from lineitem where l_orderkey = 3");
assertFalse(res.next());
res.close();
assertTrue(catalog.existsTable(DEFAULT_DATABASE_NAME, tableName));
orderKeys = catalog.getTableDesc(DEFAULT_DATABASE_NAME, tableName);
if (!cluster.isHCatalogStoreRunning()) {
assertEquals(2, orderKeys.getStats().getNumRows().intValue());
}
}