Copilot commented on code in PR #980:
URL: https://github.com/apache/iceberg-cpp/pull/980#discussion_r4154890591


##########
src/iceberg/catalog/memory/in_memory_catalog.cc:
##########
@@ -609,7 +614,9 @@ Result<std::shared_ptr<Table>> 
InMemoryCatalog::RegisterTable(
                           TableMetadataUtil::Read(*file_io_, 
metadata_file_location));
 
   std::unique_lock lock(mutex_);
-  if (!root_namespace_->NamespaceExists(identifier.ns)) {
+  ICEBERG_ASSIGN_OR_RAISE(auto namespace_exists,
+                          root_namespace_->NamespaceExists(identifier.ns));

Review Comment:
   The namespace validation still runs after `TableMetadataUtil::Read`, so 
registering an unreadable/nonexistent metadata path into a missing namespace 
returns the read error rather than `kNoSuchNamespace`. 
`SqlCatalog::RegisterTable` validates the namespace first 
(`sql_catalog.cc:583-594`), so move this check ahead of the read to make the 
new behavior consistent for every missing-namespace request.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to