| 99 | } |
| 100 | |
| 101 | string DecodeNdv(const string& ndv, bool is_encoded) { |
| 102 | if (!is_encoded) return ndv; |
| 103 | DCHECK_EQ(ndv.size() % 2, 0); |
| 104 | string decoded_ndv(AggregateFunctions::DEFAULT_HLL_LEN, 0); |
| 105 | int idx = 0; |
| 106 | for (int i = 0; i < ndv.size(); i += 2) { |
| 107 | for (int j = 0; j < (static_cast<uint8_t>(ndv[i])) + 1; ++j) { |
| 108 | decoded_ndv[idx++] = ndv[i+1]; |
| 109 | } |
| 110 | } |
| 111 | DCHECK_EQ(idx, AggregateFunctions::DEFAULT_HLL_LEN); |
| 112 | return decoded_ndv; |
| 113 | } |
| 114 | |
| 115 | #define UPDATE_LOW_VALUE(TYPE) \ |
| 116 | if (!(low_value.__isset.TYPE##_val) || value.TYPE##_val < low_value.TYPE##_val) { \ |