| 23 | |
| 24 | template<class Chunk> |
| 25 | static void handleAppendException(std::vector<std::unique_ptr<Chunk>>& chunks, uint64_t numRows) { |
| 26 | // After an exception is thrown other threads may continue to work on this chunked group for a |
| 27 | // while before they are interrupted |
| 28 | // Although the changes will eventually be rolled back |
| 29 | // We reset the state of the chunk so later changes won't corrupt any data |
| 30 | // Due to the numValues in column chunks not matching the number of rows |
| 31 | for (const auto& chunk : chunks) { |
| 32 | chunk->truncate(numRows); |
| 33 | } |
| 34 | std::rethrow_exception(std::current_exception()); |
| 35 | } |
| 36 | |
| 37 | ChunkedNodeGroup::ChunkedNodeGroup(std::vector<std::unique_ptr<ColumnChunk>> chunks, |
| 38 | row_idx_t startRowIdx, NodeGroupDataFormat format) |