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

Method PutSpaced

cpp/src/parquet/encoder.cc:1467–1484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1465 void Put(const T* buffer, int num_values) override;
1466
1467 void PutSpaced(const T* src, int num_values, const uint8_t* valid_bits,
1468 int64_t valid_bits_offset) override {
1469 if (valid_bits != nullptr) {
1470 if (buffer_ == nullptr) {
1471 PARQUET_ASSIGN_OR_THROW(buffer_,
1472 ::arrow::AllocateResizableBuffer(num_values * sizeof(T),
1473 this->memory_pool()));
1474 } else {
1475 PARQUET_THROW_NOT_OK(buffer_->Resize(num_values * sizeof(T), false));
1476 }
1477 T* data = buffer_->mutable_data_as<T>();
1478 int num_valid_values = ::arrow::util::internal::SpacedCompress<T>(
1479 src, num_values, valid_bits, valid_bits_offset, data);
1480 Put(data, num_valid_values);
1481 } else {
1482 Put(src, num_values);
1483 }
1484 }
1485
1486 protected:
1487 template <typename VisitorType>

Callers

nothing calls this directly

Calls 3

AllocateResizableBufferFunction · 0.85
memory_poolMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected