| 120 | }; |
| 121 | |
| 122 | std::shared_ptr<Array> ExpectedRangesToArray( |
| 123 | const std::vector<ExpectedRange>& ranges, |
| 124 | const std::function<uint64_t(const ExpectedRange&)>& key_func) { |
| 125 | UInt64Builder builder; |
| 126 | for (const auto& range : ranges) { |
| 127 | ARROW_EXPECT_OK(builder.Append(key_func(range))); |
| 128 | } |
| 129 | std::shared_ptr<Array> arr; |
| 130 | ARROW_EXPECT_OK(builder.Finish(&arr)); |
| 131 | return arr; |
| 132 | } |
| 133 | |
| 134 | std::shared_ptr<Array> RangesToOffsets(const std::vector<ExpectedRange>& ranges) { |
| 135 | return ExpectedRangesToArray(ranges, |
no test coverage detected