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

Function garrow_json_reader_new

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

* garrow_json_reader_new: * @input: The input to be read. * @options: (nullable): A #GArrowJSONReadOptions. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): A newly created #GArrowJSONReader or %NULL on error. * * Since: 0.14.0 */

Source from the content-addressed store, hash-verified

2254 * Since: 0.14.0
2255 */
2256GArrowJSONReader *
2257garrow_json_reader_new(GArrowInputStream *input,
2258 GArrowJSONReadOptions *options,
2259 GError **error)
2260{
2261 auto arrow_input = garrow_input_stream_get_raw(input);
2262 arrow::Status status;
2263
2264 arrow::Result<std::shared_ptr<arrow::json::TableReader>> arrow_reader;
2265 if (options) {
2266 auto options_priv = GARROW_JSON_READ_OPTIONS_GET_PRIVATE(options);
2267 arrow_reader = arrow::json::TableReader::Make(arrow::default_memory_pool(),
2268 arrow_input,
2269 options_priv->read_options,
2270 options_priv->parse_options);
2271 } else {
2272 arrow_reader = arrow::json::TableReader::Make(arrow::default_memory_pool(),
2273 arrow_input,
2274 arrow::json::ReadOptions::Defaults(),
2275 arrow::json::ParseOptions::Defaults());
2276 }
2277
2278 if (garrow::check(error, arrow_reader, "[json-reader][new]")) {
2279 return garrow_json_reader_new_raw(&*arrow_reader, input);
2280 } else {
2281 return NULL;
2282 }
2283}
2284
2285/**
2286 * garrow_json_reader_read:

Callers

nothing calls this directly

Calls 6

default_memory_poolFunction · 0.85
checkFunction · 0.70
MakeFunction · 0.50
DefaultsFunction · 0.50

Tested by

no test coverage detected