Exemple #1
0
TEST_F(MergeTableOpTests, simple) {
  LoadFile t1("tables/employees.tbl");
  auto load_main = t1.execute()->getResultTable();

  LoadFile t2("tables/employees_new_row.tbl");
  auto load_delta = t2.execute()->getResultTable();

  MergeTable mop;
  mop.addInput(load_main);
  mop.addInput(load_delta);
  auto result = mop.execute()->getResultTable();

  ASSERT_TABLE_EQUAL(Loader::shortcuts::load("test/tables/employees_revised.tbl"), result);
}
TEST_F(MergeTableTests, basic_merge_table_test) {
  auto s = io::Loader::shortcuts::loadMainDelta("test/merge1_main.tbl", "test/merge1_delta.tbl");
  auto reference = io::Loader::shortcuts::load("test/merge1_result.tbl");

  ASSERT_EQ(4u, s->getMainTable()->size());
  ASSERT_EQ(5u, s->getDeltaTable()->size());

  MergeTable mt;
  mt.addInput(s);
  mt.execute();

  const auto& result = mt.getResultTable();

  ASSERT_EQ(9u, result->size());
  ASSERT_TABLE_EQUAL(result, reference);
}