| 235 | } |
| 236 | |
| 237 | void 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 | |
| 262 | bool StringColumn::canCheckpointInPlace(const SegmentState& state, |
| 263 | const ColumnCheckpointState& checkpointState) const { |
nothing calls this directly
no test coverage detected