Skip to content

Commit db26f7a

Browse files
committed
feat: update partition spec
1 parent 09f26b6 commit db26f7a

File tree

13 files changed

+1781
-2
lines changed

13 files changed

+1781
-2
lines changed

src/iceberg/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ set(ICEBERG_SOURCES
7272
transform.cc
7373
transform_function.cc
7474
type.cc
75+
update/update_partition_spec.cc
7576
update/update_properties.cc
7677
util/bucket_util.cc
7778
util/conversions.cc

src/iceberg/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ iceberg_sources = files(
9494
'transform.cc',
9595
'transform_function.cc',
9696
'type.cc',
97+
'update/update_partition_spec.cc',
9798
'update/update_properties.cc',
9899
'util/bucket_util.cc',
99100
'util/conversions.cc',

src/iceberg/table.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "iceberg/table_metadata.h"
2727
#include "iceberg/table_properties.h"
2828
#include "iceberg/table_scan.h"
29+
#include "iceberg/update/update_partition_spec.h"
2930
#include "iceberg/update/update_properties.h"
3031
#include "iceberg/util/macros.h"
3132

@@ -113,6 +114,10 @@ std::unique_ptr<UpdateProperties> Table::UpdateProperties() const {
113114
return std::make_unique<iceberg::UpdateProperties>(identifier_, catalog_, metadata_);
114115
}
115116

117+
std::unique_ptr<UpdatePartitionSpec> Table::UpdateSpec() {
118+
return std::make_unique<UpdatePartitionSpec>(identifier_, catalog_, metadata_);
119+
}
120+
116121
std::unique_ptr<Transaction> Table::NewTransaction() const {
117122
throw NotImplemented("Table::NewTransaction is not implemented");
118123
}

src/iceberg/table.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ class ICEBERG_EXPORT Table {
110110
/// \return a new UpdateProperties instance
111111
virtual std::unique_ptr<iceberg::UpdateProperties> UpdateProperties() const;
112112

113+
/// \brief Create a new UpdatePartitionSpec to alter the partition spec of this table
114+
/// and commit the changes.
115+
/// \return a pointer to the new UpdatePartitionSpec
116+
virtual std::unique_ptr<UpdatePartitionSpec> UpdateSpec();
117+
113118
/// \brief Create a new table scan builder for this table
114119
///
115120
/// Once a table scan builder is created, it can be refined to project columns and

src/iceberg/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ add_iceberg_test(table_test
7777
table_requirement_test.cc
7878
table_requirements_test.cc
7979
table_update_test.cc
80+
update_partition_spec_test.cc
8081
update_properties_test.cc)
8182

8283
add_iceberg_test(expression_test

src/iceberg/test/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ iceberg_tests = {
5353
'table_requirement_test.cc',
5454
'table_test.cc',
5555
'table_update_test.cc',
56+
'update_partition_spec_test.cc',
5657
'update_properties_test.cc',
5758
),
5859
},

0 commit comments

Comments
 (0)