| 219 | } |
| 220 | |
| 221 | String parseKeyNameFromImplicitFileName(const String & implicit_file_name, const String & map_col) |
| 222 | { |
| 223 | String prefix = getMapKeyPrefix(map_col); |
| 224 | String unescape_file_name = unescapeForFileName(implicit_file_name); |
| 225 | if (!startsWith(unescape_file_name, prefix)) |
| 226 | throw Exception(ErrorCodes::INVALID_IMPLICIT_COLUMN_FILE_NAME, "Implicit file name {} is not belong to map column {} ", implicit_file_name, map_col); |
| 227 | |
| 228 | auto extension_loc = implicit_file_name.find('.'); /// only extension contain dot, other dots in column name are escaped. |
| 229 | if (extension_loc == String::npos) |
| 230 | throw Exception(ErrorCodes::INVALID_IMPLICIT_COLUMN_FILE_NAME, "Invalid file name of implicit column: {]", implicit_file_name); |
| 231 | size_t extension_size = implicit_file_name.size() - extension_loc; |
| 232 | |
| 233 | return unescape_file_name.substr(prefix.size(), unescape_file_name.size() - prefix.size() - extension_size); |
| 234 | } |
| 235 | |
| 236 | String parseMapNameFromImplicitColName(const String & implicit_column_name) |
| 237 | { |
no test coverage detected