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

Function RecordBatchFromJSON

cpp/src/arrow/testing/gtest_util.cc:409–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409std::shared_ptr<RecordBatch> RecordBatchFromJSON(const std::shared_ptr<Schema>& schema,
410 std::string_view json) {
411 // Parse as a StructArray
412 auto struct_type = struct_(schema->fields());
413 std::shared_ptr<Array> struct_array = arrow::ArrayFromJSON(struct_type, json);
414
415 // Convert StructArray to RecordBatch
416 return *RecordBatch::FromStructArray(struct_array);
417}
418
419std::shared_ptr<Scalar> ScalarFromJSON(const std::shared_ptr<DataType>& type,
420 std::string_view json) {

Calls 3

struct_Function · 0.85
ArrayFromJSONFunction · 0.85
fieldsMethod · 0.45

Tested by

no test coverage detected