| 118 | using FormatType = JsonFileFormat; |
| 119 | |
| 120 | static Result<std::shared_ptr<Buffer>> Write(RecordBatchReader* reader) { |
| 121 | ARROW_ASSIGN_OR_RAISE(auto scalars, ToScalars(reader)); |
| 122 | std::stringstream ss; |
| 123 | |
| 124 | for (const auto& scalar : scalars) { |
| 125 | ::arrow::internal::JsonWriter writer; |
| 126 | RETURN_NOT_OK(WriteJson(*scalar, &writer)); |
| 127 | |
| 128 | ARROW_ASSIGN_OR_RAISE(auto json, writer.GetString()); |
| 129 | ss << json << "\n"; |
| 130 | } |
| 131 | return Buffer::FromString(ss.str()); |
| 132 | } |
| 133 | |
| 134 | static std::shared_ptr<FormatType> MakeFormat() { |
| 135 | return std::make_shared<FormatType>(); |
nothing calls this directly
no test coverage detected