Skip to content

Commit

Permalink
Merge pull request #50369 from ClickHouse/backport/23.4/50232
Browse files Browse the repository at this point in the history
Backport #50232 to 23.4: Fix iceberg metadata parsing
  • Loading branch information
kssenii committed May 31, 2023
2 parents edcd8ed + 7519fdb commit 3ce5413
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Storages/DataLakes/IcebergMetadataParser.cpp
Expand Up @@ -243,7 +243,13 @@ struct IcebergMetadataParser<Configuration, MetadataReadHelper>::Impl

const auto * str_col = assert_cast<const ColumnString *>(col_str.get());
for (size_t i = 0; i < str_col->size(); ++i)
keys.emplace_back(str_col->getDataAt(i).toView());
{
const auto data_path = std::string(str_col->getDataAt(i).toView());
const auto pos = data_path.find(configuration.url.key);
if (pos == std::string::npos)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected to find {} in data path: {}", configuration.url.key, data_path);
keys.emplace_back(data_path.substr(pos));
}
}

return keys;
Expand Down

0 comments on commit 3ce5413

Please sign in to comment.