| 91 | } |
| 92 | |
| 93 | void AssertPartition(const std::shared_ptr<Partitioning> partitioning, |
| 94 | const std::shared_ptr<RecordBatch> full_batch, |
| 95 | const RecordBatchVector& expected_batches, |
| 96 | const std::vector<compute::Expression>& expected_expressions) { |
| 97 | ASSERT_OK_AND_ASSIGN(auto partition_results, partitioning->Partition(full_batch)); |
| 98 | std::shared_ptr<RecordBatch> rest = full_batch; |
| 99 | |
| 100 | ASSERT_EQ(partition_results.batches.size(), expected_batches.size()); |
| 101 | |
| 102 | for (size_t i = 0; i < partition_results.batches.size(); i++) { |
| 103 | std::shared_ptr<RecordBatch> actual_batch = partition_results.batches[i]; |
| 104 | compute::Expression actual_expression = partition_results.expressions[i]; |
| 105 | |
| 106 | auto expected_expression = std::find(expected_expressions.begin(), |
| 107 | expected_expressions.end(), actual_expression); |
| 108 | ASSERT_NE(expected_expression, expected_expressions.end()) |
| 109 | << "Unexpected partition expr " << actual_expression.ToString(); |
| 110 | |
| 111 | auto expected_batch = |
| 112 | expected_batches[expected_expression - expected_expressions.begin()]; |
| 113 | |
| 114 | SCOPED_TRACE("Batch for " + expected_expression->ToString()); |
| 115 | AssertBatchesEqual(*expected_batch, *actual_batch); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void AssertPartition(const std::shared_ptr<Partitioning> partitioning, |
| 120 | const std::shared_ptr<Schema> schema, |
nothing calls this directly
no test coverage detected