Exemplo n.º 1
0
TEST_F(SelectTests, simple_select_with_raw_table_fails_due_to_equals_predicate_implementation) {
  hyrise::storage::c_atable_ptr_t t = createRawTable();

  EqualsExpression<hyrise_int_t> *expr1 = new EqualsExpression<hyrise_int_t>(t, 0, 2009);
  auto scan = std::make_shared<SimpleRawTableScan>(expr1);
  scan->addInput(t);

  ASSERT_THROW(scan->execute(), std::runtime_error);
}
Exemplo n.º 2
0
TEST_F(SelectTests, simple_select_with_raw_table_greater_than_predicate) {
  auto t = createRawTable();

  auto expr1 = new GreaterThanExpressionRaw<hyrise_int_t>(t, 0, 98);
  auto scan = std::make_shared<SimpleRawTableScan>(expr1);
  scan->addInput(t);

  scan->execute();
  const auto& out = scan->getResultTable();
  const auto& reference = Loader::shortcuts::load("test/reference/simple_raw_select_integer_greater_than.tbl");
  ASSERT_TABLE_EQUAL(reference, out);
}
Exemplo n.º 3
0
TEST_F(SelectTests, simple_select_with_raw_table_equals_predicate) {
  hyrise::storage::c_atable_ptr_t t = createRawTable();

  auto expr1 = new EqualsExpressionRaw<hyrise_int_t>(t, 0, 75);
  auto scan = std::make_shared<SimpleRawTableScan>(expr1);
  scan->addInput(t);
  scan->execute();

  ASSERT_EQ(1u, scan->getResultTable(0)->size());
  const auto& out = scan->getResultTable();
  const auto& reference = Loader::shortcuts::load("test/reference/simple_raw_select_integer.tbl");
  ASSERT_TABLE_EQUAL(reference, out);
}
Exemplo n.º 4
0
TEST_F(SimpleRawTableScanTests, basic_simple_raw_table_scan_test) {
  auto t = createRawTable();
  auto expr = new EqualsExpressionRaw<storage::hyrise_int_t>(t, 0, 5);

  SimpleRawTableScan srts(expr);
  srts.addInput(t);
  srts.execute();

  const auto &result = srts.getResultTable();

  ASSERT_EQ(1u, result->size());
  ASSERT_EQ(5u, result->getValue<storage::hyrise_int_t>(0, 0));
}
Exemplo n.º 5
0
TEST_F(SelectTests, simple_select_with_raw_table_equals_predicate_string) {
  auto t = createRawTable();

  auto expr1 = new EqualsExpressionRaw<hyrise_string_t>(t, 1, "MeinNameIstSlimShady75");
  auto scan = std::make_shared<SimpleRawTableScan>(expr1);
  scan->addInput(t);

  scan->execute();

  ASSERT_EQ(1u, scan->getResultTable(0)->size());
  const auto& out = scan->getResultTable();
  const auto& reference = Loader::shortcuts::load("test/reference/simple_raw_select_integer.tbl");
  ASSERT_TABLE_EQUAL(reference, out);
}