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

Method SliceToChunkedArray

cpp/src/arrow/field_ref_test.cc:206–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205 private:
206 static std::shared_ptr<ChunkedArray> SliceToChunkedArray(const Array& array,
207 int num_chunks) {
208 ARROW_CHECK(num_chunks > 0 && array.length() >= num_chunks);
209 ArrayVector chunks;
210 chunks.reserve(num_chunks);
211 for (int64_t inc = array.length() / num_chunks, beg = 0,
212 end = inc + array.length() % num_chunks;
213 end <= array.length(); beg = end, end += inc) {
214 chunks.push_back(array.SliceSafe(beg, end - beg).ValueOrDie());
215 }
216 ARROW_CHECK_EQ(static_cast<int>(chunks.size()), num_chunks);
217 return ChunkedArray::Make(std::move(chunks)).ValueOrDie();
218 }
219};
220
221class FieldPathTestFixture : public ::testing::Test {

Callers

nothing calls this directly

Calls 7

push_backMethod · 0.80
ValueOrDieMethod · 0.80
MakeFunction · 0.70
lengthMethod · 0.45
reserveMethod · 0.45
SliceSafeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected