| 181 | |
| 182 | protected: |
| 183 | std::string printNonNull(vector_size_t index, const std::string& indent) |
| 184 | const override { |
| 185 | std::stringstream out; |
| 186 | |
| 187 | auto mapVector = decoded_.base()->as<MapVector>(); |
| 188 | auto mapIndex = decoded_.index(index); |
| 189 | |
| 190 | const auto& keys = children_[0]; |
| 191 | const auto& values = children_[1]; |
| 192 | |
| 193 | auto offset = mapVector->offsetAt(mapIndex); |
| 194 | auto size = mapVector->sizeAt(mapIndex); |
| 195 | |
| 196 | auto newIndent = addIndent(indent); |
| 197 | |
| 198 | bool fixedWidthKey = mapVector->type()->childAt(0)->isFixedWidth(); |
| 199 | bool fixedWidthValue = mapVector->type()->childAt(1)->isFixedWidth(); |
| 200 | |
| 201 | for (auto i = 0; i < size; ++i) { |
| 202 | if (fixedWidthKey) { |
| 203 | out << indent << "Key " << i << ": " |
| 204 | << printFixedWidth(keys->decoded(), offset + i) << std::endl; |
| 205 | } else { |
| 206 | out << indent << "Key " << i << ": " << values->summarize(offset + i) |
| 207 | << std::endl; |
| 208 | out << keys->print(offset + i, newIndent); |
| 209 | } |
| 210 | |
| 211 | if (fixedWidthValue) { |
| 212 | out << indent << "Value " << i << ": " |
| 213 | << printFixedWidth(values->decoded(), offset + i) << std::endl; |
| 214 | } else { |
| 215 | out << indent << "Value " << i << ": " << values->summarize(offset + i) |
| 216 | << std::endl; |
| 217 | out << values->print(offset + i, newIndent); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | return out.str(); |
| 222 | } |
| 223 | |
| 224 | std::string summarizeNonNull(vector_size_t index) const override { |
| 225 | auto* base = decoded_.base(); |
nothing calls this directly
no test coverage detected