Skip to content

Commit d8cd04e

Browse files
author
shuxu.li
committed
feat: RegisterTable support for InMemoryCatalog
1 parent 98bf7d5 commit d8cd04e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/iceberg/catalog/in_memory_catalog.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,20 +411,20 @@ Status InMemoryCatalog::DropTable(const TableIdentifier& identifier, bool purge)
411411
Result<std::shared_ptr<Table>> InMemoryCatalog::LoadTable(
412412
const TableIdentifier& identifier) {
413413
if (!file_io_) [[unlikely]] {
414-
return NotSupported("file_io is not set for catalog {}", catalog_name_);
414+
return InvalidArgument("file_io is not set for catalog {}", catalog_name_);
415415
}
416416

417417
Result<std::string> metadata_location;
418418
{
419419
std::unique_lock lock(mutex_);
420-
metadata_location = root_namespace_->GetTableMetadataLocation(identifier);
421-
ICEBERG_RETURN_UNEXPECTED(metadata_location);
420+
ICEBERG_ASSIGN_OR_RAISE(metadata_location,
421+
root_namespace_->GetTableMetadataLocation(identifier));
422422
}
423423

424-
auto metadata = TableMetadataUtil::Read(*file_io_, metadata_location.value());
425-
ICEBERG_RETURN_UNEXPECTED(metadata);
424+
ICEBERG_ASSIGN_OR_RAISE(auto metadata,
425+
TableMetadataUtil::Read(*file_io_, metadata_location.value()));
426426

427-
return std::make_shared<Table>(identifier, std::move(metadata.value()),
427+
return std::make_shared<Table>(identifier, std::move(metadata),
428428
metadata_location.value(), file_io_,
429429
std::static_pointer_cast<Catalog>(shared_from_this()));
430430
}

0 commit comments

Comments
 (0)