| 504 | } |
| 505 | |
| 506 | void AssertTablesEqual(const Table& expected, const Table& actual, bool same_chunk_layout, |
| 507 | bool combine_chunks, const EqualOptions& options) { |
| 508 | ASSERT_EQ(expected.num_columns(), actual.num_columns()); |
| 509 | |
| 510 | if (combine_chunks) { |
| 511 | auto pool = default_memory_pool(); |
| 512 | ASSERT_OK_AND_ASSIGN(auto new_expected, expected.CombineChunks(pool)); |
| 513 | ASSERT_OK_AND_ASSIGN(auto new_actual, actual.CombineChunks(pool)); |
| 514 | |
| 515 | AssertTablesEqual(*new_expected, *new_actual, false, false, options); |
| 516 | return; |
| 517 | } |
| 518 | |
| 519 | if (same_chunk_layout) { |
| 520 | for (int i = 0; i < actual.num_columns(); ++i) { |
| 521 | AssertChunkedEqual(*expected.column(i), *actual.column(i), options); |
| 522 | } |
| 523 | } else { |
| 524 | std::stringstream ss; |
| 525 | for (int i = 0; i < actual.num_columns(); ++i) { |
| 526 | auto actual_col = actual.column(i); |
| 527 | auto expected_col = expected.column(i); |
| 528 | |
| 529 | ASSERT_OK_AND_ASSIGN(auto diff, PrintArrayDiff(*expected_col, *actual_col)); |
| 530 | if (diff.has_value()) { |
| 531 | FAIL() << *diff; |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | template <typename CompareFunctor> |
| 538 | void CompareBatchWith(const RecordBatch& left, const RecordBatch& right, |
no test coverage detected