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

Method PrepareForContentsWrite

cpp/src/arrow/csv/writer.cc:581–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579
580 private:
581 Status PrepareForContentsWrite() {
582 // Only called once, as part of initialization
583 if (data_buffer_ == nullptr) {
584 ARROW_ASSIGN_OR_RAISE(
585 data_buffer_,
586 AllocateResizableBuffer(
587 options_.batch_size * schema_->num_fields() * kColumnSizeGuess,
588 options_.io_context.pool()));
589 }
590 return Status::OK();
591 }
592
593 // GH-36889: Flush buffer to sink and clear it to avoid stale content
594 // being written again if the next batch is empty.

Callers 1

MakeMethod · 0.80

Calls 5

AllocateResizableBufferFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
num_fieldsMethod · 0.45
poolMethod · 0.45

Tested by

no test coverage detected