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