| 43 | } |
| 44 | |
| 45 | void AggregationMasks::addInput( |
| 46 | const RowVectorPtr& input, |
| 47 | const SelectivityVector& rows) { |
| 48 | for (auto& entry : maskedRows_) { |
| 49 | SelectivityVector& maskedRows = entry.second; |
| 50 | maskedRows = rows; |
| 51 | |
| 52 | // Get the projection column vector that would be our mask. |
| 53 | const auto& maskVector = input->childAt(entry.first); |
| 54 | |
| 55 | // Get decoded vector and update the masked selectivity vector. |
| 56 | decodedMask_.decode(*maskVector, rows); |
| 57 | if (decodedMask_.isConstantMapping()) { |
| 58 | if (decodedMask_.isNullAt(rows.begin()) || |
| 59 | !decodedMask_.valueAt<bool>(rows.begin())) { |
| 60 | maskedRows.setValidRange(rows.begin(), rows.end(), false); |
| 61 | maskedRows.updateBounds(); |
| 62 | } |
| 63 | } else { |
| 64 | rows.applyToSelected([&](vector_size_t i) { |
| 65 | if (decodedMask_.isNullAt(i) || !decodedMask_.valueAt<bool>(i)) { |
| 66 | maskedRows.setValid(i, false); |
| 67 | } |
| 68 | }); |
| 69 | maskedRows.updateBounds(); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | const SelectivityVector* FOLLY_NULLABLE |
| 75 | AggregationMasks::activeRows(int32_t aggregationIndex) const { |
nothing calls this directly
no test coverage detected