| 29 | // --------------------------------------------------------------------------- |
| 30 | |
| 31 | TopicChunk makeChunkWithRange(TopicId tid, Timestamp t_start, Timestamp t_end, uint32_t num_rows) { |
| 32 | std::vector<ColumnDescriptor> cols = {{0, PrimitiveType::kFloat32, "v"}}; |
| 33 | TopicChunkBuilder b(tid, /*schema_id=*/1, cols, num_rows); |
| 34 | Timestamp step = (num_rows > 1) ? (t_end - t_start) / static_cast<Timestamp>(num_rows - 1) : 0; |
| 35 | for (uint32_t i = 0; i < num_rows; ++i) { |
| 36 | b.beginRow(t_start + static_cast<Timestamp>(i) * step); |
| 37 | b.set(0, static_cast<float>(i)); |
| 38 | b.finishRow(); |
| 39 | } |
| 40 | return b.seal(); |
| 41 | } |
| 42 | |
| 43 | // =========================================================================== |
| 44 | // Bug #1 — flush() with an in-progress row corrupts chunk stats |