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

Function AssertTablesEqual

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

Source from the content-addressed store, hash-verified

508}
509
510void 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
541template <typename CompareFunctor>
542void 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