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

Method MakeWriter

cpp/src/arrow/dataset/file_csv.cc:480–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480Result<std::shared_ptr<FileWriter>> CsvFileFormat::MakeWriter(
481 std::shared_ptr<io::OutputStream> destination, std::shared_ptr<Schema> schema,
482 std::shared_ptr<FileWriteOptions> options,
483 fs::FileLocator destination_locator) const {
484 if (!Equals(*options->format())) {
485 return Status::TypeError("Mismatching format/write options.");
486 }
487 auto csv_options = checked_pointer_cast<CsvFileWriteOptions>(options);
488 ARROW_ASSIGN_OR_RAISE(
489 auto writer, csv::MakeCSVWriter(destination, schema, *csv_options->write_options));
490 return std::shared_ptr<FileWriter>(
491 new CsvFileWriter(std::move(destination), std::move(writer), std::move(schema),
492 std::move(csv_options), std::move(destination_locator)));
493}
494
495CsvFileWriter::CsvFileWriter(std::shared_ptr<io::OutputStream> destination,
496 std::shared_ptr<ipc::RecordBatchWriter> writer,

Callers

nothing calls this directly

Calls 3

EqualsFunction · 0.70
TypeErrorFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected