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

Function garrow_csv_writer_new

c_glib/arrow-glib/writer.cpp:629–652  ·  view source on GitHub ↗

* garrow_csv_writer_new: * @sink: The output of the writer. * @schema: The schema of the writer. * @options: (nullable): Options for serialization. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): A newly created #GArrowCSVWriter * or %NULL on error. * * Since: 23.0.0 */

Source from the content-addressed store, hash-verified

627 * Since: 23.0.0
628 */
629GArrowCSVWriter *
630garrow_csv_writer_new(GArrowOutputStream *sink,
631 GArrowSchema *schema,
632 GArrowCSVWriteOptions *options,
633 GError **error)
634{
635 auto arrow_sink = garrow_output_stream_get_raw(sink);
636 auto arrow_schema = garrow_schema_get_raw(schema);
637 arrow::csv::WriteOptions arrow_write_options;
638 if (options) {
639 auto arrow_write_options_ptr = garrow_csv_write_options_get_raw(options);
640 arrow_write_options = *arrow_write_options_ptr;
641 } else {
642 arrow_write_options = arrow::csv::WriteOptions::Defaults();
643 }
644 auto arrow_writer_result =
645 arrow::csv::MakeCSVWriter(arrow_sink, arrow_schema, arrow_write_options);
646 if (garrow::check(error, arrow_writer_result, "[csv-writer][new]")) {
647 auto arrow_writer = *arrow_writer_result;
648 return garrow_csv_writer_new_raw(&arrow_writer);
649 } else {
650 return nullptr;
651 }
652}
653
654G_END_DECLS
655

Callers

nothing calls this directly

Calls 6

garrow_schema_get_rawFunction · 0.85
checkFunction · 0.70
DefaultsFunction · 0.50

Tested by

no test coverage detected