| 540 | |
| 541 | template <typename CompareFunctor> |
| 542 | void CompareBatchWith(const RecordBatch& left, const RecordBatch& right, |
| 543 | bool compare_metadata, CompareFunctor&& compare) { |
| 544 | if (!left.schema()->Equals(*right.schema(), compare_metadata)) { |
| 545 | FAIL() << "Left schema: " << left.schema()->ToString(compare_metadata) |
| 546 | << "\nRight schema: " << right.schema()->ToString(compare_metadata); |
| 547 | } |
| 548 | ASSERT_EQ(left.num_columns(), right.num_columns()) |
| 549 | << left.schema()->ToString() << " result: " << right.schema()->ToString(); |
| 550 | ASSERT_EQ(left.num_rows(), right.num_rows()); |
| 551 | for (int i = 0; i < left.num_columns(); ++i) { |
| 552 | if (!compare(*left.column(i), *right.column(i))) { |
| 553 | std::stringstream ss; |
| 554 | ss << "Idx: " << i << " Name: " << left.column_name(i); |
| 555 | ss << std::endl << "Left: "; |
| 556 | ASSERT_OK(PrettyPrint(*left.column(i), 0, &ss)); |
| 557 | ss << std::endl << "Right: "; |
| 558 | ASSERT_OK(PrettyPrint(*right.column(i), 0, &ss)); |
| 559 | FAIL() << ss.str(); |
| 560 | } |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | void CompareBatch(const RecordBatch& left, const RecordBatch& right, |
| 565 | bool compare_metadata, const EqualOptions& options) { |
no test coverage detected