Skip to content

Commit 5d32053

Browse files
committed
fix schema id cache population
correct splitting of URI into parts
1 parent d8611fb commit 5d32053

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ void IcebergMetadata::initializeSchemasFromManifestList(ContextPtr local_context
908908
for (const auto & manifest_file_entry : manifest_file_ptr->getFiles())
909909
{
910910
if (std::holds_alternative<DataFileEntry>(manifest_file_entry.file))
911-
schema_id_by_data_file.emplace(std::get<DataFileEntry>(manifest_file_entry.file).file_name, manifest_file_ptr->getSchemaId());
911+
schema_id_by_data_file.emplace(Iceberg::makeAbsolutePath(table_location, std::get<DataFileEntry>(manifest_file_entry.file).file_name), manifest_file_ptr->getSchemaId());
912912
}
913913
}
914914

src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ UriParts parseUri(const std::string & uri)
105105
if (slash == std::string_view::npos)
106106
{
107107
parts.authority = std::string(rest);
108-
parts.path = "/";
108+
parts.path = "/"; // Happy debugging. FIXME: throw exception, path obviously incorrect
109109
return parts;
110110
}
111111
parts.authority = std::string(rest.substr(0, slash));
112-
parts.path = std::string(rest.substr(slash)); // keep leading '/'
112+
parts.path = std::string(rest.substr(++slash)); // do not keep leading '/'
113113
return parts;
114114
}
115115

0 commit comments

Comments
 (0)