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

Method MakeWriter

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

Source from the content-addressed store, hash-verified

493}
494
495Result<std::shared_ptr<FileWriter>> CsvFileFormat::MakeWriter(
496 std::shared_ptr<io::OutputStream> destination, std::shared_ptr<Schema> schema,
497 std::shared_ptr<FileWriteOptions> options,
498 fs::FileLocator destination_locator) const {
499 if (!Equals(*options->format())) {
500 return Status::TypeError("Mismatching format/write options.");
501 }
502 auto csv_options = checked_pointer_cast<CsvFileWriteOptions>(options);
503 ARROW_ASSIGN_OR_RAISE(
504 auto writer, csv::MakeCSVWriter(destination, schema, *csv_options->write_options));
505 return std::shared_ptr<FileWriter>(
506 new CsvFileWriter(std::move(destination), std::move(writer), std::move(schema),
507 std::move(csv_options), std::move(destination_locator)));
508}
509
510CsvFileWriter::CsvFileWriter(std::shared_ptr<io::OutputStream> destination,
511 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