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

Method scanFiltered

src/storage/table/string_column.cpp:237–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void StringColumn::scanFiltered(const SegmentState& state, offset_t startOffsetInChunk,
238 ValueVector* resultVector, offset_t offsetInResult) const {
239 std::vector<std::pair<string_index_t, uint64_t>> offsetsToScan;
240 for (sel_t i = 0; i < resultVector->state->getSelVector().getSelSize(); i++) {
241 const auto pos = resultVector->state->getSelVector()[i];
242 if (pos >= offsetInResult && startOffsetInChunk + pos < state.metadata.numValues &&
243 !resultVector->isNull(pos)) {
244 // TODO(bmwinger): optimize index scans by grouping them when adjacent
245 const auto offsetInGroup = startOffsetInChunk + pos - offsetInResult;
246 string_index_t index = 0;
247 indexColumn->scanSegment(getChildState(state, ChildStateIndex::INDEX), offsetInGroup, 1,
248 reinterpret_cast<uint8_t*>(&index));
249 offsetsToScan.emplace_back(index, pos);
250 }
251 }
252
253 if (offsetsToScan.size() == 0) {
254 // All scanned values are null
255 return;
256 }
257 dictionary.scan(getChildState(state, ChildStateIndex::OFFSET),
258 getChildState(state, ChildStateIndex::DATA), offsetsToScan, resultVector,
259 getChildState(state, ChildStateIndex::INDEX).metadata);
260}
261
262bool StringColumn::canCheckpointInPlace(const SegmentState& state,
263 const ColumnCheckpointState& checkpointState) const {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected