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