| 2028 | // Helper: copy from a source value into all null slots of the output |
| 2029 | template <typename Type> |
| 2030 | void CopyValuesAllValid(const ExecValue& source, uint8_t* out_valid, uint8_t* out_values, |
| 2031 | const int64_t out_offset, const int64_t length) { |
| 2032 | BitRunReader bit_reader(out_valid, out_offset, length); |
| 2033 | int64_t offset = 0; |
| 2034 | while (true) { |
| 2035 | const auto run = bit_reader.NextRun(); |
| 2036 | if (run.length == 0) { |
| 2037 | break; |
| 2038 | } |
| 2039 | if (!run.set) { |
| 2040 | CopyValues<Type>(source, offset, run.length, out_valid, out_values, |
| 2041 | out_offset + offset); |
| 2042 | } |
| 2043 | offset += run.length; |
| 2044 | } |
| 2045 | DCHECK_EQ(offset, length); |
| 2046 | } |
| 2047 | |
| 2048 | // Helper: zero the values buffer of the output wherever the slot is null |
| 2049 | void InitializeNullSlots(const DataType& type, uint8_t* out_valid, uint8_t* out_values, |