| 66 | } |
| 67 | |
| 68 | SelectivityVector* PeeledEncoding::translateToInnerRows( |
| 69 | const SelectivityVector& outerRows, |
| 70 | LocalSelectivityVector& innerRowsHolder) const { |
| 71 | BOLT_CHECK(wrapEncoding_ != VectorEncoding::Simple::FLAT); |
| 72 | if (wrapEncoding_ == VectorEncoding::Simple::CONSTANT) { |
| 73 | auto newRows = innerRowsHolder.get(constantWrapIndex_ + 1, false); |
| 74 | newRows->setValid(constantWrapIndex_, true); |
| 75 | newRows->updateBounds(); |
| 76 | return newRows; |
| 77 | } |
| 78 | auto baseSize = baseSize_; |
| 79 | auto indices = wrap_->as<vector_size_t>(); |
| 80 | // If the wrappers add nulls, do not enable the inner rows. The |
| 81 | // indices for places that a dictionary sets to null are not |
| 82 | // defined. Null adding dictionaries are not peeled off non |
| 83 | // null-propagating Exprs. |
| 84 | auto flatNulls = wrapNulls_ ? wrapNulls_->as<uint64_t>() : nullptr; |
| 85 | |
| 86 | auto* newRows = innerRowsHolder.get(baseSize, false); |
| 87 | bolt::translateToInnerRows(outerRows, indices, flatNulls, *newRows); |
| 88 | |
| 89 | return newRows; |
| 90 | } |
| 91 | |
| 92 | namespace { |
| 93 | inline void setPeeled( |