| 313 | protected: |
| 314 | template <typename Data> |
| 315 | Result<std::string> ToCsvString(const Data& data, const WriteOptions& options) { |
| 316 | std::shared_ptr<io::BufferOutputStream> out; |
| 317 | ARROW_ASSIGN_OR_RAISE(out, io::BufferOutputStream::Create()); |
| 318 | |
| 319 | RETURN_NOT_OK(WriteCSV(data, options, out.get())); |
| 320 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Buffer> buffer, out->Finish()); |
| 321 | return std::string(reinterpret_cast<const char*>(buffer->data()), buffer->size()); |
| 322 | } |
| 323 | |
| 324 | Result<std::string> ToCsvStringUsingWriter(const Table& data, |
| 325 | const WriteOptions& options) { |