Merge pull request #59275 from ClickHouse/Avogar-patch-1

Fix abort in iceberg metadata on bad file paths
This commit is contained in:
Kseniia Sumarokova 2024-01-29 10:35:34 +01:00 committed by GitHub
commit 0f88da5fd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -596,10 +596,11 @@ Strings IcebergMetadata::getDataFiles()
const auto status = status_int_column->getInt(i);
const auto data_path = std::string(file_path_string_column->getDataAt(i).toView());
const auto pos = data_path.find(configuration.url.key);
const auto file_path = data_path.substr(pos);
if (pos == std::string::npos)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected to find {} in data path: {}", configuration.url.key, data_path);
const auto file_path = data_path.substr(pos);
if (ManifestEntryStatus(status) == ManifestEntryStatus::DELETED)
{
LOG_TEST(log, "Processing delete file for path: {}", file_path);