| 310 | } |
| 311 | |
| 312 | [[maybe_unused]] static bool sanityCheckForWrites(const ColumnChunkMetadata& metadata, |
| 313 | const LogicalType& dataType) { |
| 314 | if (metadata.compMeta.compression == CompressionType::ALP) { |
| 315 | return metadata.compMeta.children.size() != 0; |
| 316 | } |
| 317 | if (metadata.compMeta.compression == CompressionType::CONSTANT) { |
| 318 | return metadata.getNumDataPages(dataType.getPhysicalType()) == 0; |
| 319 | } |
| 320 | const auto numValuesPerPage = metadata.compMeta.numValues(LBUG_PAGE_SIZE, dataType); |
| 321 | if (numValuesPerPage == UINT64_MAX) { |
| 322 | return metadata.getNumDataPages(dataType.getPhysicalType()) == 0; |
| 323 | } |
| 324 | return std::ceil( |
| 325 | static_cast<double>(metadata.numValues) / static_cast<double>(numValuesPerPage)) <= |
| 326 | metadata.getNumDataPages(dataType.getPhysicalType()); |
| 327 | } |
| 328 | |
| 329 | void Column::updateStatistics(ColumnChunkMetadata& metadata, offset_t maxIndex, |
| 330 | const std::optional<StorageValue>& min, const std::optional<StorageValue>& max) const { |
no test coverage detected