MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / scanUnfiltered

Method scanUnfiltered

src/storage/table/string_column.cpp:213–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void StringColumn::scanUnfiltered(const SegmentState& state, offset_t startOffsetInChunk,
214 offset_t numValuesToRead, ValueVector* resultVector, sel_t startPosInVector) const {
215 // TODO: Replace indices with ValueVector to avoid maintaining `scan` interface from
216 // uint8_t*.
217 auto indices = std::make_unique<string_index_t[]>(numValuesToRead);
218 indexColumn->scanSegment(getChildState(state, ChildStateIndex::INDEX), startOffsetInChunk,
219 numValuesToRead, reinterpret_cast<uint8_t*>(indices.get()));
220
221 std::vector<std::pair<string_index_t, uint64_t>> offsetsToScan;
222 for (auto i = 0u; i < numValuesToRead; i++) {
223 if (!resultVector->isNull(startPosInVector + i)) {
224 offsetsToScan.emplace_back(indices[i], startPosInVector + i);
225 }
226 }
227
228 if (offsetsToScan.size() == 0) {
229 // All scanned values are null
230 return;
231 }
232 dictionary.scan(getChildState(state, ChildStateIndex::OFFSET),
233 getChildState(state, ChildStateIndex::DATA), offsetsToScan, resultVector,
234 getChildState(state, ChildStateIndex::INDEX).metadata);
235}
236
237void StringColumn::scanFiltered(const SegmentState& state, offset_t startOffsetInChunk,
238 ValueVector* resultVector, offset_t offsetInResult) const {

Callers

nothing calls this directly

Calls 6

emplace_backMethod · 0.80
scanSegmentMethod · 0.45
getMethod · 0.45
isNullMethod · 0.45
sizeMethod · 0.45
scanMethod · 0.45

Tested by

no test coverage detected