Skip to content

Commit 4619924

Browse files
committed
Fix segfault with undefined relevant_snapshot in Iceberg metadata
1 parent b69dde6 commit 4619924

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,12 +990,16 @@ std::optional<size_t> IcebergMetadata::totalBytes(ContextPtr local_context) cons
990990
std::optional<String> IcebergMetadata::partitionKey(ContextPtr) const
991991
{
992992
SharedLockGuard lock(mutex);
993+
if (!relevant_snapshot)
994+
return {};
993995
return relevant_snapshot->partition_key;
994996
}
995997

996998
std::optional<String> IcebergMetadata::sortingKey(ContextPtr) const
997999
{
9981000
SharedLockGuard lock(mutex);
1001+
if (!relevant_snapshot)
1002+
return {};
9991003
return relevant_snapshot->sorting_key;
10001004
}
10011005

0 commit comments

Comments
 (0)