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

Function ComputeDataPreallocate

cpp/src/arrow/compute/exec.cc:286–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284};
285
286void ComputeDataPreallocate(const DataType& type,
287 std::vector<BufferPreallocation>* widths) {
288 if (is_fixed_width(type.id()) && type.id() != Type::NA) {
289 widths->emplace_back(checked_cast<const FixedWidthType&>(type).bit_width());
290 return;
291 }
292 // Preallocate binary and list offsets
293 switch (type.id()) {
294 case Type::BINARY:
295 case Type::STRING:
296 case Type::LIST:
297 case Type::MAP:
298 widths->emplace_back(32, /*added_length=*/1);
299 return;
300 case Type::LARGE_BINARY:
301 case Type::LARGE_STRING:
302 case Type::LARGE_LIST:
303 widths->emplace_back(64, /*added_length=*/1);
304 return;
305 default:
306 break;
307 }
308}
309
310} // namespace
311

Callers 2

SetupPreallocationMethod · 0.85
ExecuteMethod · 0.85

Calls 4

is_fixed_widthFunction · 0.85
emplace_backMethod · 0.80
idMethod · 0.45
bit_widthMethod · 0.45

Tested by

no test coverage detected