| 227 | } |
| 228 | |
| 229 | void ColumnSelector::updateSelectedByName(std::vector<bool>& selectedColumns, |
| 230 | const std::string& fieldName) { |
| 231 | std::map<std::string, uint64_t>::const_iterator ite = nameIdMap_.find(fieldName); |
| 232 | if (ite != nameIdMap_.end()) { |
| 233 | updateSelectedByTypeId(selectedColumns, ite->second); |
| 234 | } else { |
| 235 | bool first = true; |
| 236 | std::ostringstream ss; |
| 237 | ss << "Invalid column selected " << fieldName << ". Valid names are "; |
| 238 | for (auto it = nameIdMap_.begin(); it != nameIdMap_.end(); ++it) { |
| 239 | if (!first) ss << ", "; |
| 240 | ss << it->first; |
| 241 | first = false; |
| 242 | } |
| 243 | throw ParseError(ss.str()); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | ColumnSelector::ColumnSelector(const FileContents* contents) : contents_(contents) { |
| 248 | buildTypeNameIdMap(contents_->schema.get()); |
no test coverage detected