| 199 | } |
| 200 | |
| 201 | String parseMapNameFromImplicitFileName(const String & implicit_file_name) |
| 202 | { |
| 203 | String unescape_file_name = unescapeForFileName(implicit_file_name); |
| 204 | if (!startsWith(unescape_file_name, getMapSeparator())) |
| 205 | throw Exception(ErrorCodes::INVALID_IMPLICIT_COLUMN_NAME, "Invalid implicit file name: {}", implicit_file_name); |
| 206 | |
| 207 | /// Base file need to use implicit file name instead of unescape_file_name |
| 208 | auto location_base = implicit_file_name.find("_base.", getMapSeparator().size()); |
| 209 | if (location_base == String::npos) |
| 210 | { |
| 211 | /// Due to map column name meets the constraint in MergeTreeMetaBase::checkColumnsValidity, so we can find second separator directly. |
| 212 | auto location = unescape_file_name.find(getMapSeparator(), getMapSeparator().size()); |
| 213 | if (location == String::npos) |
| 214 | throw Exception(ErrorCodes::INVALID_IMPLICIT_COLUMN_NAME, "Invalid implicit column name: {}", implicit_file_name); |
| 215 | return unescape_file_name.substr(getMapSeparator().size(), location - getMapSeparator().size()); |
| 216 | } |
| 217 | else |
| 218 | return unescapeForFileName(implicit_file_name.substr(getMapSeparator().size(), location_base - getMapSeparator().size())); |
| 219 | } |
| 220 | |
| 221 | String parseKeyNameFromImplicitFileName(const String & implicit_file_name, const String & map_col) |
| 222 | { |
no test coverage detected