| 1155 | } |
| 1156 | |
| 1157 | Status RecordBatchWriter::WriteTable(const Table& table, int64_t max_chunksize) { |
| 1158 | TableBatchReader reader(table); |
| 1159 | |
| 1160 | if (max_chunksize > 0) { |
| 1161 | reader.set_chunksize(max_chunksize); |
| 1162 | } |
| 1163 | |
| 1164 | std::shared_ptr<RecordBatch> batch; |
| 1165 | while (true) { |
| 1166 | RETURN_NOT_OK(reader.ReadNext(&batch)); |
| 1167 | if (batch == nullptr) { |
| 1168 | break; |
| 1169 | } |
| 1170 | RETURN_NOT_OK(WriteRecordBatch(*batch)); |
| 1171 | } |
| 1172 | |
| 1173 | return Status::OK(); |
| 1174 | } |
| 1175 | |
| 1176 | Status RecordBatchWriter::WriteTable(const Table& table) { return WriteTable(table, -1); } |
| 1177 | |