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

Function RecordBatchFromJSON

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

Source from the content-addressed store, hash-verified

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

Calls 3

struct_Function · 0.85
ArrayFromJSONFunction · 0.85
fieldsMethod · 0.45

Tested by

no test coverage detected