2929#include " iceberg/table_requirements.h"
3030#include " iceberg/table_update.h"
3131#include " iceberg/transaction.h"
32+ #include " iceberg/util/checked_cast.h"
3233#include " iceberg/util/macros.h"
3334
3435namespace iceberg {
@@ -423,8 +424,7 @@ Result<std::shared_ptr<Table>> InMemoryCatalog::CreateTable(
423424 ICEBERG_RETURN_UNEXPECTED (
424425 root_namespace_->UpdateTableMetadataLocation (identifier, metadata_file_location));
425426 return Table::Make (identifier, std::move (table_metadata),
426- std::move (metadata_file_location), file_io_,
427- std::static_pointer_cast<Catalog>(shared_from_this ()));
427+ std::move (metadata_file_location), file_io_, shared_from_this ());
428428}
429429
430430Result<std::shared_ptr<Table>> InMemoryCatalog::UpdateTable (
@@ -444,7 +444,8 @@ Result<std::shared_ptr<Table>> InMemoryCatalog::UpdateTable(
444444 for (const auto & update : updates) {
445445 if (update->kind () == TableUpdate::Kind::kUpgradeFormatVersion ) {
446446 format_version =
447- dynamic_cast <const table::UpgradeFormatVersion&>(*update).format_version ();
447+ internal::checked_cast<const table::UpgradeFormatVersion&>(*update)
448+ .format_version ();
448449 }
449450 }
450451 builder = TableMetadataBuilder::BuildFromEmpty (format_version);
@@ -496,7 +497,8 @@ Result<std::shared_ptr<Transaction>> InMemoryCatalog::StageCreateTable(
496497 ICEBERG_ASSIGN_OR_RAISE (
497498 auto table, StagedTable::Make (identifier, std::move (table_metadata), " " , file_io_,
498499 shared_from_this ()));
499- return Transaction::Make (std::move (table), Transaction::Kind::kCreate , false );
500+ return Transaction::Make (std::move (table), Transaction::Kind::kCreate ,
501+ /* auto_commit */ false );
500502}
501503
502504Result<bool > InMemoryCatalog::TableExists (const TableIdentifier& identifier) const {
0 commit comments