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

Function garrow_csv_reader_new

c_glib/arrow-glib/reader.cpp:1848–1878  ·  view source on GitHub ↗

* garrow_csv_reader_new: * @input: The input to be read. * @options: (nullable): A #GArrowCSVReadOptions. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): A newly created #GArrowCSVReader or %NULL on error. * * Since: 0.12.0 */

Source from the content-addressed store, hash-verified

1846 * Since: 0.12.0
1847 */
1848GArrowCSVReader *
1849garrow_csv_reader_new(GArrowInputStream *input,
1850 GArrowCSVReadOptions *options,
1851 GError **error)
1852{
1853 auto arrow_input = garrow_input_stream_get_raw(input);
1854 arrow::csv::ReadOptions read_options;
1855 arrow::csv::ParseOptions parse_options;
1856 arrow::csv::ConvertOptions convert_options;
1857 if (options) {
1858 auto options_priv = GARROW_CSV_READ_OPTIONS_GET_PRIVATE(options);
1859 read_options = options_priv->read_options;
1860 parse_options = options_priv->parse_options;
1861 convert_options = options_priv->convert_options;
1862 } else {
1863 read_options = arrow::csv::ReadOptions::Defaults();
1864 parse_options = arrow::csv::ParseOptions::Defaults();
1865 convert_options = arrow::csv::ConvertOptions::Defaults();
1866 }
1867
1868 auto arrow_reader = arrow::csv::TableReader::Make(arrow::io::default_io_context(),
1869 arrow_input,
1870 read_options,
1871 parse_options,
1872 convert_options);
1873 if (garrow::check(error, arrow_reader, "[csv-reader][new]")) {
1874 return garrow_csv_reader_new_raw(&(*arrow_reader), input);
1875 } else {
1876 return NULL;
1877 }
1878}
1879
1880/**
1881 * garrow_csv_reader_read:

Callers

nothing calls this directly

Calls 5

checkFunction · 0.70
DefaultsFunction · 0.50
MakeFunction · 0.50

Tested by

no test coverage detected