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

Method FileWriterImpl

cpp/src/parquet/arrow/writer.cc:322–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320class FileWriterImpl : public FileWriter {
321 public:
322 FileWriterImpl(std::shared_ptr<::arrow::Schema> schema, MemoryPool* pool,
323 std::unique_ptr<ParquetFileWriter> writer,
324 std::shared_ptr<ArrowWriterProperties> arrow_properties)
325 : schema_(std::move(schema)),
326 writer_(std::move(writer)),
327 row_group_writer_(nullptr),
328 column_write_context_(pool, arrow_properties.get()),
329 arrow_properties_(std::move(arrow_properties)),
330 closed_(false) {
331 if (arrow_properties_->use_threads()) {
332 parallel_column_write_contexts_.reserve(schema_->num_fields());
333 for (int i = 0; i < schema_->num_fields(); ++i) {
334 // Explicitly create each ArrowWriteContext object to avoid unintentional
335 // call of the copy constructor. Otherwise, the buffers in the type of
336 // shared_ptr will be shared among all contexts.
337 parallel_column_write_contexts_.emplace_back(pool, arrow_properties_.get());
338 }
339 }
340 }
341
342 Status Init() {
343 return SchemaManifest::Make(writer_->schema(), /*schema_metadata=*/nullptr,

Callers

nothing calls this directly

Calls 5

emplace_backMethod · 0.80
getMethod · 0.45
use_threadsMethod · 0.45
reserveMethod · 0.45
num_fieldsMethod · 0.45

Tested by

no test coverage detected