Skip to content

Commit 4e37842

Browse files
committed
Add an alias to AssertTablesEqual called AssertTablesEqualUnordered to make it more obvious what the function is doing. Fix a substrait test that was relying on an order that isn't really deterministic.
1 parent 93be685 commit 4e37842

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

cpp/src/arrow/compute/exec/test_util.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@ void AssertTablesEqual(const std::shared_ptr<Table>& exp,
382382
}
383383
}
384384

385+
// TODO(weston) This is just an alias at the moment for AssertTablesEqual
386+
// I think we should rename AssertTablesEqual to this name as it's been a year and I never
387+
// realized this function existed because I always just assumed we were referencing
388+
// ::arrow::AssertTablesEqual. Not critical now. FIXME before merging to master
389+
void AssertTablesEqualUnordered(const std::shared_ptr<Table>& exp,
390+
const std::shared_ptr<Table>& act) {
391+
return AssertTablesEqual(exp, act);
392+
}
393+
385394
void AssertExecBatchesEqual(const std::shared_ptr<Schema>& schema,
386395
const std::vector<ExecBatch>& exp,
387396
const std::vector<ExecBatch>& act) {

cpp/src/arrow/compute/exec/test_util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ ARROW_TESTING_EXPORT
130130
void AssertTablesEqual(const std::shared_ptr<Table>& exp,
131131
const std::shared_ptr<Table>& act);
132132

133+
ARROW_TESTING_EXPORT
134+
void AssertTablesEqualUnordered(const std::shared_ptr<Table>& exp,
135+
const std::shared_ptr<Table>& act);
136+
133137
ARROW_TESTING_EXPORT
134138
void AssertExecBatchesEqual(const std::shared_ptr<Schema>& schema,
135139
const std::vector<ExecBatch>& exp,

cpp/src/arrow/engine/substrait/serde_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "arrow/compute/exec/asof_join_node.h"
2424
#include "arrow/compute/exec/exec_plan.h"
2525
#include "arrow/compute/exec/expression_internal.h"
26+
#include "arrow/compute/exec/test_util.h"
2627
#include "arrow/dataset/file_base.h"
2728
#include "arrow/dataset/file_ipc.h"
2829
#include "arrow/dataset/file_parquet.h"
@@ -2252,7 +2253,7 @@ TEST(SubstraitRoundTrip, BasicPlanEndToEnd) {
22522253
}
22532254
ASSERT_OK_AND_ASSIGN(auto rnd_trp_table,
22542255
GetTableFromPlan(roundtripped_filter, exec_context, dummy_schema));
2255-
EXPECT_TRUE(expected_table->Equals(*rnd_trp_table));
2256+
compute::AssertTablesEqualUnordered(expected_table, rnd_trp_table);
22562257
}
22572258

22582259
NamedTableProvider ProvideMadeTable(

0 commit comments

Comments
 (0)