| 314 | } |
| 315 | |
| 316 | VectorPtr EvalCtx::ensureFieldLoaded( |
| 317 | int32_t index, |
| 318 | const SelectivityVector& rows) { |
| 319 | auto field = getField(index); |
| 320 | if (isLazyNotLoaded(*field)) { |
| 321 | const auto& rowsToLoad = isFinalSelection_ ? rows : *finalSelection_; |
| 322 | |
| 323 | LocalDecodedVector holder(*this); |
| 324 | auto decoded = holder.get(); |
| 325 | LocalSelectivityVector baseRowsHolder(*this, 0); |
| 326 | auto baseRows = baseRowsHolder.get(); |
| 327 | auto rawField = field.get(); |
| 328 | LazyVector::ensureLoadedRows(field, rowsToLoad, *decoded, *baseRows); |
| 329 | if (rawField != field.get()) { |
| 330 | if (peeledFields_.empty()) { |
| 331 | const_cast<RowVector*>(row_)->childAt(index) = field; |
| 332 | } else { |
| 333 | peeledFields_[index] = field; |
| 334 | } |
| 335 | } |
| 336 | } else { |
| 337 | // This is needed in any case because wrappers must be initialized also if |
| 338 | // they contain a loaded lazyVector. |
| 339 | field->loadedVector(); |
| 340 | } |
| 341 | |
| 342 | return field; |
| 343 | } |
| 344 | |
| 345 | // Utility function used to extend the size of a complex Vector by wrapping it |
| 346 | // in a dictionary with identity mapping for existing rows. |
no test coverage detected