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

Method FileWriterImpl

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

Source from the content-addressed store, hash-verified

308class FileWriterImpl : public FileWriter {
309 public:
310 FileWriterImpl(std::shared_ptr<::arrow::Schema> schema, MemoryPool* pool,
311 std::unique_ptr<ParquetFileWriter> writer,
312 std::shared_ptr<ArrowWriterProperties> arrow_properties)
313 : schema_(std::move(schema)),
314 writer_(std::move(writer)),
315 row_group_writer_(nullptr),
316 column_write_context_(pool, arrow_properties.get()),
317 arrow_properties_(std::move(arrow_properties)),
318 closed_(false) {
319 if (arrow_properties_->use_threads()) {
320 parallel_column_write_contexts_.reserve(schema_->num_fields());
321 for (int i = 0; i < schema_->num_fields(); ++i) {
322 // Explicitly create each ArrowWriteContext object to avoid unintentional
323 // call of the copy constructor. Otherwise, the buffers in the type of
324 // shared_ptr will be shared among all contexts.
325 parallel_column_write_contexts_.emplace_back(pool, arrow_properties_.get());
326 }
327 }
328 }
329
330 Status Init() {
331 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