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

Function RecordBatchFromJSON

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

Source from the content-addressed store, hash-verified

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

Calls 3

struct_Function · 0.85
ArrayFromJSONFunction · 0.85
fieldsMethod · 0.45

Tested by

no test coverage detected