| 20 | |
| 21 | template<std::floating_point T> |
| 22 | InMemoryExceptionChunk<T>::InMemoryExceptionChunk(const SegmentState& state, FileHandle* dataFH, |
| 23 | MemoryManager* memoryManager, ShadowFile* shadowFile) |
| 24 | : exceptionCount(state.metadata.compMeta.floatMetadata()->exceptionCount), |
| 25 | finalizedExceptionCount(exceptionCount), |
| 26 | exceptionCapacity(state.metadata.compMeta.floatMetadata()->exceptionCapacity), |
| 27 | emptyMask(exceptionCapacity), |
| 28 | column(std::make_unique<Column>("ALPExceptionChunk", physicalType, dataFH, memoryManager, |
| 29 | shadowFile, false, false /*has nulls*/)) { |
| 30 | const auto exceptionBaseCursor = |
| 31 | getExceptionPageCursor(state.metadata, PageCursor{state.metadata.getStartPageIdx(), 0}, |
| 32 | state.metadata.compMeta.floatMetadata()->exceptionCapacity); |
| 33 | // for ALP exceptions we don't care about the statistics |
| 34 | const auto compMeta = |
| 35 | CompressionMetadata(StorageValue{0}, StorageValue{1}, CompressionType::UNCOMPRESSED); |
| 36 | const auto exceptionChunkMeta = ColumnChunkMetadata(exceptionBaseCursor.pageIdx, |
| 37 | safeIntegerConversion<page_idx_t>( |
| 38 | EncodeException<T>::numPagesFromExceptions(exceptionCapacity)), |
| 39 | exceptionCapacity, compMeta); |
| 40 | chunkState = std::make_unique<SegmentState>(exceptionChunkMeta, |
| 41 | EncodeException<T>::exceptionBytesPerPage() / EncodeException<T>::sizeInBytes()); |
| 42 | |
| 43 | chunkData = |
| 44 | std::make_unique<ColumnChunkData>(*memoryManager, physicalType, false, exceptionChunkMeta, |
| 45 | false /*all written data is non-null and nulls are kept in a separate mask in-memory*/); |
| 46 | chunkData->setToInMemory(); |
| 47 | column->scanSegment(*chunkState, chunkData.get(), 0, chunkState->metadata.numValues); |
| 48 | } |
| 49 | |
| 50 | template<std::floating_point T> |
| 51 | InMemoryExceptionChunk<T>::~InMemoryExceptionChunk() = default; |
nothing calls this directly
no test coverage detected