File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ set(ICEBERG_SOURCES
6666 transform.cc
6767 transform_function.cc
6868 type.cc
69+ update_partition_spec.cc
6970 util/bucket_util.cc
7071 util/conversions.cc
7172 util/decimal.cc
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ iceberg_sources = files(
8888 ' transform.cc' ,
8989 ' transform_function.cc' ,
9090 ' type.cc' ,
91+ ' update_partition_spec.cc' ,
9192 ' util/bucket_util.cc' ,
9293 ' util/conversions.cc' ,
9394 ' util/decimal.cc' ,
Original file line number Diff line number Diff line change 2828#include " iceberg/table_metadata.h"
2929#include " iceberg/table_properties.h"
3030#include " iceberg/table_scan.h"
31+ #include " iceberg/update_partition_spec.h"
3132#include " iceberg/util/macros.h"
3233
3334namespace iceberg {
@@ -94,6 +95,8 @@ const TableProperties& Table::properties() const { return *properties_; }
9495
9596const std::string& Table::location () const { return metadata_->location ; }
9697
98+ const TableMetadata& Table::metadata () const { return *metadata_; }
99+
97100Result<std::shared_ptr<Snapshot>> Table::current_snapshot () const {
98101 return metadata_->Snapshot ();
99102}
@@ -110,6 +113,10 @@ const std::vector<SnapshotLogEntry>& Table::history() const {
110113 return metadata_->snapshot_log ;
111114}
112115
116+ std::unique_ptr<UpdatePartitionSpec> Table::UpdateSpec () {
117+ return std::make_unique<UpdatePartitionSpec>(this );
118+ }
119+
113120std::unique_ptr<Transaction> Table::NewTransaction () const {
114121 throw NotImplemented (" Table::NewTransaction is not implemented" );
115122}
Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ class ICEBERG_EXPORT Table {
8787 // / \brief Return the table's base location
8888 const std::string& location () const ;
8989
90+ // / \brief Return the table's metadata
91+ const TableMetadata& metadata () const ;
92+
9093 // / \brief Return the table's current snapshot, return NotFoundError if not found
9194 Result<std::shared_ptr<Snapshot>> current_snapshot () const ;
9295
@@ -104,6 +107,11 @@ class ICEBERG_EXPORT Table {
104107 // / \return a vector of history entries
105108 const std::vector<SnapshotLogEntry>& history () const ;
106109
110+ // / \brief Create a new UpdatePartitionSpec to alter the partition spec of this table
111+ // / and commit the changes.
112+ // / \return a pointer to the new UpdatePartitionSpec
113+ std::unique_ptr<UpdatePartitionSpec> UpdateSpec ();
114+
107115 // / \brief Create a new table scan builder for this table
108116 // /
109117 // / Once a table scan builder is created, it can be refined to project columns and
Original file line number Diff line number Diff line change @@ -161,6 +161,16 @@ class PendingUpdate;
161161template <typename T>
162162class PendingUpdateTyped ;
163163
164+ class BoundPredicate ;
165+ class UnboundPredicate ;
166+
167+ class BoundReference ;
168+ class BoundTransform ;
169+ template <typename B>
170+ class UnboundTerm ;
171+
172+ class UpdatePartitionSpec ;
173+
164174// / ----------------------------------------------------------------------------
165175// / TODO: Forward declarations below are not added yet.
166176// / ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments