MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / appendNull

Method appendNull

pj_datastore/src/column_buffer.cpp:153–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void TypedColumnBuffer::appendNull() {
154 ensureValidityInitialized();
155
156 // Ensure bitmap has room for this row.
157 validity_.ensureSize(row_count_ + 1);
158 validity_.setNull(row_count_);
159
160 // Append zero bytes for the value slot.
161 const StorageKind kind = storageKindOf(descriptor_.logical_type);
162 if (kind == StorageKind::kString) {
163 // For strings: write the initial offset if this is the first row.
164 if (row_count_ == 0) {
165 const uint32_t zero = 0;
166 offsets_.append(&zero, sizeof(zero));
167 }
168 // Duplicate the current end offset (no new string data).
169 const auto current_offset = static_cast<uint32_t>(values_.size());
170 offsets_.append(&current_offset, sizeof(current_offset));
171 } else {
172 const std::size_t type_size = storageKindSize(kind);
173 // Append type_size zero bytes.
174 const uint64_t zero = 0; // 8 bytes, enough for any fixed type
175 values_.append(&zero, type_size);
176 }
177
178 ++row_count_;
179 ++null_count_;
180}
181
182// ---------------------------------------------------------------------------
183// Bulk fixed-size append template

Callers 4

setNullMethod · 0.80
finishRowMethod · 0.80
sortRowsByTimestampMethod · 0.80
TESTFunction · 0.80

Calls 6

storageKindOfFunction · 0.85
storageKindSizeFunction · 0.85
ensureSizeMethod · 0.80
setNullMethod · 0.45
appendMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.64