use of org.apache.hadoop.hive.ql.parse.WarehouseInstance.Tuple in project hive by apache.
the class TestReplicationScenariosAcrossInstances method testIncrementalDumpEmptyDumpDirectory.
@Test
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable {
WarehouseInstance.Tuple tuple = primary.dump(primaryDbName);
replica.load(replicatedDbName, primaryDbName).status(replicatedDbName).verifyResult(tuple.lastReplicationId);
tuple = primary.dump(primaryDbName, Collections.emptyList());
replica.load(replicatedDbName, primaryDbName).status(replicatedDbName).verifyResult(tuple.lastReplicationId);
// create events for some other database and then dump the primaryDbName to dump an empty directory.
String testDbName = primaryDbName + "_test";
tuple = primary.run(" create database " + testDbName).run("create table " + testDbName + ".tbl (fld int)").dump(primaryDbName, Collections.emptyList());
// Incremental load to existing database with empty dump directory should set the repl id to the last event at src.
replica.load(replicatedDbName, primaryDbName).status(replicatedDbName).verifyResult(tuple.lastReplicationId);
// Bootstrap load from an empty dump directory should return empty load directory error.
tuple = primary.dump("someJunkDB", Collections.emptyList());
try {
replica.runCommand("REPL LOAD someJunkDB into someJunkDB");
assert false;
} catch (CommandProcessorException e) {
assertTrue(e.getMessage().toLowerCase().contains("semanticException no data to load in path".toLowerCase()));
}
primary.run(" drop database if exists " + testDbName + " cascade");
}
Aggregations