| 501 | } |
| 502 | |
| 503 | std::vector<std::unique_ptr<ColumnChunkData>> Column::checkpointSegment( |
| 504 | ColumnCheckpointState&& checkpointState, PageAllocator& pageAllocator, |
| 505 | bool canSplitSegment) const { |
| 506 | if (checkpointState.segmentCheckpointStates.empty()) { |
| 507 | return {}; |
| 508 | } |
| 509 | SegmentState chunkState; |
| 510 | checkpointState.persistentData.initializeScanState(chunkState, this); |
| 511 | if (canCheckpointInPlace(chunkState, checkpointState)) { |
| 512 | checkpointColumnChunkInPlace(chunkState, checkpointState, pageAllocator); |
| 513 | |
| 514 | if (chunkState.metadata.compMeta.compression == CompressionType::ALP) { |
| 515 | if (dataType.getPhysicalType() == PhysicalTypeID::DOUBLE) { |
| 516 | chunkState.getExceptionChunk<double>()->finalizeAndFlushToDisk(chunkState); |
| 517 | } else if (dataType.getPhysicalType() == PhysicalTypeID::FLOAT) { |
| 518 | chunkState.getExceptionChunk<float>()->finalizeAndFlushToDisk(chunkState); |
| 519 | } else { |
| 520 | UNREACHABLE_CODE; |
| 521 | } |
| 522 | checkpointState.persistentData.getMetadata().compMeta.floatMetadata()->exceptionCount = |
| 523 | chunkState.metadata.compMeta.floatMetadata()->exceptionCount; |
| 524 | } |
| 525 | return {}; |
| 526 | } else { |
| 527 | return checkpointColumnChunkOutOfPlace(chunkState, checkpointState, pageAllocator, |
| 528 | canSplitSegment); |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | std::unique_ptr<Column> ColumnFactory::createColumn(std::string name, PhysicalTypeID physicalType, |
| 533 | FileHandle* dataFH, MemoryManager* mm, ShadowFile* shadowFile, bool enableCompression) { |
no test coverage detected