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

Function VeryLargeBatch

cpp/src/arrow/flight/test_util.cc:247–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247arrow::Result<std::shared_ptr<RecordBatch>> VeryLargeBatch() {
248 // In CI, some platforms don't let us allocate one very large
249 // buffer, so allocate a smaller buffer and repeat it a few times
250 constexpr int64_t nbytes = (1ul << 27ul) + 8ul;
251 constexpr int64_t nrows = nbytes / 8;
252 constexpr int64_t ncols = 16;
253 ARROW_ASSIGN_OR_RAISE(auto values, AllocateBuffer(nbytes));
254 std::memset(values->mutable_data(), 0x00, values->capacity());
255 std::vector<std::shared_ptr<Buffer>> buffers = {nullptr, std::move(values)};
256 auto array = std::make_shared<ArrayData>(int64(), nrows, buffers,
257 /*null_count=*/0);
258 std::vector<std::shared_ptr<ArrayData>> arrays(ncols, array);
259 std::vector<std::shared_ptr<Field>> fields(ncols, field("a", int64()));
260 return RecordBatch::Make(schema(std::move(fields)), nrows, std::move(arrays));
261}
262
263std::vector<ActionType> ExampleActionTypes() {
264 return {{"drop", "drop a dataset"}, {"cache", "cache a dataset"}};

Callers

nothing calls this directly

Calls 5

fieldFunction · 0.50
MakeFunction · 0.50
schemaFunction · 0.50
mutable_dataMethod · 0.45
capacityMethod · 0.45

Tested by

no test coverage detected