Skip to content

Commit 5023874

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ bool isRelativePath(const std::string & path)
8282
if (!extractStorageType(path).empty())
8383
return false;
8484

85-
// Non-relative if it starts with '/' (absolute POSIX path)
86-
if (!path.empty() && path.front() == '/')
87-
return false;
85+
// // Non-relative if it starts with '/' (absolute POSIX path)
86+
// if (!path.empty() && path.front() == '/')
87+
// return false;
8888

8989
return true;
9090
}
@@ -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)