| 327 | } |
| 328 | |
| 329 | void Column::updateStatistics(ColumnChunkMetadata& metadata, offset_t maxIndex, |
| 330 | const std::optional<StorageValue>& min, const std::optional<StorageValue>& max) const { |
| 331 | if (maxIndex >= metadata.numValues) { |
| 332 | metadata.numValues = maxIndex + 1; |
| 333 | DASSERT(sanityCheckForWrites(metadata, dataType)); |
| 334 | } |
| 335 | // Either both or neither should be provided |
| 336 | DASSERT((!min && !max) || (min && max)); |
| 337 | if (min && max) { |
| 338 | // If new values are outside of the existing min/max, update them |
| 339 | if (max->gt(metadata.compMeta.max, dataType.getPhysicalType())) { |
| 340 | metadata.compMeta.max = *max; |
| 341 | } else if (metadata.compMeta.min.gt(*min, dataType.getPhysicalType())) { |
| 342 | metadata.compMeta.min = *min; |
| 343 | } |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | void Column::write(ColumnChunkData& persistentChunk, ChunkState& state, offset_t initialDstOffset, |
| 348 | const ColumnChunkData& data, offset_t srcOffset, length_t numValues) const { |
no test coverage detected