Kùzu C++ API
Loading...
Searching...
No Matches
column_chunk_data.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
5#include "constants.h"
6#include "sel_vector.h"
7#include "rel_multiplicity.h"
8#include "null_mask.h"
9#include "types.h"
10#include "compression.h"
11#include "residency_state.h"
12
13namespace kuzu {
14namespace evaluator {
15class ExpressionEvaluator;
16} // namespace evaluator
17
18namespace transaction {
19class Transaction;
20} // namespace transaction
21
22namespace storage {
23
24class Column;
25class NullChunkData;
26// TODO(Guodong): Ideally ColumnChunkMetadata should implement its own ser/deSer functions so it can
27// save a bit of space on disk. But the size is small now, I'm not motivated for the change, just
28// note here still.
43
44// TODO(bmwinger): Hide access to variables.
45struct ChunkState {
48 uint64_t numValuesPerPage = UINT64_MAX;
49 std::unique_ptr<ChunkState> nullState;
50 // Used for struct/list/string columns.
51 std::vector<ChunkState> childrenStates;
52
53 explicit ChunkState(bool hasNull = true) : column{nullptr} {
54 if (hasNull) {
55 nullState = std::make_unique<ChunkState>(false /*hasNull*/);
56 }
57 }
59 : column{nullptr}, metadata{std::move(metadata)}, numValuesPerPage{numValuesPerPage} {
60 nullState = std::make_unique<ChunkState>(false /*hasNull*/);
61 }
62
64 KU_ASSERT(childIdx < childrenStates.size());
65 return childrenStates[childIdx];
66 }
67 const ChunkState& getChildState(common::idx_t childIdx) const {
68 KU_ASSERT(childIdx < childrenStates.size());
69 return childrenStates[childIdx];
70 }
71
72 void resetState() {
73 numValuesPerPage = UINT64_MAX;
74 if (nullState) {
75 nullState->resetState();
76 }
77 for (auto& childState : childrenStates) {
78 childState.resetState();
79 }
80 }
81};
82
83class BMFileHandle;
84// Base data segment covers all fixed-sized data types.
86public:
87 friend struct ColumnChunkFactory;
88
93 virtual ~ColumnChunkData() = default;
94
95 template<typename T>
97 KU_ASSERT(pos < numValues);
99 return reinterpret_cast<T*>(buffer.get())[pos];
100 }
101 template<typename T>
102 void setValue(T val, common::offset_t pos) {
103 KU_ASSERT(pos < capacity);
105 reinterpret_cast<T*>(buffer.get())[pos] = val;
106 if (pos >= numValues) {
107 numValues = pos + 1;
108 }
109 }
110
111 bool isNull(common::offset_t pos) const;
112 void setNullData(std::unique_ptr<NullChunkData> nullData_) { nullData = std::move(nullData_); }
113 bool hasNullData() const { return nullData != nullptr; }
114 NullChunkData* getNullData() { return nullData.get(); }
115 const NullChunkData& getNullData() const { return *nullData; }
116 std::optional<common::NullMask> getNullMask() const;
117 std::unique_ptr<NullChunkData> moveNullData() { return std::move(nullData); }
118
120 const common::LogicalType& getDataType() const { return dataType; }
131 void setMetadata(const ColumnChunkMetadata& metadata_) {
133 metadata = metadata_;
134 }
135
136 // Only have side effects on in-memory or temporary chunks.
137 virtual void resetToAllNull();
138 virtual void resetToEmpty();
139
140 // Note that the startPageIdx is not known, so it will always be common::INVALID_PAGE_IDX
142
143 virtual void append(common::ValueVector* vector, const common::SelectionVector& selVector);
144 virtual void append(ColumnChunkData* other, common::offset_t startPosInOtherChunk,
145 uint32_t numValuesToAppend);
146
147 virtual void flush(BMFileHandle& dataFH);
148
149 ColumnChunkMetadata flushBuffer(BMFileHandle* dataFH, common::page_idx_t startPageIdx,
150 const ColumnChunkMetadata& metadata) const;
151
156
157 uint64_t getNumBytesPerValue() const { return numBytesPerValue; }
158 uint8_t* getData() const { return buffer.get(); }
159
160 virtual void initializeScanState(ChunkState& state) const;
161 virtual void scan(common::ValueVector& output, common::offset_t offset, common::length_t length,
162 common::sel_t posInOutputVector = 0) const;
163 virtual void lookup(common::offset_t offsetInChunk, common::ValueVector& output,
164 common::sel_t posInOutputVector) const;
165
166 // TODO(Guodong): In general, this is not a good interface. Instead of passing in
167 // `offsetInVector`, we should flatten the vector to pos at `offsetInVector`.
168 virtual void write(const common::ValueVector* vector, common::offset_t offsetInVector,
169 common::offset_t offsetInChunk);
170 virtual void write(ColumnChunkData* chunk, ColumnChunkData* offsetsInChunk,
171 common::RelMultiplicity multiplicity);
172 virtual void write(ColumnChunkData* srcChunk, common::offset_t srcOffsetInChunk,
173 common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy);
174 // TODO(Guodong): Used in `applyDeletionsToChunk`. Should unify with `write`.
175 virtual void copy(ColumnChunkData* srcChunk, common::offset_t srcOffsetInChunk,
176 common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy);
177
178 virtual void setToInMemory();
179 // numValues must be at least the number of values the ColumnChunk was first initialized
180 // with
181 virtual void resize(uint64_t newCapacity);
182
183 void populateWithDefaultVal(evaluator::ExpressionEvaluator& defaultEvaluator,
184 uint64_t& numValues_);
185 virtual void finalize() {
187 // DO NOTHING.
188 }
189
190 uint64_t getCapacity() const { return capacity; }
191 virtual uint64_t getNumValues() const { return numValues; }
192 // TODO(Guodong): Alternatively, we can let `getNumValues` read from metadata when ON_DISK.
194 virtual void setNumValues(uint64_t numValues_);
195 virtual void syncNumValues() {}
196 virtual bool numValuesSanityCheck() const;
197
198 virtual bool sanityCheck() const;
199
200 virtual uint64_t getEstimatedMemoryUsage() const;
201
202 virtual void serialize(common::Serializer& serializer) const;
203 static std::unique_ptr<ColumnChunkData> deserialize(common::Deserializer& deSer);
204
205 template<typename TARGET>
206 TARGET& cast() {
208 }
209 template<typename TARGET>
210 const TARGET& cast() const {
212 }
213
214protected:
215 // Initializes the data buffer and functions. They are (and should be) only called in
216 // constructor.
219
220 // Note: This function is not setting child/null chunk data recursively.
222
223 virtual void copyVectorToBuffer(common::ValueVector* vector, common::offset_t startPosInChunk,
224 const common::SelectionVector& selVector);
225
226private:
227 uint64_t getBufferSize(uint64_t capacity_) const;
228
229protected:
230 using flush_buffer_func_t = std::function<ColumnChunkMetadata(const uint8_t*, uint64_t,
231 BMFileHandle*, common::page_idx_t, const ColumnChunkMetadata&)>;
232 using get_metadata_func_t = std::function<ColumnChunkMetadata(const uint8_t*, uint64_t,
233 uint64_t, uint64_t, StorageValue, StorageValue)>;
235 std::function<std::pair<StorageValue, StorageValue>(const uint8_t*, uint64_t)>;
236
241 uint64_t bufferSize;
242 uint64_t capacity;
243 std::unique_ptr<uint8_t[]> buffer;
244 std::unique_ptr<NullChunkData> nullData;
245 uint64_t numValues;
248
249 // On-disk metadata for column chunk.
251};
252
253template<>
254inline void ColumnChunkData::setValue(bool val, common::offset_t pos) {
255 // Buffer is rounded up to the nearest 8 bytes so that this cast is safe
256 common::NullMask::setNull(reinterpret_cast<uint64_t*>(buffer.get()), pos, val);
257}
258
259template<>
261 // Buffer is rounded up to the nearest 8 bytes so that this cast is safe
262 return common::NullMask::isNull(reinterpret_cast<uint64_t*>(buffer.get()), pos);
263}
264
265// Stored as bitpacked booleans in-memory and on-disk
267public:
268 BoolChunkData(uint64_t capacity, bool enableCompression, ResidencyState type, bool hasNullChunk)
269 : ColumnChunkData(common::LogicalType::BOOL(), capacity,
270 // Booleans are always bitpacked, but this can also enable constant compression
271 enableCompression, type, hasNullChunk) {}
274
275 void append(common::ValueVector* vector, const common::SelectionVector& sel) final;
276 void append(ColumnChunkData* other, common::offset_t startPosInOtherChunk,
277 uint32_t numValuesToAppend) override;
278
280 common::sel_t posInOutputVector = 0) const override;
281 void lookup(common::offset_t offsetInChunk, common::ValueVector& output,
282 common::sel_t posInOutputVector) const override;
283
284 void write(const common::ValueVector* vector, common::offset_t offsetInVector,
285 common::offset_t offsetInChunk) override;
286 void write(ColumnChunkData* chunk, ColumnChunkData* dstOffsets,
287 common::RelMultiplicity multiplicity) final;
288 void write(ColumnChunkData* srcChunk, common::offset_t srcOffsetInChunk,
289 common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy) override;
290};
291
292class NullChunkData final : public BoolChunkData {
293public:
295 : BoolChunkData(capacity, enableCompression, type, false /*hasNullData*/),
296 mayHaveNullValue{false} {}
300
301 // Maybe this should be combined with BoolChunkData if the only difference is these functions?
302 bool isNull(common::offset_t pos) const { return getValue<bool>(pos); }
304
305 bool mayHaveNull() const { return mayHaveNullValue; }
306
307 void resetToEmpty() override {
309 numValues = 0;
310 }
312 memset(buffer.get(), 0 /* non null */, bufferSize);
313 mayHaveNullValue = false;
314 }
315 void resetToAllNull() override {
316 memset(buffer.get(), 0xFF /* null */, bufferSize);
317 mayHaveNullValue = true;
318 }
319
320 void copyFromBuffer(uint64_t* srcBuffer, uint64_t srcOffset, uint64_t dstOffset,
321 uint64_t numBits, bool invert = false) {
322 if (common::NullMask::copyNullMask(srcBuffer, srcOffset,
323 reinterpret_cast<uint64_t*>(buffer.get()), dstOffset, numBits, invert)) {
324 mayHaveNullValue = true;
325 }
326 }
327
328 // NullChunkData::scan updates the null mask of output vector
330 common::sel_t posInOutputVector = 0) const override;
331
332 void append(ColumnChunkData* other, common::offset_t startPosInOtherChunk,
333 uint32_t numValuesToAppend) override;
334
335 void write(const common::ValueVector* vector, common::offset_t offsetInVector,
336 common::offset_t offsetInChunk) override;
337 void write(ColumnChunkData* srcChunk, common::offset_t srcOffsetInChunk,
338 common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy) override;
339
340 void serialize(common::Serializer& serializer) const override;
341 static std::unique_ptr<NullChunkData> deserialize(common::Deserializer& deSer);
342
344 return common::NullMask(std::span(reinterpret_cast<uint64_t*>(buffer.get()), capacity / 64),
346 }
347
348protected:
350};
351
353public:
354 // TODO(Guodong): Should make InternalIDChunkData has no NULL.
355 // Physically, we only materialize offset of INTERNAL_ID, which is same as UINT64,
357 : ColumnChunkData(common::LogicalType::INTERNAL_ID(), capacity, enableCompression,
358 residencyState, false /*hasNullData*/),
359 commonTableID{common::INVALID_TABLE_ID} {}
361 : ColumnChunkData{common::LogicalType::INTERNAL_ID(), enableCompression, metadata,
362 false /*hasNullData*/},
363 commonTableID{common::INVALID_TABLE_ID} {}
364
365 void append(common::ValueVector* vector, const common::SelectionVector& selVector) override;
366
368 const common::SelectionVector& selVector) override;
369
371 const common::SelectionVector& selVector) const;
372
374 common::sel_t posInOutputVector = 0) const override;
375 void lookup(common::offset_t offsetInChunk, common::ValueVector& output,
376 common::sel_t posInOutputVector) const override;
377
378 void write(const common::ValueVector* vector, common::offset_t offsetInVector,
379 common::offset_t offsetInChunk) override;
380
381 void append(ColumnChunkData* other, common::offset_t startPosInOtherChunk,
382 uint32_t numValuesToAppend) override;
383
384 void setTableID(common::table_id_t tableID) { commonTableID = tableID; }
385 common::table_id_t getTableID() const { return commonTableID; }
386
391 return reinterpret_cast<common::offset_t*>(buffer.get())[pos];
392 }
393
394private:
395 common::table_id_t commonTableID;
396};
397
399 static std::unique_ptr<ColumnChunkData> createColumnChunkData(common::LogicalType dataType,
400 bool enableCompression, uint64_t capacity, ResidencyState residencyState,
401 bool hasNullData = true);
402 static std::unique_ptr<ColumnChunkData> createColumnChunkData(common::LogicalType dataType,
403 bool enableCompression, ColumnChunkMetadata& metadata, bool hasNullData);
404
405 static std::unique_ptr<ColumnChunkData> createNullChunkData(bool enableCompression,
406 uint64_t capacity, ResidencyState type) {
407 return std::make_unique<NullChunkData>(capacity, enableCompression, type);
408 }
409};
410
411} // namespace storage
412} // namespace kuzu
#define KU_ASSERT(condition)
Definition assert.h:19
Definition deserializer.h:15
Definition types.h:201
Definition null_mask.h:70
static bool copyNullMask(const uint64_t *srcNullEntries, uint64_t srcOffset, uint64_t *dstNullEntries, uint64_t dstOffset, uint64_t numBitsToCopy, bool invert=false)
static bool isNull(const uint64_t *nullEntries, uint32_t pos)
Definition null_mask.h:112
static void setNull(uint64_t *nullEntries, uint32_t pos, bool isNull)
Definition sel_vector.h:12
Definition serializer.h:15
Definition value_vector.h:20
Definition column_chunk_data.h:266
void append(ColumnChunkData *other, common::offset_t startPosInOtherChunk, uint32_t numValuesToAppend) override
void append(common::ValueVector *vector, const common::SelectionVector &sel) final
void write(const common::ValueVector *vector, common::offset_t offsetInVector, common::offset_t offsetInChunk) override
void lookup(common::offset_t offsetInChunk, common::ValueVector &output, common::sel_t posInOutputVector) const override
BoolChunkData(uint64_t capacity, bool enableCompression, ResidencyState type, bool hasNullChunk)
Definition column_chunk_data.h:268
void write(ColumnChunkData *chunk, ColumnChunkData *dstOffsets, common::RelMultiplicity multiplicity) final
BoolChunkData(bool enableCompression, const ColumnChunkMetadata &metadata, bool hasNullData)
Definition column_chunk_data.h:272
void write(ColumnChunkData *srcChunk, common::offset_t srcOffsetInChunk, common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy) override
void scan(common::ValueVector &output, common::offset_t offset, common::length_t length, common::sel_t posInOutputVector=0) const override
Definition column_chunk_data.h:85
uint64_t numValues
Definition column_chunk_data.h:245
const TARGET & cast() const
Definition column_chunk_data.h:210
const NullChunkData & getNullData() const
Definition column_chunk_data.h:115
std::function< std::pair< StorageValue, StorageValue >(const uint8_t *, uint64_t)> get_min_max_func_t
Definition column_chunk_data.h:234
uint32_t numBytesPerValue
Definition column_chunk_data.h:240
uint64_t getCapacity() const
Definition column_chunk_data.h:190
virtual bool numValuesSanityCheck() const
const common::LogicalType & getDataType() const
Definition column_chunk_data.h:120
void setValue(T val, common::offset_t pos)
Definition column_chunk_data.h:102
std::unique_ptr< NullChunkData > nullData
Definition column_chunk_data.h:244
uint64_t getNumBytesPerValue() const
Definition column_chunk_data.h:157
std::unique_ptr< NullChunkData > moveNullData()
Definition column_chunk_data.h:117
ColumnChunkMetadata metadata
Definition column_chunk_data.h:250
virtual void initializeScanState(ChunkState &state) const
get_metadata_func_t getMetadataFunction
Definition column_chunk_data.h:247
virtual void copyVectorToBuffer(common::ValueVector *vector, common::offset_t startPosInChunk, const common::SelectionVector &selVector)
bool isCompressionEnabled() const
Definition column_chunk_data.h:122
virtual void copy(ColumnChunkData *srcChunk, common::offset_t srcOffsetInChunk, common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy)
virtual void write(ColumnChunkData *srcChunk, common::offset_t srcOffsetInChunk, common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy)
virtual void scan(common::ValueVector &output, common::offset_t offset, common::length_t length, common::sel_t posInOutputVector=0) const
ColumnChunkMetadata & getMetadata()
Definition column_chunk_data.h:123
virtual void lookup(common::offset_t offsetInChunk, common::ValueVector &output, common::sel_t posInOutputVector) const
std::optional< common::NullMask > getNullMask() const
bool enableCompression
Definition column_chunk_data.h:239
virtual void resetNumValuesFromMetadata()
virtual uint64_t getNumValues() const
Definition column_chunk_data.h:191
ColumnChunkData(common::LogicalType dataType, uint64_t capacity, bool enableCompression, ResidencyState residencyState, bool hasNullData)
flush_buffer_func_t flushBufferFunction
Definition column_chunk_data.h:246
TARGET & cast()
Definition column_chunk_data.h:206
ColumnChunkMetadata flushBuffer(BMFileHandle *dataFH, common::page_idx_t startPageIdx, const ColumnChunkMetadata &metadata) const
uint8_t * getData() const
Definition column_chunk_data.h:158
T getValue(common::offset_t pos) const
Definition column_chunk_data.h:96
ColumnChunkData(common::LogicalType dataType, bool enableCompression, const ColumnChunkMetadata &metadata, bool hasNullData)
ResidencyState getResidencyState() const
Definition column_chunk_data.h:121
bool isNull(common::offset_t pos) const
virtual void append(common::ValueVector *vector, const common::SelectionVector &selVector)
const ColumnChunkMetadata & getMetadata() const
Definition column_chunk_data.h:127
static common::page_idx_t getNumPagesForBytes(uint64_t numBytes)
Definition column_chunk_data.h:152
common::LogicalType & getDataType()
Definition column_chunk_data.h:119
common::LogicalType dataType
Definition column_chunk_data.h:238
void setMetadata(const ColumnChunkMetadata &metadata_)
Definition column_chunk_data.h:131
virtual void syncNumValues()
Definition column_chunk_data.h:195
void initializeFunction(bool enableCompression)
virtual void setNumValues(uint64_t numValues_)
virtual void flush(BMFileHandle &dataFH)
void setNullData(std::unique_ptr< NullChunkData > nullData_)
Definition column_chunk_data.h:112
virtual void write(ColumnChunkData *chunk, ColumnChunkData *offsetsInChunk, common::RelMultiplicity multiplicity)
virtual void resize(uint64_t newCapacity)
NullChunkData * getNullData()
Definition column_chunk_data.h:114
static std::unique_ptr< ColumnChunkData > deserialize(common::Deserializer &deSer)
virtual void write(const common::ValueVector *vector, common::offset_t offsetInVector, common::offset_t offsetInChunk)
std::unique_ptr< uint8_t[]> buffer
Definition column_chunk_data.h:243
void setToOnDisk(const ColumnChunkMetadata &metadata)
virtual void finalize()
Definition column_chunk_data.h:185
uint64_t capacity
Definition column_chunk_data.h:242
ResidencyState residencyState
Definition column_chunk_data.h:237
uint64_t bufferSize
Definition column_chunk_data.h:241
virtual uint64_t getEstimatedMemoryUsage() const
virtual bool sanityCheck() const
virtual ~ColumnChunkData()=default
bool hasNullData() const
Definition column_chunk_data.h:113
virtual ColumnChunkMetadata getMetadataToFlush() const
virtual void serialize(common::Serializer &serializer) const
virtual void append(ColumnChunkData *other, common::offset_t startPosInOtherChunk, uint32_t numValuesToAppend)
std::function< ColumnChunkMetadata(const uint8_t *, uint64_t, uint64_t, uint64_t, StorageValue, StorageValue)> get_metadata_func_t
Definition column_chunk_data.h:232
void populateWithDefaultVal(evaluator::ExpressionEvaluator &defaultEvaluator, uint64_t &numValues_)
std::function< ColumnChunkMetadata(const uint8_t *, uint64_t, BMFileHandle *, common::page_idx_t, const ColumnChunkMetadata &)> flush_buffer_func_t
Definition column_chunk_data.h:230
Definition column.h:39
Definition column_chunk_data.h:352
void copyVectorToBuffer(common::ValueVector *vector, common::offset_t startPosInChunk, const common::SelectionVector &selVector) override
void append(ColumnChunkData *other, common::offset_t startPosInOtherChunk, uint32_t numValuesToAppend) override
common::offset_t & operator[](common::offset_t pos)
Definition column_chunk_data.h:390
void setTableID(common::table_id_t tableID)
Definition column_chunk_data.h:384
void write(const common::ValueVector *vector, common::offset_t offsetInVector, common::offset_t offsetInChunk) override
void lookup(common::offset_t offsetInChunk, common::ValueVector &output, common::sel_t posInOutputVector) const override
void append(common::ValueVector *vector, const common::SelectionVector &selVector) override
InternalIDChunkData(uint64_t capacity, bool enableCompression, ResidencyState residencyState)
Definition column_chunk_data.h:356
void scan(common::ValueVector &output, common::offset_t offset, common::length_t length, common::sel_t posInOutputVector=0) const override
common::offset_t operator[](common::offset_t pos) const
Definition column_chunk_data.h:387
void copyInt64VectorToBuffer(common::ValueVector *vector, common::offset_t startPosInChunk, const common::SelectionVector &selVector) const
InternalIDChunkData(bool enableCompression, const ColumnChunkMetadata &metadata)
Definition column_chunk_data.h:360
common::table_id_t getTableID() const
Definition column_chunk_data.h:385
Definition column_chunk_data.h:292
void resetToAllNull() override
Definition column_chunk_data.h:315
void serialize(common::Serializer &serializer) const override
static std::unique_ptr< NullChunkData > deserialize(common::Deserializer &deSer)
void copyFromBuffer(uint64_t *srcBuffer, uint64_t srcOffset, uint64_t dstOffset, uint64_t numBits, bool invert=false)
Definition column_chunk_data.h:320
common::NullMask getNullMask() const
Definition column_chunk_data.h:343
void write(ColumnChunkData *srcChunk, common::offset_t srcOffsetInChunk, common::offset_t dstOffsetInChunk, common::offset_t numValuesToCopy) override
bool mayHaveNull() const
Definition column_chunk_data.h:305
void write(const common::ValueVector *vector, common::offset_t offsetInVector, common::offset_t offsetInChunk) override
NullChunkData(uint64_t capacity, bool enableCompression, ResidencyState type)
Definition column_chunk_data.h:294
NullChunkData(bool enableCompression, const ColumnChunkMetadata &metadata)
Definition column_chunk_data.h:297
void setNull(common::offset_t pos, bool isNull)
bool mayHaveNullValue
Definition column_chunk_data.h:349
void resetToEmpty() override
Definition column_chunk_data.h:307
void scan(common::ValueVector &output, common::offset_t offset, common::length_t length, common::sel_t posInOutputVector=0) const override
void append(ColumnChunkData *other, common::offset_t startPosInOtherChunk, uint32_t numValuesToAppend) override
bool isNull(common::offset_t pos) const
Definition column_chunk_data.h:302
void resetToNoNull()
Definition column_chunk_data.h:311
uint64_t length_t
Definition types.h:53
uint32_t idx_t
Definition types.h:39
RelMultiplicity
Definition rel_multiplicity.h:9
uint32_t page_idx_t
Definition types.h:26
uint64_t table_id_t
Definition internal_id_t.h:14
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
CompressionType
Definition compression.h:103
ResidencyState
Definition residency_state.h:11
Definition alter_type.h:5
static constexpr uint64_t PAGE_4KB_SIZE
Definition constants.h:62
Definition column_chunk_data.h:45
std::vector< ChunkState > childrenStates
Definition column_chunk_data.h:51
void resetState()
Definition column_chunk_data.h:72
ChunkState & getChildState(common::idx_t childIdx)
Definition column_chunk_data.h:63
std::unique_ptr< ChunkState > nullState
Definition column_chunk_data.h:49
ColumnChunkMetadata metadata
Definition column_chunk_data.h:47
ChunkState(bool hasNull=true)
Definition column_chunk_data.h:53
uint64_t numValuesPerPage
Definition column_chunk_data.h:48
Column * column
Definition column_chunk_data.h:46
const ChunkState & getChildState(common::idx_t childIdx) const
Definition column_chunk_data.h:67
ChunkState(ColumnChunkMetadata metadata, uint64_t numValuesPerPage)
Definition column_chunk_data.h:58
Definition column_chunk_data.h:398
static std::unique_ptr< ColumnChunkData > createColumnChunkData(common::LogicalType dataType, bool enableCompression, uint64_t capacity, ResidencyState residencyState, bool hasNullData=true)
static std::unique_ptr< ColumnChunkData > createColumnChunkData(common::LogicalType dataType, bool enableCompression, ColumnChunkMetadata &metadata, bool hasNullData)
static std::unique_ptr< ColumnChunkData > createNullChunkData(bool enableCompression, uint64_t capacity, ResidencyState type)
Definition column_chunk_data.h:405
Definition column_chunk_data.h:29
CompressionMetadata compMeta
Definition column_chunk_data.h:33
common::page_idx_t numPages
Definition column_chunk_data.h:31
ColumnChunkMetadata()
Definition column_chunk_data.h:36
common::page_idx_t pageIdx
Definition column_chunk_data.h:30
uint64_t numValues
Definition column_chunk_data.h:32
ColumnChunkMetadata(common::page_idx_t pageIdx, common::page_idx_t numPages, uint64_t numNodesInChunk, const CompressionMetadata &compMeta)
Definition column_chunk_data.h:39
Definition compression.h:111
Definition compression.h:30