17namespace transaction {
25struct TableAddColumnState;
26struct NodeGroupScanState;
37 const std::vector<common::column_id_t>& selectedColumns);
38 ChunkedNodeGroup(
const std::vector<common::LogicalType>& columnTypes,
bool enableCompression,
57 return std::move(
chunks[columnID]);
76 const std::vector<common::ValueVector*>& columnVectors,
common::row_idx_t startRowInVectors,
77 uint64_t numValuesToAppend);
84 const std::vector<ColumnChunk*>& other,
common::offset_t offsetInOtherNodeGroup,
92 template<Res
idencyState SCAN_RESIDENCY_STATE>
101 std::pair<std::unique_ptr<ColumnChunk>, std::unique_ptr<ColumnChunk>>
scanUpdates(
114 bool enableCompression, BMFileHandle* dataFH);
128 const std::vector<std::unique_ptr<ColumnChunk>>& data,
ColumnChunk& offsetChunk) {
130 chunks[chunkIdx]->getData().write(&data[vectorIdx]->getData(), &offsetChunk.
getData(),
136 virtual void flush(BMFileHandle& dataFH);
143 template<
class TARGET>
147 template<
class TARGETT>
158 std::vector<std::unique_ptr<ColumnChunk>>
chunks;
#define KU_ASSERT(condition)
Definition assert.h:19
Definition deserializer.h:15
Definition serializer.h:15
Definition value_vector.h:20
Definition chunked_node_group.h:30
virtual void serialize(common::Serializer &serializer) const
common::row_idx_t getNumDeletions(const transaction::Transaction *transaction, common::row_idx_t startRow, common::length_t numRows) const
virtual ~ChunkedNodeGroup()=default
void update(transaction::Transaction *transaction, common::row_idx_t rowIdxInChunk, common::column_id_t columnID, const common::ValueVector &propertyVector)
common::offset_t append(const transaction::Transaction *transaction, const ChunkedNodeGroup &other, common::offset_t offsetInOtherNodeGroup, common::offset_t numRowsToAppend)
std::vector< std::unique_ptr< ColumnChunk > > chunks
Definition chunked_node_group.h:158
common::row_idx_t getNumUpdatedRows(const transaction::Transaction *transaction, common::column_id_t columnID)
bool isFullOrOnDisk() const
Definition chunked_node_group.h:59
const TARGETT & cast() const
Definition chunked_node_group.h:148
void addColumn(transaction::Transaction *transaction, const TableAddColumnState &addColumnState, bool enableCompression, BMFileHandle *dataFH)
std::unique_ptr< ColumnChunk > moveColumnChunk(const common::column_id_t columnID)
Definition chunked_node_group.h:55
NodeGroupDataFormat format
Definition chunked_node_group.h:153
ColumnChunk & getColumnChunk(const common::column_id_t columnID)
Definition chunked_node_group.h:51
ResidencyState getResidencyState() const
Definition chunked_node_group.h:62
ChunkedNodeGroup(std::vector< std::unique_ptr< ColumnChunk > > chunks, common::row_idx_t startRowIdx, NodeGroupDataFormat format=NodeGroupDataFormat::REGULAR)
std::pair< std::unique_ptr< ColumnChunk >, std::unique_ptr< ColumnChunk > > scanUpdates(transaction::Transaction *transaction, common::column_id_t columnID)
void resizeChunks(uint64_t newSize)
void scanCommitted(transaction::Transaction *transaction, TableScanState &scanState, NodeGroupScanState &nodeGroupScanState, ChunkedNodeGroup &output) const
void resetNumRowsFromChunks()
common::offset_t append(const transaction::Transaction *transaction, const std::vector< ColumnChunk * > &other, common::offset_t offsetInOtherNodeGroup, common::offset_t numRowsToAppend)
common::idx_t getNumColumns() const
Definition chunked_node_group.h:43
ChunkedNodeGroup(const std::vector< common::LogicalType > &columnTypes, bool enableCompression, uint64_t capacity, common::row_idx_t startRowIdx, ResidencyState residencyState, NodeGroupDataFormat format=NodeGroupDataFormat::REGULAR)
uint64_t append(const transaction::Transaction *transaction, const std::vector< common::ValueVector * > &columnVectors, common::row_idx_t startRowInVectors, uint64_t numValuesToAppend)
common::row_idx_t getNumRows() const
Definition chunked_node_group.h:45
common::row_idx_t getCapacity() const
Definition chunked_node_group.h:46
static std::unique_ptr< ChunkedNodeGroup > deserialize(common::Deserializer &deSer)
std::unique_ptr< VersionInfo > versionInfo
Definition chunked_node_group.h:159
NodeGroupDataFormat getFormat() const
Definition chunked_node_group.h:63
virtual std::unique_ptr< ChunkedNodeGroup > flushAsNewChunkedNodeGroup(transaction::Transaction *transaction, BMFileHandle &dataFH) const
void write(const ChunkedNodeGroup &data, common::column_id_t offsetColumnID)
bool hasAnyUpdates(const transaction::Transaction *transaction, common::column_id_t columnID, common::row_idx_t startRow, common::length_t numRows) const
void setVersionInfo(std::unique_ptr< VersionInfo > versionInfo)
Definition chunked_node_group.h:70
common::row_idx_t getStartRowIdx() const
Definition chunked_node_group.h:44
uint64_t getEstimatedMemoryUsage() const
void resetVersionAndUpdateInfo()
void scan(const transaction::Transaction *transaction, const TableScanState &scanState, const NodeGroupScanState &nodeGroupScanState, common::offset_t rowIdxInGroup, common::length_t numRowsToScan) const
ChunkedNodeGroup(ChunkedNodeGroup &base, const std::vector< common::column_id_t > &selectedColumns)
bool isDeleted(const transaction::Transaction *transaction, common::row_idx_t rowInChunk) const
common::row_idx_t startRowIdx
Definition chunked_node_group.h:155
TARGET & cast()
Definition chunked_node_group.h:144
ResidencyState residencyState
Definition chunked_node_group.h:154
static constexpr uint64_t CHUNK_CAPACITY
Definition chunked_node_group.h:32
common::row_idx_t getNumDeletedRows(const transaction::Transaction *transaction) const
virtual void flush(BMFileHandle &dataFH)
const ColumnChunk & getColumnChunk(const common::column_id_t columnID) const
Definition chunked_node_group.h:47
virtual void writeToColumnChunk(common::idx_t chunkIdx, common::idx_t vectorIdx, const std::vector< std::unique_ptr< ColumnChunk > > &data, ColumnChunk &offsetChunk)
Definition chunked_node_group.h:127
bool delete_(const transaction::Transaction *transaction, common::row_idx_t rowIdxInChunk)
bool isInserted(const transaction::Transaction *transaction, common::row_idx_t rowInChunk) const
bool lookup(transaction::Transaction *transaction, const TableScanState &state, NodeGroupScanState &nodeGroupScanState, common::offset_t rowIdxInChunk, common::sel_t posInOutput) const
void resetToAllNull() const
uint64_t capacity
Definition chunked_node_group.h:156
void setNumRows(common::offset_t numRows_)
std::atomic< common::row_idx_t > numRows
Definition chunked_node_group.h:157
bool hasVersionInfo() const
Definition chunked_node_group.h:123
Definition column_chunk.h:37
ColumnChunkData & getData() const
Definition column_chunk.h:75
Definition transaction.h:28
uint64_t length_t
Definition types.h:53
uint32_t idx_t
Definition types.h:39
property_id_t column_id_t
Definition types.h:36
uint64_t sel_t
Definition types.h:24
TO ku_dynamic_cast(FROM old)
Definition cast.h:11
uint64_t offset_t
Definition internal_id_t.h:22
uint64_t row_idx_t
Definition types.h:46
NodeGroupDataFormat
Definition chunked_node_group.h:28
ResidencyState
Definition residency_state.h:11
Definition alter_type.h:5
Definition node_group.h:17