| 187 | } |
| 188 | |
| 189 | [[nodiscard]] std::vector<ColumnDescriptor> effectiveColumns(const DataEngine& engine, const TopicStorage& storage) { |
| 190 | const auto& stored = storage.columnDescriptors(); |
| 191 | if (!stored.empty()) { |
| 192 | return stored; |
| 193 | } |
| 194 | if (const auto* type_tree = engine.typeRegistry().lookup(storage.descriptor().schema_id)) { |
| 195 | return buildSchemaColumns(*type_tree); |
| 196 | } |
| 197 | const auto& chunks = storage.sealedChunks(); |
| 198 | if (!chunks.empty()) { |
| 199 | std::vector<ColumnDescriptor> result; |
| 200 | result.reserve(chunks.front().columns.size()); |
| 201 | for (const auto& col : chunks.front().columns) { |
| 202 | result.push_back(*col.descriptor); |
| 203 | } |
| 204 | return result; |
| 205 | } |
| 206 | return {}; |
| 207 | } |
| 208 | |
| 209 | [[nodiscard]] const ColumnDescriptor* findFieldDescriptor( |
| 210 | const std::vector<ColumnDescriptor>& columns, FieldId field_id) { |
no test coverage detected