| 407 | } |
| 408 | |
| 409 | std::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 | |
| 419 | std::shared_ptr<Scalar> ScalarFromJSON(const std::shared_ptr<DataType>& type, |
| 420 | std::string_view json) { |
no test coverage detected