File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -796,6 +796,6 @@ const std::vector<std::unique_ptr<TableUpdate>>& TableMetadataBuilder::changes()
796796
797797const TableMetadata* TableMetadataBuilder::base () const { return impl_->base ; }
798798
799- const TableMetadata* TableMetadataBuilder::current () const { return & impl_->metadata ; }
799+ const TableMetadata& TableMetadataBuilder::current () const { return impl_->metadata ; }
800800
801801} // namespace iceberg
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ class ICEBERG_EXPORT TableMetadataBuilder : public ErrorCollector {
426426 const TableMetadata* base () const ;
427427
428428 // / \brief Returns the current metadata with staged changes applied
429- const TableMetadata* current () const ;
429+ const TableMetadata& current () const ;
430430
431431 // / \brief Destructor
432432 ~TableMetadataBuilder () override ;
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ Result<std::shared_ptr<Transaction>> Transaction::Make(std::shared_ptr<Table> ta
4949
5050const TableMetadata* Transaction::base () const { return metadata_builder_->base (); }
5151
52- const TableMetadata* Transaction::current () const { return metadata_builder_->current (); }
52+ const TableMetadata& Transaction::current () const { return metadata_builder_->current (); }
5353
5454Status Transaction::AddUpdate (const std::shared_ptr<PendingUpdate>& update) {
5555 if (!last_update_committed_) {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this<Transacti
4747 const TableMetadata* base () const ;
4848
4949 // / \brief Return the current metadata with staged changes applied
50- const TableMetadata* current () const ;
50+ const TableMetadata& current () const ;
5151
5252 // / \brief Apply the pending changes from all actions and commit.
5353 // /
Original file line number Diff line number Diff line change @@ -78,11 +78,6 @@ UpdateProperties& UpdateProperties::Remove(const std::string& key) {
7878Result<PendingUpdate::ApplyResult> UpdateProperties::Apply () {
7979 ICEBERG_RETURN_UNEXPECTED (CheckErrors ());
8080
81- const auto * base_metadata = transaction_->current ();
82- if (!base_metadata) {
83- return InvalidArgument (" Base table metadata is required to apply property updates" );
84- }
85-
8681 auto iter = updates_.find (TableProperties::kFormatVersion .key ());
8782 if (iter != updates_.end ()) {
8883 int parsed_version = 0 ;
@@ -105,7 +100,7 @@ Result<PendingUpdate::ApplyResult> UpdateProperties::Apply() {
105100 updates_.erase (iter);
106101 }
107102
108- if (auto schema = base_metadata-> Schema (); schema.has_value ()) {
103+ if (auto schema = transaction_-> current (). Schema (); schema.has_value ()) {
109104 ICEBERG_RETURN_UNEXPECTED (
110105 MetricsConfig::VerifyReferencedColumns (updates_, *schema.value ()));
111106 }
You can’t perform that action at this time.
0 commit comments