MCPcopy Create free account
hub / github.com/apache/arrow / AssertTablesEqual

Function AssertTablesEqual

cpp/src/arrow/testing/gtest_util.cc:506–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506void 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
537template <typename CompareFunctor>
538void CompareBatchWith(const RecordBatch& left, const RecordBatch& right,

Callers 15

TEST_FFunction · 0.85
TESTFunction · 0.85
CheckDatasetResultsMethod · 0.85
AssertExecBatchesEqualFunction · 0.85
TEST_PFunction · 0.85
TESTFunction · 0.85
TEST_FFunction · 0.85
AssertScanEqualsMethod · 0.85
CheckValidTestCasesFunction · 0.85
CheckWholeAggregateCaseFunction · 0.85

Calls 4

default_memory_poolFunction · 0.85
AssertChunkedEqualFunction · 0.85
num_columnsMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected