| 1178 | } |
| 1179 | |
| 1180 | Status RecordBatchWriter::WriteTable(const Table& table, int64_t max_chunksize) { |
| 1181 | TableBatchReader reader(table); |
| 1182 | |
| 1183 | if (max_chunksize > 0) { |
| 1184 | reader.set_chunksize(max_chunksize); |
| 1185 | } |
| 1186 | |
| 1187 | std::shared_ptr<RecordBatch> batch; |
| 1188 | while (true) { |
| 1189 | RETURN_NOT_OK(reader.ReadNext(&batch)); |
| 1190 | if (batch == nullptr) { |
| 1191 | break; |
| 1192 | } |
| 1193 | RETURN_NOT_OK(WriteRecordBatch(*batch)); |
| 1194 | } |
| 1195 | |
| 1196 | return Status::OK(); |
| 1197 | } |
| 1198 | |
| 1199 | Status RecordBatchWriter::WriteTable(const Table& table) { return WriteTable(table, -1); } |
| 1200 | |